forked from md-siam/widget_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_modelbottomsheet.dart
44 lines (42 loc) · 1.32 KB
/
show_modelbottomsheet.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import 'package:flutter/material.dart';
class MyShowModelBottomSheet extends StatelessWidget {
const MyShowModelBottomSheet({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('showModelBottomSheet')),
body: Center(
child: ElevatedButton(
child: const Text('Model Bottom Sheet'),
onPressed: () {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 400,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text(
'Model Bottom Sheet',
style: TextStyle(fontSize: 24),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('Close'),
),
],
),
),
);
},
);
},
),
),
);
}
}