62 lines
1.5 KiB
Dart
62 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'listViewPage.dart';
|
|
|
|
class DrawerPage extends StatefulWidget {
|
|
const DrawerPage({super.key});
|
|
|
|
@override
|
|
State<DrawerPage> createState() => _DrawerPageState();
|
|
}
|
|
|
|
class _DrawerPageState extends State<DrawerPage>{
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Drawer(
|
|
child: ListView(
|
|
padding: EdgeInsets.zero,
|
|
children: [
|
|
DrawerHeader(
|
|
decoration: BoxDecoration(
|
|
color: Colors.blue,
|
|
),
|
|
child: Text(
|
|
'App Menu',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 24,
|
|
),
|
|
),
|
|
),
|
|
ListTile(
|
|
leading: Icon(Icons.home),
|
|
title: Text('Home'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: Icon(Icons.list),
|
|
title: Text('List View'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (context) => ListViewPage()),
|
|
);
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: Icon(Icons.settings),
|
|
title: Text('Settings'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
// Navigate to settings page
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
} |