From 13a1651af78cedd75fb4ecb9305ba1dfa32c2be0 Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Thu, 16 May 2024 13:28:57 +0200 Subject: [PATCH] Fix: Rendering Overflow FeedbackDialog --- lib/components/my_drawer.dart | 262 +++++++++++++++++----------------- 1 file changed, 133 insertions(+), 129 deletions(-) diff --git a/lib/components/my_drawer.dart b/lib/components/my_drawer.dart index 30fe25a..c90c629 100644 --- a/lib/components/my_drawer.dart +++ b/lib/components/my_drawer.dart @@ -1,8 +1,7 @@ -import 'package:cofounderella/pages/user_data_page.dart'; -import 'package:cofounderella/services/auth/auth_service.dart'; -import 'package:cofounderella/pages/settings_page.dart'; import 'package:flutter/material.dart'; - +import '../pages/user_data_page.dart'; +import '../pages/settings_page.dart'; +import '../services/auth/auth_service.dart'; import 'feedback_dialog.dart'; class MyDrawer extends StatelessWidget { @@ -18,141 +17,146 @@ class MyDrawer extends StatelessWidget { Widget build(BuildContext context) { return Drawer( backgroundColor: Theme.of(context).colorScheme.background, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // logo - Column( + child: CustomScrollView(slivers: [ + SliverFillRemaining( + hasScrollBody: false, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrawerHeader( - child: Center( - child: Icon( - Icons.people_alt, - color: Theme.of(context).colorScheme.primary, - size: 40, + Column( + children: [ + // logo + DrawerHeader( + child: Center( + child: Icon( + Icons.people_alt, + color: Theme.of(context).colorScheme.primary, + size: 40, + ), + ), ), - ), + + // home list tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("Home"), + leading: const Icon(Icons.home), + onTap: () { + // pop the drawer + Navigator.pop(context); + // TODO navigate to Homepage? + }, + ), + ), + + // matching list tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("Find Matches"), + leading: const Icon(Icons.person_search), + onTap: () {}, // TODO + ), + ), + + // chats list tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("Conversations"), + leading: const Icon(Icons.chat), + onTap: () {}, // TODO + ), + ), + + // settings list tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("My Profile"), + leading: const Icon(Icons.settings), + onTap: () { + // pop the drawer + Navigator.pop(context); + + //navigate to settings page + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SettingsPage(), + )); + }, + ), + ), + + // TODO TESTING - user data tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("User Data"), + leading: const Icon(Icons.supervised_user_circle), + onTap: () { + // pop the drawer + Navigator.pop(context); + + //navigate to settings page + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const UserDataPage(), + )); + }, + ), + ), + + // horizontal line + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Divider( + color: Theme.of(context).colorScheme.primary, + ), + ), + + // about tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("About the app"), + leading: const Icon(Icons.perm_device_info), + onTap: () {}, // TODO + ), + ), + + // feedback tile + Padding( + padding: const EdgeInsets.only(left: 25), + child: ListTile( + title: const Text("Send feedback"), + leading: const Icon(Icons.sentiment_satisfied_alt), + onTap: () { + showDialog( + context: context, + builder: (context) => const FeedbackDialog()); + }, + ), + ), + ], ), - // home list tile + // logout list tile Padding( - padding: const EdgeInsets.only(left: 25), + padding: const EdgeInsets.only(left: 25, bottom: 25), child: ListTile( - title: const Text("Home"), - leading: const Icon(Icons.home), - onTap: () { - // pop the drawer - Navigator.pop(context); - // TODO navigate to Homepage? - }, - ), - ), - - // matching list tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("Find Matches"), - leading: const Icon(Icons.person_search), - onTap: () {}, // TODO - ), - ), - - // chats list tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("Conversations"), - leading: const Icon(Icons.chat), - onTap: () {}, // TODO - ), - ), - - // settings list tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("My Profile"), - leading: const Icon(Icons.settings), - onTap: () { - // pop the drawer - Navigator.pop(context); - - //navigate to settings page - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const SettingsPage(), - )); - }, - ), - ), - - // TODO TESTING - user data tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("User Data"), - leading: const Icon(Icons.supervised_user_circle), - onTap: () { - // pop the drawer - Navigator.pop(context); - - //navigate to settings page - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const UserDataPage(), - )); - }, - ), - ), - - // horizontal line - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Divider( - color: Theme.of(context).colorScheme.primary, - ), - ), - - // about tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("About the app"), - leading: const Icon(Icons.perm_device_info), - onTap: () {}, // TODO - ), - ), - - // feedback tile - Padding( - padding: const EdgeInsets.only(left: 25), - child: ListTile( - title: const Text("Send feedback"), - leading: const Icon(Icons.sentiment_satisfied_alt), - onTap: () { - showDialog( - context: context, - builder: (context) => const FeedbackDialog()); - }, + title: const Text("L O G O U T"), + leading: const Icon(Icons.logout), + onTap: logout, ), ), ], ), - - // logout list tile - Padding( - padding: const EdgeInsets.only(left: 25, bottom: 25), - child: ListTile( - title: const Text("L O G O U T"), - leading: const Icon(Icons.logout), - onTap: logout, - ), - ), - ], - ), + ), + ]), ); } }