From 0524fe045d8d372aeccf69fed0ec73b85b273f23 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 19:18:19 +0300 Subject: [PATCH 01/16] refactor: Update theme.dart to use "Comfortaa" font family --- lib/theme.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/theme.dart b/lib/theme.dart index c222504..948d7fe 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -2,6 +2,7 @@ import "package:flutter/material.dart"; whiteTheme() { return ThemeData( + fontFamily: "Comfortaa", colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFFFEC409)), scaffoldBackgroundColor: const Color.fromARGB(255, 255, 255, 255), inputDecorationTheme: InputDecorationTheme( @@ -14,8 +15,7 @@ whiteTheme() { focusedBorder: OutlineInputBorder( borderSide: const BorderSide(width: 1.5, color: Color(0xFFE8E8E8)), borderRadius: BorderRadius.circular(15)), - labelStyle: - const TextStyle(color: Color(0xEA000000), fontFamily: "Comfortaa"), + labelStyle: const TextStyle(color: Color(0xEA000000)), ), textSelectionTheme: const TextSelectionThemeData( cursorColor: Color(0xFFFEC409), @@ -23,7 +23,7 @@ whiteTheme() { textButtonTheme: TextButtonThemeData( style: ButtonStyle( textStyle: WidgetStateProperty.all( - const TextStyle(color: Color(0xFFFEC409), fontFamily: "Comfortaa"), + const TextStyle(color: Color(0xFFFEC409)), ), ), ), @@ -32,6 +32,7 @@ whiteTheme() { darkTheme() { return ThemeData( + fontFamily: "Comfortaa", colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFFFEC409)), scaffoldBackgroundColor: const Color.fromARGB(255, 255, 255, 255), inputDecorationTheme: InputDecorationTheme( @@ -44,8 +45,7 @@ darkTheme() { focusedBorder: OutlineInputBorder( borderSide: const BorderSide(width: 1.5, color: Color(0xFF6B6B6B)), borderRadius: BorderRadius.circular(15)), - labelStyle: - const TextStyle(color: Color(0xEAFFFFFF), fontFamily: "Comfortaa"), + labelStyle: const TextStyle(color: Color(0xEAFFFFFF)), ), textSelectionTheme: const TextSelectionThemeData( cursorColor: Color(0xFFFEC409), @@ -58,10 +58,7 @@ darkTheme() { textButtonTheme: TextButtonThemeData( style: ButtonStyle( textStyle: WidgetStateProperty.all( - const TextStyle( - color: Color.fromARGB(255, 255, 213, 73), - fontFamily: "Comfortaa", - ), + const TextStyle(color: Color.fromARGB(255, 255, 213, 73)), ), ), ), From 3816ca948d80176eeb2900cb1de88036dee1c4d0 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 19:48:30 +0300 Subject: [PATCH 02/16] refactor: Update color scheme in theme.dart --- lib/theme.dart | 89 +++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/lib/theme.dart b/lib/theme.dart index 948d7fe..9606a3f 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -1,66 +1,51 @@ -import "package:flutter/material.dart"; +import 'package:flutter/material.dart'; -whiteTheme() { +ThemeData whiteTheme() { return ThemeData( fontFamily: "Comfortaa", - colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFFFEC409)), - scaffoldBackgroundColor: const Color.fromARGB(255, 255, 255, 255), - inputDecorationTheme: InputDecorationTheme( - suffixStyle: const TextStyle(color: Colors.white), - fillColor: const Color(0xFFE8E8E8), - filled: true, - enabledBorder: OutlineInputBorder( - borderSide: const BorderSide(width: 1.5, color: Color(0xFFE8E8E8)), - borderRadius: BorderRadius.circular(15)), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide(width: 1.5, color: Color(0xFFE8E8E8)), - borderRadius: BorderRadius.circular(15)), - labelStyle: const TextStyle(color: Color(0xEA000000)), + colorScheme: ColorScheme.fromSeed( + seedColor: const Color(0xFFFEC409), + primary: const Color(0xFFFFC409), + primaryContainer: const Color(0xFFFFCA22), + secondary: const Color(0xFFFF571A), + secondaryContainer: const Color(0xFFFFF8F5), + tertiary: const Color(0xFF5260FF), + error: const Color(0xFFEB445A), + surface: const Color(0xFFFFFFFF), + onPrimary: Colors.black, + onSecondary: Colors.black, + onTertiary: Colors.white, + onSurface: Colors.black, + onError: Colors.white, ), - textSelectionTheme: const TextSelectionThemeData( - cursorColor: Color(0xFFFEC409), - ), - textButtonTheme: TextButtonThemeData( - style: ButtonStyle( - textStyle: WidgetStateProperty.all( - const TextStyle(color: Color(0xFFFEC409)), - ), - ), + scaffoldBackgroundColor: const Color(0xFFFFFFFF), + inputDecorationTheme: const InputDecorationTheme( + labelStyle: TextStyle(color: Color(0xFF000000)), ), ); } -darkTheme() { +ThemeData darkTheme() { return ThemeData( fontFamily: "Comfortaa", - colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFFFEC409)), - scaffoldBackgroundColor: const Color.fromARGB(255, 255, 255, 255), - inputDecorationTheme: InputDecorationTheme( - suffixStyle: const TextStyle(color: Colors.white), - fillColor: const Color(0xFF6B6B6B), - filled: true, - enabledBorder: OutlineInputBorder( - borderSide: const BorderSide(width: 1.5, color: Color(0xFF6B6B6B)), - borderRadius: BorderRadius.circular(15)), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide(width: 1.5, color: Color(0xFF6B6B6B)), - borderRadius: BorderRadius.circular(15)), - labelStyle: const TextStyle(color: Color(0xEAFFFFFF)), - ), - textSelectionTheme: const TextSelectionThemeData( - cursorColor: Color(0xFFFEC409), - ), - textTheme: const TextTheme( - bodyLarge: TextStyle(color: Colors.white), - bodyMedium: TextStyle(color: Colors.white), - bodySmall: TextStyle(color: Colors.white), + colorScheme: ColorScheme.fromSeed( + seedColor: const Color(0xFFFEC409), + primary: const Color(0xFFFFC409), + primaryContainer: const Color(0xFFFFD948), + secondary: const Color(0xFFFF571A), + secondaryContainer: const Color(0xFF1C1C1D), + tertiary: const Color(0xFF6A64FF), + error: const Color(0xFFFF4961), + surface: const Color(0xFF121212), + onPrimary: Colors.black, + onSecondary: Colors.black, + onTertiary: Colors.white, + onSurface: Colors.white, + onError: Colors.white, ), - textButtonTheme: TextButtonThemeData( - style: ButtonStyle( - textStyle: WidgetStateProperty.all( - const TextStyle(color: Color.fromARGB(255, 255, 213, 73)), - ), - ), + scaffoldBackgroundColor: const Color(0xFF121212), + inputDecorationTheme: const InputDecorationTheme( + labelStyle: TextStyle(color: Color(0xFFFFFFFF)), ), ); } From 8e54d8ed61cb8c74a6e2283737e375b5d74e8fd8 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:12:13 +0300 Subject: [PATCH 03/16] refactor: Update AppBar theme in theme.dart --- lib/theme.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/theme.dart b/lib/theme.dart index 9606a3f..abc8369 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -22,6 +22,10 @@ ThemeData whiteTheme() { inputDecorationTheme: const InputDecorationTheme( labelStyle: TextStyle(color: Color(0xFF000000)), ), + appBarTheme: const AppBarTheme( + backgroundColor: Color(0xFFFEC409), // Added backgroundColor for AppBar + foregroundColor: Colors.black, // Added foregroundColor for AppBar + ), ); } @@ -47,5 +51,9 @@ ThemeData darkTheme() { inputDecorationTheme: const InputDecorationTheme( labelStyle: TextStyle(color: Color(0xFFFFFFFF)), ), + appBarTheme: const AppBarTheme( + backgroundColor: Color(0xFFFEC409), // Added backgroundColor for AppBar + foregroundColor: Colors.black, // Added foregroundColor for AppBar + ), ); } From 277b1e56dc94fd6203dacfe87dcbe65107e0cd07 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:12:50 +0300 Subject: [PATCH 04/16] refactor: Update .gitignore to exclude .vscode directory --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b5f8a06..ee9423a 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,7 @@ app.*.map.json /android/app/release # Environment -.env \ No newline at end of file +.env + +# Vscode +.vscode/ \ No newline at end of file From da1839bbd39ff0663c042663ad760014671ef390 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:36:29 +0300 Subject: [PATCH 05/16] refactor: Update theme and UI elements in filters and community pages --- lib/pages/home/community.dart | 260 ++++++++++++++++------------------ 1 file changed, 122 insertions(+), 138 deletions(-) diff --git a/lib/pages/home/community.dart b/lib/pages/home/community.dart index 001515b..2d73c7c 100644 --- a/lib/pages/home/community.dart +++ b/lib/pages/home/community.dart @@ -15,30 +15,30 @@ class Community extends ConsumerStatefulWidget { ConsumerState createState() => _CommunityState(); } -class _CommunityState extends ConsumerState { +class _CommunityState extends ConsumerState + with SingleTickerProviderStateMixin { + late TabController _tabController; + @override void initState() { super.initState(); ref.read(userProvider.notifier).fetchUsers(); + _tabController = TabController(length: 5, vsync: this); } - Widget buildCategoryButton(IconData icon, String label, Color iconColor) { - return GestureDetector( - onTap: () {}, - child: Container( - color: const Color.fromARGB(255, 255, 251, 239), - padding: const EdgeInsets.all(6.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(icon, color: iconColor), - const SizedBox(height: 4), - Text( - label, - style: TextStyle(color: iconColor, fontSize: 9), - ), - ], - ), + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + Widget buildCategoryTab(IconData icon, Color iconColor) { + return Tab( + icon: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, color: iconColor), + ], ), ); } @@ -65,138 +65,122 @@ class _CommunityState extends ConsumerState { final users = ref.watch(userProvider); return Scaffold( - backgroundColor: const Color.fromARGB(31, 163, 163, 163), - body: CustomScrollView( - slivers: [ - SliverAppBar( - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + appBar: AppBar( + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text("Community"), + Row( children: [ - const Text("Community"), - Row( - children: [ - IconButton( - icon: const Icon(Icons.search, size: 30), - onPressed: () {}, - ), - const SizedBox(width: 10.0), - IconButton( - icon: const Icon(Icons.filter_list, size: 30), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const FiltersPage()), - ); - }, - ), - ], + IconButton( + icon: const Icon(Icons.search, size: 30), + onPressed: () {}, ), - ], - ), - centerTitle: false, - pinned: true, - backgroundColor: const Color(0xFFFBC02D), - foregroundColor: Colors.black, - ), - SliverToBoxAdapter( - child: Wrap( - alignment: WrapAlignment.center, - runSpacing: 8.0, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: buildCategoryButton( - Icons.home, "FOR YOU", Colors.orange), - ), - Expanded( - child: buildCategoryButton( - Icons.check_box, "ENTHUSIASTS", Colors.green), - ), - Expanded( - child: buildCategoryButton( - Icons.person_add, "NEW USERS", Colors.red), - ), - Expanded( - child: buildCategoryButton( - Icons.people, "ACTIVE", Colors.green), - ), - Expanded( - child: buildCategoryButton( - Icons.visibility, "VISITORS", Colors.black), - ), - ], + IconButton( + icon: const Icon(Icons.filter_list, size: 30), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const FiltersPage()), + ); + }, ), ], ), - ), - const SliverToBoxAdapter( - child: SizedBox(height: 16), - ), - const SliverToBoxAdapter( - child: Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: EdgeInsets.all(16.0), - child: Text( - "Language Mates", - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - color: Color(0xFF262626), - ), - ), + ], + ), + centerTitle: false, + bottom: TabBar( + controller: _tabController, + tabs: [ + buildCategoryTab(Icons.home_outlined, Colors.black), + buildCategoryTab(Icons.check_box_outlined, Colors.green), + buildCategoryTab(Icons.back_hand_outlined, + Theme.of(context).colorScheme.secondary), + buildCategoryTab( + Icons.battery_charging_full_outlined, Colors.green), + buildCategoryTab(Icons.visibility_outlined, + Theme.of(context).colorScheme.onSurface), + ], + ), + ), + body: TabBarView( + controller: _tabController, + children: [ + CustomScrollView( + slivers: [ + const SliverToBoxAdapter( + child: SizedBox(height: 16), ), - ), - ), - const SliverToBoxAdapter( - child: Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: EdgeInsets.all(16.0), - child: Text( - "🎯 Recommended For You", - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: Color(0xFF737373), + const SliverToBoxAdapter( + child: Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.all(16.0), + child: Text( + "Language Mates", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Color(0xFF262626), + ), + ), ), ), ), - ), - ), - users.isEmpty - ? const SliverToBoxAdapter( - child: Center(child: CircularProgressIndicator()), - ) - : SliverPadding( - padding: const EdgeInsets.all(8.0), - sliver: SliverGrid( - delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { - final user = users[index].data; - return UserCard( - name: user['name'].toString(), - age: user['age'] ?? 0, - studies: user['studyLanguages'].toString(), - speaks: user['motherLanguages'].toString(), - imageUrl: - user['imageUrl'] ?? 'assets/images/preview.png', - status: user['status'] ?? 'Active', - ); - }, - childCount: users.length, - ), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: crossAxisCount, - mainAxisSpacing: 10.0, - crossAxisSpacing: 10.0, - childAspectRatio: 0.75, + const SliverToBoxAdapter( + child: Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.all(16.0), + child: Text( + "🎯 Recommended For You", + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + color: Color(0xFF737373), + ), ), ), ), + ), + users.isEmpty + ? const SliverToBoxAdapter( + child: Center(child: CircularProgressIndicator()), + ) + : SliverPadding( + padding: const EdgeInsets.all(8.0), + sliver: SliverGrid( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) { + final user = users[index].data; + return UserCard( + name: user['name'].toString(), + age: user['age'] ?? 0, + studies: user['studyLanguages'].toString(), + speaks: user['motherLanguages'].toString(), + imageUrl: user['imageUrl'] ?? + 'assets/images/preview.png', + status: user['status'] ?? 'Active', + ); + }, + childCount: users.length, + ), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: crossAxisCount, + mainAxisSpacing: 10.0, + crossAxisSpacing: 10.0, + childAspectRatio: 0.75, + ), + ), + ), + ], + ), + const Center(child: Text('ENTHUSIASTS Content')), + const Center(child: Text('NEW USERS Content')), + const Center(child: Text('ACTIVE Content')), + const Center(child: Text('VISITORS Content')), ], ), ); From b23d35b7658ef0805d98a12bfca68cef8fd9c1cd Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:44:06 +0300 Subject: [PATCH 06/16] refactor: Update theme and UI elements in filters and community pages --- lib/pages/home/community.dart | 167 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 81 deletions(-) diff --git a/lib/pages/home/community.dart b/lib/pages/home/community.dart index 2d73c7c..e03624a 100644 --- a/lib/pages/home/community.dart +++ b/lib/pages/home/community.dart @@ -91,96 +91,101 @@ class _CommunityState extends ConsumerState ], ), centerTitle: false, - bottom: TabBar( - controller: _tabController, - tabs: [ - buildCategoryTab(Icons.home_outlined, Colors.black), - buildCategoryTab(Icons.check_box_outlined, Colors.green), - buildCategoryTab(Icons.back_hand_outlined, - Theme.of(context).colorScheme.secondary), - buildCategoryTab( - Icons.battery_charging_full_outlined, Colors.green), - buildCategoryTab(Icons.visibility_outlined, - Theme.of(context).colorScheme.onSurface), - ], - ), ), - body: TabBarView( - controller: _tabController, + body: Column( children: [ - CustomScrollView( - slivers: [ - const SliverToBoxAdapter( - child: SizedBox(height: 16), - ), - const SliverToBoxAdapter( - child: Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: EdgeInsets.all(16.0), - child: Text( - "Language Mates", - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - color: Color(0xFF262626), - ), + TabBar( + controller: _tabController, + tabs: [ + buildCategoryTab(Icons.home_outlined, Colors.yellow), + buildCategoryTab(Icons.check_box_outlined, Colors.green), + buildCategoryTab(Icons.back_hand_outlined, + Theme.of(context).colorScheme.secondary), + buildCategoryTab( + Icons.battery_charging_full_outlined, Colors.green), + buildCategoryTab(Icons.visibility_outlined, + Theme.of(context).colorScheme.onSurface), + ], + ), + Expanded( + child: TabBarView( + controller: _tabController, + children: [ + CustomScrollView( + slivers: [ + const SliverToBoxAdapter( + child: SizedBox(height: 16), ), - ), - ), - ), - const SliverToBoxAdapter( - child: Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: EdgeInsets.all(16.0), - child: Text( - "🎯 Recommended For You", - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: Color(0xFF737373), + const SliverToBoxAdapter( + child: Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.all(16.0), + child: Text( + "Language Mates", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ), ), ), - ), - ), - ), - users.isEmpty - ? const SliverToBoxAdapter( - child: Center(child: CircularProgressIndicator()), - ) - : SliverPadding( - padding: const EdgeInsets.all(8.0), - sliver: SliverGrid( - delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { - final user = users[index].data; - return UserCard( - name: user['name'].toString(), - age: user['age'] ?? 0, - studies: user['studyLanguages'].toString(), - speaks: user['motherLanguages'].toString(), - imageUrl: user['imageUrl'] ?? - 'assets/images/preview.png', - status: user['status'] ?? 'Active', - ); - }, - childCount: users.length, - ), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: crossAxisCount, - mainAxisSpacing: 10.0, - crossAxisSpacing: 10.0, - childAspectRatio: 0.75, + const SliverToBoxAdapter( + child: Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.all(16.0), + child: Text( + "🎯 Recommended For You", + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), ), ), ), - ], + users.isEmpty + ? const SliverToBoxAdapter( + child: Center(child: CircularProgressIndicator()), + ) + : SliverPadding( + padding: const EdgeInsets.all(8.0), + sliver: SliverGrid( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) { + final user = users[index].data; + return UserCard( + name: user['name'].toString(), + age: user['age'] ?? 0, + studies: user['studyLanguages'].toString(), + speaks: user['motherLanguages'].toString(), + imageUrl: user['imageUrl'] ?? + 'assets/images/preview.png', + status: user['status'] ?? 'Active', + ); + }, + childCount: users.length, + ), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: crossAxisCount, + mainAxisSpacing: 10.0, + crossAxisSpacing: 10.0, + childAspectRatio: 0.75, + ), + ), + ), + ], + ), + const Center(child: Text('ENTHUSIASTS Content')), + const Center(child: Text('NEW USERS Content')), + const Center(child: Text('ACTIVE Content')), + const Center(child: Text('VISITORS Content')), + ], + ), ), - const Center(child: Text('ENTHUSIASTS Content')), - const Center(child: Text('NEW USERS Content')), - const Center(child: Text('ACTIVE Content')), - const Center(child: Text('VISITORS Content')), ], ), ); From a405b9ae38aae93731be9d5d7a3c0f342b006efa Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:48:11 +0300 Subject: [PATCH 07/16] refactor: Update home page bottom navigation bar --- lib/pages/home/home.dart | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/pages/home/home.dart b/lib/pages/home/home.dart index 95c16f4..1bb344b 100644 --- a/lib/pages/home/home.dart +++ b/lib/pages/home/home.dart @@ -4,9 +4,6 @@ import 'package:flutter/material.dart'; import 'package:langx_flutter/pages/home/community.dart'; import 'package:langx_flutter/pages/home/profile.dart'; -// Variables -int index = 1; - class Home extends StatefulWidget { const Home({super.key}); @@ -16,13 +13,15 @@ class Home extends StatefulWidget { // Pages selection class _HomeState extends State { + int index = 1; + final List _bodyElements = [ const Text("Chat Page"), const Community(), const Profile(), ]; -// Main Widget + // Main Widget @override Widget build(BuildContext context) { return Scaffold( @@ -30,20 +29,11 @@ class _HomeState extends State { bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem(icon: Icon(Icons.chat), label: "Chat"), - BottomNavigationBarItem( - icon: Icon(Icons.home), - label: "Home", - ), - BottomNavigationBarItem( - icon: Icon(Icons.person), - label: "Profile", - ) + BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"), + BottomNavigationBarItem(icon: Icon(Icons.person), label: "Profile"), ], - - // Index Handling currentIndex: index, onTap: (value) { - index = value; setState(() { index = value; }); From cfc36408e5f4f8733272a98808521ea99bc073cc Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:58:33 +0300 Subject: [PATCH 08/16] refactor: Remove unused code for selected item color in bottom navigation bar --- lib/components/bottom_navigation_bar.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/bottom_navigation_bar.dart b/lib/components/bottom_navigation_bar.dart index 514b1e0..6f95749 100644 --- a/lib/components/bottom_navigation_bar.dart +++ b/lib/components/bottom_navigation_bar.dart @@ -28,7 +28,6 @@ class AppBottomNavigationBar extends StatelessWidget { ), ], currentIndex: currentIndex, - selectedItemColor: Colors.amber[800], onTap: onTap, ); } From 366870eca74025cab8dc3f597c3ba499fce45f81 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 20:58:41 +0300 Subject: [PATCH 09/16] refactor: Update theme.dart to improve bottom navigation bar appearance --- lib/theme.dart | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/theme.dart b/lib/theme.dart index abc8369..4054221 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -23,8 +23,11 @@ ThemeData whiteTheme() { labelStyle: TextStyle(color: Color(0xFF000000)), ), appBarTheme: const AppBarTheme( - backgroundColor: Color(0xFFFEC409), // Added backgroundColor for AppBar - foregroundColor: Colors.black, // Added foregroundColor for AppBar + backgroundColor: Color(0xFFFEC409), + foregroundColor: Colors.black, + ), + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + selectedItemColor: Color(0xFFFEC409), ), ); } @@ -52,8 +55,13 @@ ThemeData darkTheme() { labelStyle: TextStyle(color: Color(0xFFFFFFFF)), ), appBarTheme: const AppBarTheme( - backgroundColor: Color(0xFFFEC409), // Added backgroundColor for AppBar - foregroundColor: Colors.black, // Added foregroundColor for AppBar + backgroundColor: Color(0xFFFEC409), + foregroundColor: Colors.black, + ), + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + backgroundColor: Color(0xFF121212), + unselectedItemColor: Color(0xFFFFFFFF), + selectedItemColor: Color(0xFFFEC409), ), ); } From 35ecb3651f5548681de9c05f6f4631f462eee07a Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:16:28 +0300 Subject: [PATCH 10/16] refactor: Update card theme in theme.dart --- lib/theme.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/theme.dart b/lib/theme.dart index 4054221..c46384b 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -29,6 +29,11 @@ ThemeData whiteTheme() { bottomNavigationBarTheme: const BottomNavigationBarThemeData( selectedItemColor: Color(0xFFFEC409), ), + cardTheme: const CardTheme( + color: Colors.white, + shadowColor: Colors.grey, + elevation: 5, + ), ); } @@ -63,5 +68,10 @@ ThemeData darkTheme() { unselectedItemColor: Color(0xFFFFFFFF), selectedItemColor: Color(0xFFFEC409), ), + cardTheme: const CardTheme( + color: Color(0xFF1A1A1A), + shadowColor: Colors.black87, + elevation: 5, + ), ); } From 238439ef9eb4701c32ed97462c738c3887b85054 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:16:52 +0300 Subject: [PATCH 11/16] refactor: Remove elevation and color white from profile cards --- lib/components/profile/about_me_card.dart | 2 -- lib/components/profile/badges_card.dart | 2 -- lib/components/profile/day_streaks_card.dart | 2 -- lib/components/profile/mother_tongues_card.dart | 2 -- lib/components/profile/others_card.dart | 2 -- lib/components/profile/study_languages_card.dart | 2 -- lib/components/profile/token_card.dart | 2 -- lib/components/profile/user_card.dart | 2 -- 8 files changed, 16 deletions(-) diff --git a/lib/components/profile/about_me_card.dart b/lib/components/profile/about_me_card.dart index da84602..445a19c 100644 --- a/lib/components/profile/about_me_card.dart +++ b/lib/components/profile/about_me_card.dart @@ -47,11 +47,9 @@ class ProfileAboutMeCard extends StatelessWidget { height: cardHeight, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/badges_card.dart b/lib/components/profile/badges_card.dart index 94f1eb1..a27377a 100644 --- a/lib/components/profile/badges_card.dart +++ b/lib/components/profile/badges_card.dart @@ -14,11 +14,9 @@ class BadgesCard extends StatelessWidget { height: 260, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/day_streaks_card.dart b/lib/components/profile/day_streaks_card.dart index 8831999..3ba7d38 100644 --- a/lib/components/profile/day_streaks_card.dart +++ b/lib/components/profile/day_streaks_card.dart @@ -16,11 +16,9 @@ class ProfileDayStreaksCard extends StatelessWidget { height: 250, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/mother_tongues_card.dart b/lib/components/profile/mother_tongues_card.dart index 5e0510a..e49c9c7 100644 --- a/lib/components/profile/mother_tongues_card.dart +++ b/lib/components/profile/mother_tongues_card.dart @@ -17,11 +17,9 @@ class MotherTonguesCard extends StatelessWidget { height: 165, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/others_card.dart b/lib/components/profile/others_card.dart index 8d11dd7..f29f966 100644 --- a/lib/components/profile/others_card.dart +++ b/lib/components/profile/others_card.dart @@ -15,11 +15,9 @@ class OthersCard extends StatelessWidget { height: 230, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/study_languages_card.dart b/lib/components/profile/study_languages_card.dart index d1e75bb..0e317a2 100644 --- a/lib/components/profile/study_languages_card.dart +++ b/lib/components/profile/study_languages_card.dart @@ -17,11 +17,9 @@ class StudyLanguagesCard extends StatelessWidget { height: 165, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/token_card.dart b/lib/components/profile/token_card.dart index f8d9647..13c5536 100644 --- a/lib/components/profile/token_card.dart +++ b/lib/components/profile/token_card.dart @@ -17,11 +17,9 @@ class ProfileTokenCard extends StatelessWidget { height: 320, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( diff --git a/lib/components/profile/user_card.dart b/lib/components/profile/user_card.dart index 6fb5c2e..6558716 100644 --- a/lib/components/profile/user_card.dart +++ b/lib/components/profile/user_card.dart @@ -24,11 +24,9 @@ class ProfileUserCard extends StatelessWidget { height: 330, width: MediaQuery.of(context).size.width, child: Card( - elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), - color: Colors.white, child: Padding( padding: const EdgeInsets.all(16.0), child: Column( From 52fa23177641ac7876f1440a18251e9a1a943cab Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:17:21 +0300 Subject: [PATCH 12/16] refactor: Update profile page UI and theme --- lib/pages/home/profile.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/pages/home/profile.dart b/lib/pages/home/profile.dart index c09dc64..b9712a4 100644 --- a/lib/pages/home/profile.dart +++ b/lib/pages/home/profile.dart @@ -36,7 +36,7 @@ class _ProfileState extends ConsumerState { onTap: () async { ref.read(authProvider.notifier).logout(context); }, - child: const Icon(Icons.exit_to_app_outlined, size: 30), + child: const Icon(Icons.exit_to_app_outlined), ), const SizedBox(width: 10.0), ], @@ -44,9 +44,7 @@ class _ProfileState extends ConsumerState { ], ), centerTitle: false, - backgroundColor: Colors.yellow[700], ), - backgroundColor: const Color.fromARGB(31, 163, 163, 163), body: Container( padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), child: ListView( From 7f0a66b21e6e8ed0fedce6e3f2b5bce14cb3407d Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:17:54 +0300 Subject: [PATCH 13/16] fix: Removed profile page padding verticaly in profile.dart --- lib/pages/home/profile.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/home/profile.dart b/lib/pages/home/profile.dart index b9712a4..1ff1734 100644 --- a/lib/pages/home/profile.dart +++ b/lib/pages/home/profile.dart @@ -46,7 +46,7 @@ class _ProfileState extends ConsumerState { centerTitle: false, ), body: Container( - padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), + padding: const EdgeInsets.symmetric(horizontal: 10.0), child: ListView( children: const [ // Afterwards, it should be modified to take an ID as input and retrieve data based on that ID. From e816067aa68c1cb0376e0c6109ff29a95a3b1320 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:20:03 +0300 Subject: [PATCH 14/16] refactor: Remove unnecessary code and update UI in ProfileTokenCard --- lib/components/profile/token_card.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/components/profile/token_card.dart b/lib/components/profile/token_card.dart index 13c5536..6ff84d5 100644 --- a/lib/components/profile/token_card.dart +++ b/lib/components/profile/token_card.dart @@ -107,7 +107,6 @@ class ProfileTokenCard extends StatelessWidget { 'Leaderboard', style: TextStyle( fontSize: 18, - color: Colors.black, ), ), const Spacer(), @@ -120,10 +119,6 @@ class ProfileTokenCard extends StatelessWidget { ], ), ), - Container( - height: 1, - color: Colors.grey[300], - ), ], ), ), From 5040a44ed8b1bb6b28ed358731bef23ed7e5a982 Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:36:57 +0300 Subject: [PATCH 15/16] refactor: Remove unnecessary code and update UI in MotherTonguesCard and StudyLanguagesCard --- lib/components/profile/mother_tongues_card.dart | 1 - lib/components/profile/study_languages_card.dart | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/components/profile/mother_tongues_card.dart b/lib/components/profile/mother_tongues_card.dart index e49c9c7..aad38dc 100644 --- a/lib/components/profile/mother_tongues_card.dart +++ b/lib/components/profile/mother_tongues_card.dart @@ -64,7 +64,6 @@ class MotherTonguesCard extends StatelessWidget { languages[index], style: const TextStyle( fontSize: 18, - color: Colors.black, ), ), const Spacer(), diff --git a/lib/components/profile/study_languages_card.dart b/lib/components/profile/study_languages_card.dart index 0e317a2..ccaa3fe 100644 --- a/lib/components/profile/study_languages_card.dart +++ b/lib/components/profile/study_languages_card.dart @@ -64,7 +64,6 @@ class StudyLanguagesCard extends StatelessWidget { languages[index], style: const TextStyle( fontSize: 18, - color: Colors.black, ), ), const Spacer(), From c6f2d74bbfcaa9e96f60529bf4c8d8b10026e2eb Mon Sep 17 00:00:00 2001 From: xue Date: Fri, 28 Jun 2024 21:49:06 +0300 Subject: [PATCH 16/16] refactor: Update More StudyLanguagesCard and MotherTonguesCard UI and data --- lib/pages/home/profile.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/pages/home/profile.dart b/lib/pages/home/profile.dart index 1ff1734..71d3399 100644 --- a/lib/pages/home/profile.dart +++ b/lib/pages/home/profile.dart @@ -75,8 +75,14 @@ class _ProfileState extends ConsumerState { userID: '@langx_9049', verifiedemail: true, aboutMe: ''), - StudyLanguagesCard(languages: ["English"]), - MotherTonguesCard(languages: ["Chinese (Simplified)"]), + StudyLanguagesCard(languages: ["English", "Italian", "French"]), + MotherTonguesCard(languages: [ + "Chinese (Simplified)", + "English", + "Italian", + "French", + "Spanish", + ]), BadgesCard( badges: [ {