uninav/lib/components/drawer.dart

49 lines
1.3 KiB
Dart
Raw Permalink Normal View History

2024-04-19 18:07:54 +00:00
import 'package:flutter/material.dart';
2024-04-20 14:32:01 +00:00
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/get_navigation.dart';
import 'package:uninav/map.dart';
2024-04-19 18:07:54 +00:00
class MyDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text(
'Menu',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
),
ListTile(
2024-04-20 14:32:01 +00:00
leading: Icon(Icons.map),
title: Text('Map Page'),
2024-04-19 18:07:54 +00:00
onTap: () {
2024-04-20 14:32:01 +00:00
Get.back(); // close drawer
Get.toNamed('/map');
2024-04-19 18:07:54 +00:00
// Handle menu item tap
},
),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
onTap: () {
2024-04-20 14:32:01 +00:00
Get.back(); // close drawer
Get.toNamed('/settings');
2024-04-19 18:07:54 +00:00
// Handle menu item tap
},
),
// Add more menu items as needed
],
),
);
}
}