drawer.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import 'package:flutter/material.dart';
  2. class AppDrawer extends StatelessWidget {
  3. Widget build(BuildContext context) {
  4. return Drawer(
  5. child: Column(children: [
  6. Container(
  7. alignment: Alignment.centerLeft,
  8. height: 40,
  9. color: Colors.blue,
  10. margin: EdgeInsets.only(left: 10),
  11. child: Text(
  12. 'Navigation',
  13. style: TextStyle(fontSize: 25, color: Colors.white),
  14. ),
  15. ),
  16. ListTile(
  17. leading: Icon(Icons.ad_units, color: Colors.purple[200]),
  18. title: Text('Home'),
  19. onTap: () {
  20. Navigator.pushNamed(context, '/'); // named route
  21. },
  22. ), // more ListTiles here
  23. ListTile(
  24. leading: Icon(Icons.account_box, color: Colors.pink[200]),
  25. title: Text('By Actor'),
  26. onTap: () {
  27. Navigator.pushNamed(context, '/second'); // named route
  28. },
  29. ),
  30. ListTile(
  31. leading: Icon(Icons.access_alarm, color: Colors.blue[200]),
  32. title: Text('By Year'),
  33. onTap: () {
  34. Navigator.pushNamed(context, '/third');
  35. },
  36. ),
  37. ListTile(
  38. leading: Icon(Icons.favorite, color: Colors.blue[400]),
  39. title: Text('Top Rate'),
  40. onTap: () {
  41. Navigator.pushNamed(context, '/fourth');
  42. },
  43. ),
  44. ])); //Drawer }//build
  45. } // AppDrawer class
  46. }