From 938b677b6ecc1ea5b189672bfd4074a3a6d59d59 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 30 Dec 2024 22:14:46 +0100 Subject: [PATCH] test hamburger bar --- covas_mobile/lib/classes/MyDrawer.dart | 49 ++++++++++++++++++++++++ covas_mobile/lib/pages/ListItemMenu.dart | 2 + 2 files changed, 51 insertions(+) create mode 100644 covas_mobile/lib/classes/MyDrawer.dart diff --git a/covas_mobile/lib/classes/MyDrawer.dart b/covas_mobile/lib/classes/MyDrawer.dart new file mode 100644 index 0000000..4161c00 --- /dev/null +++ b/covas_mobile/lib/classes/MyDrawer.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; + +class MyDrawer extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + // Drawer Header + DrawerHeader( + decoration: BoxDecoration( + color: Colors.blue, + ), + child: Text( + 'Menu', + style: TextStyle( + color: Colors.white, + fontSize: 24, + ), + ), + ), + // Drawer Items + ListTile( + leading: Icon(Icons.home), + title: Text('Home'), + onTap: () { + Navigator.pop(context); // Close the drawer + }, + ), + ListTile( + leading: Icon(Icons.settings), + title: Text('Settings'), + onTap: () { + Navigator.pop(context); // Close the drawer + }, + ), + ListTile( + leading: Icon(Icons.info), + title: Text('About'), + onTap: () { + Navigator.pop(context); // Close the drawer + }, + ), + ], + ), + ); + } +} diff --git a/covas_mobile/lib/pages/ListItemMenu.dart b/covas_mobile/lib/pages/ListItemMenu.dart index da85d5c..945dae8 100644 --- a/covas_mobile/lib/pages/ListItemMenu.dart +++ b/covas_mobile/lib/pages/ListItemMenu.dart @@ -5,6 +5,7 @@ import 'dart:convert'; import 'dart:io'; import 'ItemMenu.dart'; import '../classes/events.dart'; +import '../classes/MyDrawer.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:intl/intl.dart'; import 'package:intl/date_symbol_data_local.dart'; @@ -742,6 +743,7 @@ class _MyHomePageState extends State { backgroundColor: Colors.blue, foregroundColor: Colors.white, ), + drawer: MyDrawer(), body: Column( children: [ if (showInputSearch) _buildItemZoneSearchField(),