Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class MyBottomSheet extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("Bottom Modal Sheet"),
- ),
- body: Center(
- child: Container(
- color: Colors.white,
- child: ElevatedButton(
- onPressed: () {
- showModalBottomSheet(
- context: context,
- builder: (builder) {
- return Column(
- children: [
- ListTile(
- onTap: () {
- Navigator.pop(context);
- },
- title: Text("Home"),
- leading: Icon(Icons.home),
- ),
- ListTile(
- title: Text("Settings"),
- leading: Icon(Icons.settings),
- ),
- ListTile(
- title: Text("Share"),
- leading: Icon(Icons.share),
- ),
- ListTile(
- title: Text("Edit"),
- leading: Icon(Icons.edit),
- )
- ],
- );
- });
- },
- child: Text("Show Bottom Modal Sheet"))),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement