Skip to content Skip to sidebar Skip to footer

Flutter: Setstate() Or Markneedsbuild() Called When Widget Tree Was Locked... During Orientation Change

I want to create a App whose UI can be updated based on device orientation. In Portait layout, i use a drawer to show some elements (Fig.). In Landscape layout, there is no drawer

Solution 1:

you can try

Navigator.pop(context, true);

instead of

Navigator.pop()

Solution 2:

void rebuild(BuildContext context) {
  Navigator.pop(context);
  setState(() {});
}

Post a Comment for "Flutter: Setstate() Or Markneedsbuild() Called When Widget Tree Was Locked... During Orientation Change"