Created
March 8, 2021 09:45
-
-
Save ayoubm/99a72bae479a1f84bb70804f416de017 to your computer and use it in GitHub Desktop.
Flutter BottomSheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _MyFloatingActionButtonState extends State<MyFloatingActionButton> { | |
bool showFab = true; | |
@override | |
Widget build(BuildContext context) { | |
return showFab | |
? FloatingActionButton( | |
onPressed: () { | |
var bottomSheetController = showBottomSheet( | |
context: context, | |
builder: (context) => Container( | |
color: Colors.grey[900], | |
height: 250, | |
)); | |
showFoatingActionButton(false); | |
bottomSheetController.closed.then((value) { | |
showFoatingActionButton(true); | |
}); | |
}, | |
) | |
: Container(); | |
} | |
void showFoatingActionButton(bool value) { | |
setState(() { | |
showFab = value; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment