flutterflutter-layoutflutter-testflutter-release

Why does my app looks different in debug mode and release mode Flutter


My app looks different in debug and release mode. Video of it:- https://github.com/flutter/flutter/issues/92491


Solution

  • I recently had the same issue, and altering Expanded/Flexible widgets fixed this issue for me.

    I had errors like these in my VS Code

    ════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
    The following assertion was thrown while applying parent data.:
    Incorrect use of ParentDataWidget.
    
    The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type StackParentData.
    
    Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
    The offending Expanded is currently placed inside a Stack widget.
    

    I wrapped a Column that contains a Flexible widget with an Expanded widget like this ->

    return Container(
        .................
        child: Expanded(
          child: Column(
            .........
            children:[
              Flexible(
                child: Text(
                 .........
    

    Simply removing parent Expanded fixed my issue. Here is the updated code:

    return Container(
        .................
          child: Column(
            .........
            children:[
              Flexible(
                child:Text(
                 .........