From 64b56790c77e4efc3a1a79c1a3d76fbdde29a472 Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Fri, 23 Aug 2024 10:52:00 +0530 Subject: [PATCH 1/4] Divider update in Drawer --- lib/src/drawer.dart | 130 ++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/lib/src/drawer.dart b/lib/src/drawer.dart index c05f0f9..8db13d4 100644 --- a/lib/src/drawer.dart +++ b/lib/src/drawer.dart @@ -96,71 +96,81 @@ class _NavDrawerState extends State { highlight: indexSnapshot.data == 2, selected: indexSnapshot.data == 2, ), - 3: NavExpansionTile( - title: "Mess", - leading: Icons.restaurant_outlined, - initiallyExpanded: - indexSnapshot.data == 3 || indexSnapshot.data == 14, + 3: Column( children: [ - NavListTile( - icon: Icons.restaurant_outlined, - title: "Mess Menu", - onTap: () { - changeSelection(3, drawerState!); - navigateNamed('/mess'); - }, - highlight: indexSnapshot.data == 3, - selected: indexSnapshot.data == 3, - ), - NavListTile( - icon: Icons.restaurant_outlined, - title: "Take your meal", - onTap: () { - changeSelection(3, drawerState!); - navigateNamed('/messcalendar/qr'); - }, - highlight: indexSnapshot.data == 14, - selected: indexSnapshot.data == 14, - ), + Divider(), + NavExpansionTile( + title: "Mess", + leading: Icons.restaurant_outlined, + initiallyExpanded: indexSnapshot.data == 3 || + indexSnapshot.data == 14, + children: [ + NavListTile( + icon: Icons.restaurant_outlined, + title: "Mess Menu", + onTap: () { + changeSelection(3, drawerState!); + navigateNamed('/mess'); + }, + highlight: indexSnapshot.data == 3, + selected: indexSnapshot.data == 3, + ), + NavListTile( + icon: Icons.restaurant_outlined, + title: "Take your meal", + onTap: () { + changeSelection(3, drawerState!); + navigateNamed('/messcalendar/qr'); + }, + highlight: indexSnapshot.data == 14, + selected: indexSnapshot.data == 14, + ), + ], + ) ], ), - 4: NavExpansionTile( - leading: Icons.work_outline, - title: "Blogs", - initiallyExpanded: indexSnapshot.data! <= 6 && - indexSnapshot.data! >= 4, + 4: Column( children: [ - NavListTile( - icon: Icons.work_outline, - title: "Placement Blog", - onTap: () { - changeSelection(4, drawerState!); - navigateNamed('/placeblog'); - }, - highlight: indexSnapshot.data == 4, - selected: indexSnapshot.data == 4, - ), - NavListTile( - icon: Icons.work_outline, - title: "Internship Blog", - onTap: () { - changeSelection(5, drawerState!); - navigateNamed('/trainblog'); - }, - highlight: indexSnapshot.data == 5, - selected: indexSnapshot.data == 5, - ), - NavListTile( - // key: Key((indexSnapshot.data == 6).toString()), - icon: Icons.work_outline, - title: "External Blog", - onTap: () { - changeSelection(6, drawerState!); - navigateNamed('/externalblog'); - }, - highlight: indexSnapshot.data == 6, - selected: indexSnapshot.data == 6, + NavExpansionTile( + leading: Icons.work_outline, + title: "Blogs", + initiallyExpanded: indexSnapshot.data! <= 6 && + indexSnapshot.data! >= 4, + children: [ + NavListTile( + icon: Icons.work_outline, + title: "Placement Blog", + onTap: () { + changeSelection(4, drawerState!); + navigateNamed('/placeblog'); + }, + highlight: indexSnapshot.data == 4, + selected: indexSnapshot.data == 4, + ), + NavListTile( + icon: Icons.work_outline, + title: "Internship Blog", + onTap: () { + changeSelection(5, drawerState!); + navigateNamed('/trainblog'); + }, + highlight: indexSnapshot.data == 5, + selected: indexSnapshot.data == 5, + ), + NavListTile( + // key: Key((indexSnapshot.data == 6).toString()), + icon: Icons.work_outline, + title: "External Blog", + onTap: () { + changeSelection(6, drawerState!); + navigateNamed('/externalblog'); + }, + highlight: indexSnapshot.data == 6, + selected: indexSnapshot.data == 6, + ), + ], ), + Divider(), ], ), 15: NavListTile( From 0a108bd771ec1c6e7a9bb393be9a67d4b34deea0 Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Fri, 23 Aug 2024 10:52:00 +0530 Subject: [PATCH 2/4] Downgrade to Material2 --- lib/main.dart | 81 +++++++++++++++++++++++++++++++++------------------ pubspec.yaml | 1 - 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 3e706bb..c5a9ce6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -155,7 +155,7 @@ class MyAppState extends State with WidgetsBindingObserver { theme: ThemeData( // fontFamily: "SourceSansPro", fontFamily: "IBMPlexSans", - + useMaterial3: false, primaryColor: widget.bloc.primaryColor, colorScheme: theme.colorScheme.copyWith( primary: widget.bloc.primaryColor, @@ -166,9 +166,10 @@ class MyAppState extends State with WidgetsBindingObserver { surface: widget.bloc.brightness == AppBrightness.light ? Colors.white : widget.bloc.brightness.toColor(), - surfaceContainerHighest: widget.bloc.brightness == AppBrightness.light - ? Color(0xFFE8ECF2) - : Color(0xFF121212), + surfaceContainerHighest: + widget.bloc.brightness == AppBrightness.light + ? Color(0xFFE8ECF2) + : Color(0xFF121212), onSurface: widget.bloc.brightness == AppBrightness.light ? Colors.black : Colors.white, @@ -208,30 +209,54 @@ class MyAppState extends State with WidgetsBindingObserver { ? Colors.black : Colors.white, ), - headlineSmall: TextStyle()), checkboxTheme: CheckboxThemeData( - fillColor: WidgetStateProperty.resolveWith((Set states) { - if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } - return null; - }), - ), radioTheme: RadioThemeData( - fillColor: WidgetStateProperty.resolveWith((Set states) { - if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } - return null; - }), - ), switchTheme: SwitchThemeData( - thumbColor: WidgetStateProperty.resolveWith((Set states) { - if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } - return null; - }), - trackColor: WidgetStateProperty.resolveWith((Set states) { - if (states.contains(WidgetState.disabled)) { return null; } - if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } - return null; - }), - ), bottomAppBarTheme: BottomAppBarTheme(color: widget.bloc.primaryColor), + headlineSmall: TextStyle()), + checkboxTheme: CheckboxThemeData( + fillColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.disabled)) { + return null; + } + if (states.contains(WidgetState.selected)) { + return widget.bloc.accentColor; + } + return null; + }), + ), + radioTheme: RadioThemeData( + fillColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.disabled)) { + return null; + } + if (states.contains(WidgetState.selected)) { + return widget.bloc.accentColor; + } + return null; + }), + ), + switchTheme: SwitchThemeData( + thumbColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.disabled)) { + return null; + } + if (states.contains(WidgetState.selected)) { + return widget.bloc.accentColor; + } + return null; + }), + trackColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.disabled)) { + return null; + } + if (states.contains(WidgetState.selected)) { + return widget.bloc.accentColor; + } + return null; + }), + ), + bottomAppBarTheme: BottomAppBarTheme(color: widget.bloc.primaryColor), ), onGenerateRoute: (RouteSettings settings) { // print(settings.name); diff --git a/pubspec.yaml b/pubspec.yaml index 7d9f5e5..8ce8eaf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -94,7 +94,6 @@ flutter: - assets/map/assets/ - assets/map/assets/map/ - assets/buynsell/ - - .env fonts: - family: IBMPlexSans fonts: From 992615ac5d4675211df03ebf7308d6250483d05e Mon Sep 17 00:00:00 2001 From: HariRags Date: Sat, 31 Aug 2024 23:54:12 +0530 Subject: [PATCH 3/4] .env.dev moved to assets --- .env.dev => assets/.env.dev | 0 lib/main.dart | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .env.dev => assets/.env.dev (100%) diff --git a/.env.dev b/assets/.env.dev similarity index 100% rename from .env.dev rename to assets/.env.dev diff --git a/lib/main.dart b/lib/main.dart index c5a9ce6..44aaff3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -59,7 +59,7 @@ import 'package:uni_links/uni_links.dart'; void main() async { GlobalKey key = GlobalKey(); WidgetsFlutterBinding.ensureInitialized(); - await Firebase.initializeApp(); + await Firebase.initializeApp( ); InstiAppBloc bloc = InstiAppBloc(wholeAppKey: key); FirebaseMessaging.onBackgroundMessage(sendMessage); await dotenv.load(fileName: ".env"); From cb7383e67bf67c3677cb1e14a0a3f5e3fffc26ac Mon Sep 17 00:00:00 2001 From: HariRags Date: Sat, 31 Aug 2024 23:59:45 +0530 Subject: [PATCH 4/4] pubspec.yaml has .env and .env.dev now --- assets/.env.dev => .env.dev | 0 pubspec.yaml | 2 ++ 2 files changed, 2 insertions(+) rename assets/.env.dev => .env.dev (100%) diff --git a/assets/.env.dev b/.env.dev similarity index 100% rename from assets/.env.dev rename to .env.dev diff --git a/pubspec.yaml b/pubspec.yaml index 8ce8eaf..c1b4df8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,6 +86,8 @@ dev_dependencies: # The following section is specific to Flutter. flutter: assets: + - .env + - .env.dev - assets/ - assets/login/ - assets/map/