forked from md-siam/widget_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawer.dart
54 lines (52 loc) · 1.53 KB
/
drawer.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
45
46
47
48
49
50
51
52
53
54
import 'package:flutter/material.dart';
import '/11_drawer/pages/first_page.dart';
import '/11_drawer/pages/second_page.dart';
class MyDrawer extends StatelessWidget {
const MyDrawer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepPurple[300],
elevation: 0,
title: const Text("D R A W E R"),
),
drawer: Drawer(
child: Container(
color: Colors.deepPurple[100],
child: ListView(
children: [
const DrawerHeader(
child: Center(
child: Text(
"L O G O",
style: TextStyle(fontSize: 24),
),
),
),
ListTile(
leading: const Icon(Icons.home),
title: const Text("Page 1"),
onTap: () => {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const FirstPage()),
),
},
),
ListTile(
leading: const Icon(Icons.person),
title: const Text("Page 2"),
onTap: () => {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const SecondPage()),
),
},
),
],
),
),
),
endDrawer: Drawer(),
);
}
}