owner._debugCurrentBuildTarget == this , is not true

会有一股神秘感。 提交于 2020-08-08 06:31:41

问题


[on web] tried to fit some widgets inside a FittedBox like this :

 FittedBox(
   fit: BoxFit.scaleDown,
   child: AnimatedContainer(...)
 )

but screen and console show only this message :

there's nothing else in the console

what's the next step here ? :D


回答1:


More Info was provided by the framework after a little messing around with the code , like extra children , random sizes to parents . . .

Error >> ... object was given an infinite size during layout

ultimately some like this worked :

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


来源:https://stackoverflow.com/questions/59130940/owner-debugcurrentbuildtarget-this-is-not-true