Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter owner.\u debugCurrentBuildTarget==这不是真的_Flutter_Flutter Layout_Flutter Web - Fatal编程技术网

Flutter owner.\u debugCurrentBuildTarget==这不是真的

Flutter owner.\u debugCurrentBuildTarget==这不是真的,flutter,flutter-layout,flutter-web,Flutter,Flutter Layout,Flutter Web,[在web上]尝试在FittedBox中安装一些小部件,如下所示: FittedBox( fit: BoxFit.scaleDown, child: AnimatedContainer(...) ) 但屏幕和控制台仅显示以下消息: 控制台里没有别的东西了 下一步是什么D在对代码进行了一些修改后,框架提供了更多信息,比如额外的子项、随机大小的父项 错误>>。。。在布局过程中,对象被赋予了无限大 最终,一些类似的方法奏效了: FittedBox( fit: BoxFit.sca

[在web上]尝试在
FittedBox
中安装一些小部件,如下所示:

 FittedBox(
   fit: BoxFit.scaleDown,
   child: AnimatedContainer(...)
 )
但屏幕和控制台仅显示以下消息:

控制台里没有别的东西了


下一步是什么D

在对代码进行了一些修改后,框架提供了更多信息,比如额外的子项、随机大小的父项

错误>>
。。。在布局过程中,对象被赋予了无限大

最终,一些类似的方法奏效了:

FittedBox(
 fit: BoxFit.scaleDown,
 child: Container(
   height: MediaQuery.of(context).size.height * .65,
   child: AnimatedContainer(...)
)

我在CustomScrollView中遇到这个错误,因为我的一个小部件不在SliveToboxAdapter中

SliverToBoxAdapter(
  child: Row(
    children: [
      Text('Activity',
      style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18),),
    ],
  ),
)

我只是想确定你的小部件列表中的所有小部件实际上都是小部件。

我之所以会出现这个错误,是因为在我的代码中的某个地方,我错误地应用了一个错误的小部件,而这正是我正在编写的无状态小部件。更清楚地说:

stateless widget - MyWidget //For example
.
.
.
Now somewhere in between the code:

Column(
children: [
MyWidget(), //This went wrong, I was supposed to Use some other widget.
]);

这个答案是正确的。它解决了我的问题。