bottomsheet collapse automatically in flutter code example
Example 1: mainBottomSheet dismiss flutte
Navigator.pop(context);
Example 2: showModalBottomSheet on load
void initState() {
// TODO: implement initState
Future.delayed(Duration(seconds: 0)).then((_) {
showModalBottomSheet(
context: context,
builder: (builder) {
return Container();
});
});
super.initState();
}