I use showRoundedModalBottomSheet
, how can I adjust this modal height till the appbar?
You can use a Column Inside a SingleChildScrollView to dynamically change the height of the bottom sheet and also it gets scrollable once it exceeds the available max height, make sure the isScrollControlled is set to true, and for the border-radius the shape property will help you add the borderRadius to the ...
How To Display Bottom Sheet In Flutter ? To display a general bottom sheet we have to use bottomSheet property of scaffold widget. return Scaffold( appBar: AppBar( title: Text("Flutter Bottom Sheet"), ), body:Container(), bottomSheet: BottomSheet(), );
[Update]
In showModalBottomSheet(...)
set the property isScrollControlled:true
.
It will make bottomSheet to full height.
[Original answer]
You can Implement the FullScreenDialog instead.
Flutter Gallery app has an example of FullScreenDialog
You can open your Dialog using below code:
Navigator.of(context).push(new MaterialPageRoute<Null>( builder: (BuildContext context) { return Dialog(); }, fullscreenDialog: true ));
Check this blog post too for more:
Hope it will help you.
You can control the height by using FractionallySizedBox and setting the isScrollControlled to true.
showModalBottomSheet( context: context, isScrollControlled: true, builder: (context) { return FractionallySizedBox( heightFactor: 0.9, child: Container(), ); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With