(){
try{
Scaffold.of(context);
}catch(e){
//not in Scaffold
}
return Container();
}()
(){
try{
Scaffold.of(context);
}catch(e){
//not in Scaffold
}
return Container();
}()
Updated Answer
resizeToAvoidBottomPadding is now deprecated.
The updated solution is to set resizeToAvoidBottomInset property to false.
Original Answer
In your Scaffold, set resizeToAvoidBottomPadding property to false.
DefaultTextStyle(
style: TextStyle(...),
child: Text('Hello world'),
)
extension GlobalKeyExtension on GlobalKey {
Rect? get globalPaintBounds {
final renderObject = currentContext?.findRenderObject();
final translation = renderObject?.getTransformTo(null).getTranslation();
if (translation != null && renderObject?.paintBounds != null) {
final offset = Offset(translation.x, translation.y);
return renderObject!.paintBounds.shift(offset);
} else {
return null;
}
}
}final containerKey = GlobalKey();
Container(
key: containerKey,
width: 100,
height: 50,
)containerKey.globalPaintBounds
step 1. change to UTF-8 (if the file error)
step 2. copy and paste some dummy content
"New" = "New";
"In Progress" = "In Progress";
"Waiting" = "Waiting";
"Closed" = "Closed";
Short answer:
Use this in 1st page:
Navigator.pushNamed(context, '/page2').then((_) => setState(() {}));
and this in 2nd page:
Navigator.pop(context);