Skip to content

Instantly share code, notes, and snippets.

@nbnD
Last active July 25, 2022 11:40
Show Gist options
  • Save nbnD/afed4adb8d5801a2a9f01e6887d29ab0 to your computer and use it in GitHub Desktop.
Save nbnD/afed4adb8d5801a2a9f01e6887d29ab0 to your computer and use it in GitHub Desktop.
Snackbar
showModalBottomSheet(
context: context,
builder: (context) {
return Scaffold( //scaffold provides us the ability to show snackbar in the modal bottom sheet
body: Column(
mainAxisSize: MainAxisSize.min,
children: [
const ListTile(
leading: Icon(Icons.person),
title: Text("Profile"),
),
const ListTile(
leading: Icon(Icons.edit),
title: Text("Edit"),
),
const ListTile(
leading: Icon(Icons.exit_to_app),
title: Text("Exit"),
),
TextButton(
onPressed: () {
//We display the snack bar when on Pressed
},
child: const Text("OK")),
],
),
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment