flutter 为什么我的应用在调试模式和发布模式下看起来不同

kmynzznz  于 2023-05-29  发布在  Flutter
关注(0)|答案(2)|浏览(267)

我的应用程序在调试和发布模式下看起来不同。视频:-https://github.com/flutter/flutter/issues/92491

ztmd8pv5

ztmd8pv51#

那个灰色错误是因为你有一个错误,试着看看你的日志。还有你的app数据是不是来自后台?并且是的,然后请检查您是否在Androidmanifest.xml文件中添加了Internet权限

fcipmucu

fcipmucu2#

我最近遇到了同样的问题,改变扩展/灵活的小部件为我解决了这个问题。
我的VS代码中有这样的错误

════════ 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.

我将包含Flexible小部件的Column与Expanded小部件 Package 在一起,如下所示->

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

简单地删除父级扩展解决了我的问题。下面是更新后的代码:

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

相关问题