From 94e78e91da2415919041c50ce70803bfbc52f931 Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Fri, 14 Jun 2024 14:15:11 +0200 Subject: [PATCH] Minor adjustments --- lib/components/my_drawer.dart | 7 ++----- lib/constants.dart | 2 +- lib/forms/profile_category_form.dart | 16 +++++----------- lib/pages/chat_page.dart | 4 ++-- lib/pages/conversations_page.dart | 1 - lib/pages/home_page.dart | 4 ++-- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/components/my_drawer.dart b/lib/components/my_drawer.dart index 6587f21..a2851e0 100644 --- a/lib/components/my_drawer.dart +++ b/lib/components/my_drawer.dart @@ -55,9 +55,8 @@ class MyDrawer extends StatelessWidget { title: const Text('Find Matches'), leading: const Icon(Icons.person_search), onTap: () { - // pop the drawer + // pop the drawer first, then navigate to destination Navigator.pop(context); - // Navigate to UserProfile Navigator.push( context, MaterialPageRoute( @@ -73,12 +72,10 @@ class MyDrawer extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 25), child: ListTile( - title: const Text('Swiped Users List'), + title: const Text('Swiped Profiles'), leading: const Icon(Icons.format_list_bulleted), onTap: () { - // pop the drawer Navigator.pop(context); - // Navigate to HomePage? Navigator.push( context, MaterialPageRoute( diff --git a/lib/constants.dart b/lib/constants.dart index 67668cf..6de1556 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -4,7 +4,7 @@ class Constants { /// Title of the app static const String appTitle = 'Cofounderella'; static const String appVersion = '1.0.0'; - static const String appCompilationDate = '2024-05-26'; + static const String appCompilationDate = '2024-06-13'; static const String dbCollectionFeedbacks = 'feedbacks'; static const String dbCollectionUsers = 'Users'; diff --git a/lib/forms/profile_category_form.dart b/lib/forms/profile_category_form.dart index f7f240a..7657c87 100644 --- a/lib/forms/profile_category_form.dart +++ b/lib/forms/profile_category_form.dart @@ -91,17 +91,11 @@ class ProfileCategoryFormState extends State> { if (!widget.hideSaveButton) ElevatedButton( onPressed: () { - //if (!equalContent(_selectedOptions, widget.preSelectedOptions)) { - // Only save if options have changed - if (_selectedOptions.length >= widget.minSelections) { - widget.onSave(_selectedOptions); - // TODO Navigation abhängig von caller - // Navigator.pop(context); // Navigate back after saving - } else { - // Provide feedback that minimum selections not met - _showSnackBar('No selection made for ${widget.title}'); - } - // } else { print('No changes to save for ${widget.title}.'); } + if (_selectedOptions.length >= widget.minSelections) { + widget.onSave(_selectedOptions); + } else { + _showSnackBar('No selection made for ${widget.title}'); + } }, child: Text(widget.saveButtonText ?? 'Save'), ), diff --git a/lib/pages/chat_page.dart b/lib/pages/chat_page.dart index 4ea2d20..10ddc30 100644 --- a/lib/pages/chat_page.dart +++ b/lib/pages/chat_page.dart @@ -155,8 +155,8 @@ class _ChatPageState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 25.0), child: Text( - "${msgDate[0]} ${msgDate[1].substring(0, 8)}", - style: TextStyle(color: Colors.grey.shade600), + "${msgDate[0]} ${msgDate[1].substring(0, 5)}", + style: const TextStyle(color: Colors.grey), ), ), ChatBubble( diff --git a/lib/pages/conversations_page.dart b/lib/pages/conversations_page.dart index 36fe2ed..de84733 100644 --- a/lib/pages/conversations_page.dart +++ b/lib/pages/conversations_page.dart @@ -16,7 +16,6 @@ class ConversationsPage extends StatelessWidget { return Scaffold( appBar: AppBar( title: const Text('My Chat Contacts'), - backgroundColor: Colors.transparent, ), body: _buildUserMatchesList(), ); diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 6c50cd9..2f00c03 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -24,8 +24,8 @@ class HomePage extends StatelessWidget { double size = constraints.biggest.shortestSide / 2 - 16; return GridView.count( crossAxisCount: 2, - crossAxisSpacing: 16.0, - mainAxisSpacing: 16.0, + crossAxisSpacing: 6.0, + mainAxisSpacing: 6.0, padding: const EdgeInsets.all(16.0), shrinkWrap: true, physics: const NeverScrollableScrollPhysics(),