owner._debugCurrentBuildTarget == this ,不是真的

Leo*_* Ma 15 flutter flutter-layout flutter-web

[on web] 尝试将一些小部件放入这样的 a 中FittedBox

 FittedBox(
   fit: BoxFit.scaleDown,
   child: AnimatedContainer(...)
 )
Run Code Online (Sandbox Code Playgroud)

但屏幕和控制台仅显示此消息:

错误

控制台中没有其他内容

下一步是什么?:D

Joe*_*ler 9

我在 CustomScrollView 内收到此错误,因为我的一个小部件不在 SliverToBoxAdapter 内。

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

我只是确保您的条子列表中的所有小部件实际上都是条子。


Leo*_* Ma 5

在对代码稍加改动后,框架提供了更多信息,例如额外的孩子,父母的随机大小。. .

错误 >> ... object was given an infinite size during layout

最终一些这样的工作:

FittedBox(
 fit: BoxFit.scaleDown,
 child: Container(
   height: MediaQuery.of(context).size.height * .65,
   child: AnimatedContainer(...)
)
Run Code Online (Sandbox Code Playgroud)