Advertisement
narimetisaigopi

bottom modal sheet flutter

May 31st, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class MyBottomSheet extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. return Scaffold(
  7. appBar: AppBar(
  8. title: Text("Bottom Modal Sheet"),
  9. ),
  10. body: Center(
  11. child: Container(
  12. color: Colors.white,
  13. child: ElevatedButton(
  14. onPressed: () {
  15. showModalBottomSheet(
  16. context: context,
  17. builder: (builder) {
  18. return Column(
  19. children: [
  20. ListTile(
  21. onTap: () {
  22. Navigator.pop(context);
  23. },
  24. title: Text("Home"),
  25. leading: Icon(Icons.home),
  26. ),
  27. ListTile(
  28. title: Text("Settings"),
  29. leading: Icon(Icons.settings),
  30. ),
  31. ListTile(
  32. title: Text("Share"),
  33. leading: Icon(Icons.share),
  34. ),
  35. ListTile(
  36. title: Text("Edit"),
  37. leading: Icon(Icons.edit),
  38. )
  39. ],
  40. );
  41. });
  42. },
  43. child: Text("Show Bottom Modal Sheet"))),
  44. ),
  45. );
  46. }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement