Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3b024f4

Browse files
committed
📦 NEW: routes
1 parent f7e5bda commit 3b024f4

File tree

1 file changed

+71
-50
lines changed

1 file changed

+71
-50
lines changed

‎lib/AppDrawer.dart‎

Lines changed: 71 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,85 @@
11
import 'package:flutter/material.dart';
2+
import 'package:assignment6/main.dart';
3+
import 'package:assignment6/AddRecord.dart';
4+
import 'package:assignment6/ListRecord.dart';
25

36
class DrawerList extends StatefulWidget {
47
@override
58
NewDrawerList createState() => NewDrawerList();
69
}
710

811
class NewDrawerList extends State<DrawerList> {
9-
List<String> labels = [
10-
'Today',
11-
'Products',
12-
'Direct Materials',
13-
'Direct Labour',
14-
'Overheads',
15-
'Customers',
16-
'Suppliers',
17-
'Consultants',
18-
'Help',
19-
'Settings',
20-
'Logout'
21-
];
22-
23-
List<IconData> icons = [
24-
Icons.email,
25-
Icons.inbox,
26-
Icons.group,
27-
Icons.local_offer,
28-
Icons.local_offer,
29-
Icons.group,
30-
Icons.group,
31-
Icons.group,
32-
Icons.help_outline,
33-
Icons.settings,
34-
Icons.logout
35-
];
36-
3712
@override
3813
Widget build(BuildContext context) {
39-
return Container(
40-
height: double.maxFinite,
41-
child: ListView.builder(
42-
itemCount: labels.length,
43-
itemBuilder: (context, index) {
44-
return Column(children: <Widget>[
14+
return Drawer(
15+
child: ListView(
16+
children: [
17+
Container(
18+
height: 180.0,
19+
child: DrawerHeader(
20+
child: Column(
21+
crossAxisAlignment: CrossAxisAlignment.start,
22+
children: <Widget>[
4523
Container(
46-
child: index == 1 || index == 7
47-
? Divider(
48-
thickness: 3,
49-
)
50-
: null),
51-
ListTile(
52-
leading: Icon(icons[index], size: 20),
53-
title: Text(labels[index],
54-
style:
55-
TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
56-
onTap: () {
57-
Navigator.pop(context);
58-
},
59-
dense: true,
60-
)
61-
]);
24+
margin: EdgeInsets.only(top: 20.0),
25+
child: ClipRRect(
26+
borderRadius: BorderRadius.circular(50),
27+
child: Image.network(
28+
'https://i.imgur.com/rG1TxNQ.png',
29+
height: 80,
30+
width: 80,
31+
),
32+
),
33+
),
34+
],
35+
),
36+
decoration: BoxDecoration(
37+
color: Colors.blue,
38+
),
39+
),
40+
),
41+
ListTile(
42+
leading: Icon(Icons.arrow_forward_ios),
43+
title: Text('Home Screen',
44+
style: TextStyle(
45+
fontFamily: 'Raleway',
46+
fontSize: 16,
47+
color: Colors.grey[600],
48+
)),
49+
onTap: () {
50+
Navigator.push(context, MaterialPageRoute(builder: (context) {
51+
return MyApp();
52+
}));
53+
},
54+
),
55+
ListTile(
56+
leading: Icon(Icons.arrow_forward_ios),
57+
title: Text('Add Records',
58+
style: TextStyle(
59+
fontFamily: 'Raleway',
60+
fontSize: 16,
61+
color: Colors.grey[600],
62+
)),
63+
onTap: () {
64+
Navigator.push(context, MaterialPageRoute(builder: (context) {
65+
return AddRecord();
66+
}));
67+
}),
68+
ListTile(
69+
leading: Icon(Icons.arrow_forward_ios),
70+
title: Text('List Records',
71+
style: TextStyle(
72+
fontFamily: 'Raleway',
73+
fontSize: 16,
74+
color: Colors.grey[600],
75+
)),
76+
onTap: () {
77+
Navigator.push(context, MaterialPageRoute(builder: (context) {
78+
return ListRecord();
6279
}));
80+
},
81+
),
82+
],
83+
));
6384
}
6485
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /