Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

owner._debugCurrentBuildTarget == this , is not true

[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 :

error

there's nothing else in the console

what's the next step here ? :D

like image 502
Leo Ma Avatar asked Dec 01 '19 23:12

Leo Ma


2 Answers

I was getting this error inside of a CustomScrollView because one of my widgets wasn't inside of a SliverToBoxAdapter.

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

I'd just make sure all widgets in your sliver list are actually slivers.

like image 198
Joe Muller Avatar answered Nov 17 '22 19:11

Joe Muller


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(...)
)
like image 5
Leo Ma Avatar answered Nov 17 '22 21:11

Leo Ma