I want my bottom sheet to stay on the screen till I close it from a code. Normally the bottom sheet can be closed by pressing back button(device or appbar) or even just by a downward gesture. How can I disable that?
_scaffoldKey.currentState
.showBottomSheet<Null>((BuildContext context) {
final ThemeData themeData = Theme.of(context);
return new ControlBottom(
songName: songName,
url: url,
play: play,
pause: pause,
state: test,
themeData: themeData,
);
}).closed.whenComplete((){
});
Control botton is a different widget.
If you wish to show a persistent bottom sheet, use Scaffold. bottomSheet. To make a persistent bottom sheet that isn't a LocalHistoryEntry and doesn't add a back button to the encasing Scaffold's application bar, utilize the Scaffold. bottomSheetconstructor parameter.
Scaffold now has a bottom sheet argument and this bottom sheet cannot be dismissed by swiping down the screen.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(....),
bottomSheet: Container(
child: Text('Hello World'),
),
);
}
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