|  | 
| 1 | 1 | import 'package:flutter/material.dart'; | 
|  | 2 | +import 'package:assignment6/main.dart'; | 
|  | 3 | +import 'package:assignment6/AddRecord.dart'; | 
|  | 4 | +import 'package:assignment6/ListRecord.dart'; | 
| 2 | 5 | 
 | 
| 3 | 6 | class DrawerList extends StatefulWidget { | 
| 4 | 7 |  @override | 
| 5 | 8 |  NewDrawerList createState() => NewDrawerList(); | 
| 6 | 9 | } | 
| 7 | 10 | 
 | 
| 8 | 11 | 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 |  | - | 
| 37 | 12 |  @override | 
| 38 | 13 |  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>[ | 
| 45 | 23 |  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(); | 
| 62 | 79 |  })); | 
|  | 80 | + }, | 
|  | 81 | + ), | 
|  | 82 | + ], | 
|  | 83 | + )); | 
| 63 | 84 |  } | 
| 64 | 85 | } | 
0 commit comments