Harsh Rajpara
Harsh Rajpara

Reputation: 79

get error of size.isFinite when set positioned for container in stack

I have set positioned as children in Stack.

but when run the code the error show this type:

 Failed assertion: line 600 pos 12: 'size.isFinite': is not true.

this is my code

double width = 200.0;
double height = 80.0;
double top = 100;
double left = 100;
@override
  Widget build(BuildContext context) {
    return Stack(           // error show here to return stack
        children : [
          Positioned(
          top: top,
          left: left,
          child: GestureDetector(
            onPanUpdate: (details) {
              setState(() {
                top += details.delta.dy;
                left += details.delta.dx;
              });
            },
               child: Container(
                 height: height,
                 width: width,
             // ... here container code 
                 ),
          )
          ),
          ]
         );

what is wrong in code?

Upvotes: 0

Views: 81

Answers (0)

Related Questions