From 524427a29f93bfae79f856c892677e68f14a8aa4 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 10 Jan 2025 21:06:41 +0100 Subject: [PATCH] add drawer to every page --- covas_mobile/lib/pages/Camera.dart | 3 +++ covas_mobile/lib/pages/CameraEdit.dart | 3 +++ covas_mobile/lib/pages/DisplayPictureScreen.dart | 3 +++ covas_mobile/lib/pages/EditEvent.dart | 3 +++ covas_mobile/lib/pages/ItemMenu.dart | 2 ++ covas_mobile/lib/pages/ListItemByOrganizers.dart | 2 ++ covas_mobile/lib/pages/ListItemByTags.dart | 3 +++ covas_mobile/lib/pages/MapboxPages.dart | 2 ++ covas_mobile/lib/pages/UpdateEventImage.dart | 3 ++- 9 files changed, 23 insertions(+), 1 deletion(-) diff --git a/covas_mobile/lib/pages/Camera.dart b/covas_mobile/lib/pages/Camera.dart index 1187d8f..17fd22f 100644 --- a/covas_mobile/lib/pages/Camera.dart +++ b/covas_mobile/lib/pages/Camera.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io'; import 'package:image_picker/image_picker.dart'; +import '../classes/MyDrawer.dart'; import 'DisplayPictureScreen.dart'; import 'package:camera/camera.dart'; @@ -93,6 +94,8 @@ class CameraState extends State { // You must wait until the controller is initialized before displaying the // camera preview. Use a FutureBuilder to display a loading spinner until the // controller has finished initializing. + drawer: MyDrawer(), + body: FutureBuilder( future: _initializeControllerFuture, builder: (context, snapshot) { diff --git a/covas_mobile/lib/pages/CameraEdit.dart b/covas_mobile/lib/pages/CameraEdit.dart index b104f3f..ad91db5 100644 --- a/covas_mobile/lib/pages/CameraEdit.dart +++ b/covas_mobile/lib/pages/CameraEdit.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io'; import '../classes/events.dart'; +import '../classes/MyDrawer.dart'; import 'package:image_picker/image_picker.dart'; import 'EditEvent.dart'; import 'package:camera/camera.dart'; @@ -93,6 +94,8 @@ class CameraEditState extends State { // You must wait until the controller is initialized before displaying the // camera preview. Use a FutureBuilder to display a loading spinner until the // controller has finished initializing. + drawer: MyDrawer(), + body: FutureBuilder( future: _initializeControllerFuture, builder: (context, snapshot) { diff --git a/covas_mobile/lib/pages/DisplayPictureScreen.dart b/covas_mobile/lib/pages/DisplayPictureScreen.dart index 19631a1..41c86fd 100644 --- a/covas_mobile/lib/pages/DisplayPictureScreen.dart +++ b/covas_mobile/lib/pages/DisplayPictureScreen.dart @@ -12,6 +12,7 @@ import 'UpdateEventImage.dart'; import 'dart:convert'; import '../variable/globals.dart' as globals; +import '../classes/MyDrawer.dart'; void main() { runApp(MyApp()); @@ -158,6 +159,8 @@ class DisplayPictureScreenState extends State appBar: AppBar(title: const Text('Display the Picture')), // The image is stored as a file on the device. Use the `Image.file` // constructor with the given path to display the image. + drawer: MyDrawer(), + body: Padding( padding: const EdgeInsets.all(20.0), child: Column( diff --git a/covas_mobile/lib/pages/EditEvent.dart b/covas_mobile/lib/pages/EditEvent.dart index e1b9275..8beb2e5 100644 --- a/covas_mobile/lib/pages/EditEvent.dart +++ b/covas_mobile/lib/pages/EditEvent.dart @@ -11,6 +11,7 @@ import 'dart:io'; import 'dart:typed_data'; import '../classes/events.dart'; +import '../classes/MyDrawer.dart'; import 'ItemMenu.dart'; import 'CameraEdit.dart'; @@ -465,6 +466,8 @@ class _EditEventState extends State Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, + drawer: MyDrawer(), + appBar: AppBar( title: Text("Add or Update a event"), backgroundColor: Colors.blue, diff --git a/covas_mobile/lib/pages/ItemMenu.dart b/covas_mobile/lib/pages/ItemMenu.dart index b1d4995..145353f 100644 --- a/covas_mobile/lib/pages/ItemMenu.dart +++ b/covas_mobile/lib/pages/ItemMenu.dart @@ -14,6 +14,7 @@ import 'package:intl/date_symbol_data_local.dart'; import '../variable/globals.dart' as globals; import '../classes/events.dart'; +IMPORT '../classes/MyDrawer.dart'; import 'ListItemMenu.dart'; import 'MapboxPages.dart'; @@ -215,6 +216,7 @@ class _ItemMenuState extends State with ShowAlertDialog { context, MaterialPageRoute(builder: (_) => ListItemMenu())); }, )), + drawer: MyDrawer(), body: SingleChildScrollView( child: Column( children: [ diff --git a/covas_mobile/lib/pages/ListItemByOrganizers.dart b/covas_mobile/lib/pages/ListItemByOrganizers.dart index 1500a1b..2d8b62d 100644 --- a/covas_mobile/lib/pages/ListItemByOrganizers.dart +++ b/covas_mobile/lib/pages/ListItemByOrganizers.dart @@ -10,6 +10,7 @@ import 'package:intl/intl.dart'; import 'package:intl/date_symbol_data_local.dart'; import '../variable/globals.dart' as globals; +import '../classes/MyDrawer.dart'; // app starting point void main() { @@ -63,6 +64,7 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( + drawer: MyDrawer(), body: Center( // FutureBuilder child: FutureBuilder>( diff --git a/covas_mobile/lib/pages/ListItemByTags.dart b/covas_mobile/lib/pages/ListItemByTags.dart index 59ddcbc..353dea8 100644 --- a/covas_mobile/lib/pages/ListItemByTags.dart +++ b/covas_mobile/lib/pages/ListItemByTags.dart @@ -11,6 +11,8 @@ import 'package:intl/date_symbol_data_local.dart'; import '../variable/globals.dart' as globals; +import '../classes/MyDrawer.dart'; + // app starting point void main() { initializeDateFormatting("fr_FR", null).then((_) => (const MyApp())); @@ -62,6 +64,7 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( + drawer: MyDrawer(), body: Center( // FutureBuilder child: FutureBuilder>( diff --git a/covas_mobile/lib/pages/MapboxPages.dart b/covas_mobile/lib/pages/MapboxPages.dart index 8f26b90..686ddfa 100644 --- a/covas_mobile/lib/pages/MapboxPages.dart +++ b/covas_mobile/lib/pages/MapboxPages.dart @@ -10,6 +10,7 @@ import 'package:geolocator/geolocator.dart'; // For getting the user's location import '../classes/alert.dart'; // Assuming this contains your error dialog code. import '../variable/globals.dart' as globals; +import '../classes/MyDrawer.dart'; void main() async { await dotenv.load(fileName: ".env"); // Load .env file @@ -375,6 +376,7 @@ class _MapboxPagesState extends State with ShowAlertDialog { ) ], ), + drawer: MyDrawer(), body: Stack( children: [ isLoading diff --git a/covas_mobile/lib/pages/UpdateEventImage.dart b/covas_mobile/lib/pages/UpdateEventImage.dart index 46270dc..f95ddb4 100644 --- a/covas_mobile/lib/pages/UpdateEventImage.dart +++ b/covas_mobile/lib/pages/UpdateEventImage.dart @@ -5,7 +5,7 @@ import 'package:uuid/uuid.dart'; import 'package:intl/intl.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:textfield_tags/textfield_tags.dart'; - +import '../classes/MyDrawer.dart'; import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; @@ -420,6 +420,7 @@ class _UpdateeventImageState extends State backgroundColor: Colors.blue, foregroundColor: Colors.white, ), + drawer: MyDrawer(), body: Form( key: _formKey, child: SingleChildScrollView(