From 6562257e8566f121cac25ff0165cf140ca54a738 Mon Sep 17 00:00:00 2001 From: SayedZeeshanHyder Date: Fri, 14 Jun 2024 09:13:28 +0530 Subject: [PATCH] Drawer Section Done, Notification Screen Linked, Bottom Nav Bar done --- .../committees_screen/committees_screen.dart | 6 +- .../screens/main_screen/main_screen.dart | 608 +++++++++--------- .../widgets/main_bottom_nav_bar.dart | 25 +- .../screens/notes_screen/notes_screen.dart | 6 +- .../railway_screen/railway_screen.dart | 55 +- .../widgets/concession_status_modal.dart | 18 +- .../department_list.dart | 21 +- .../notification_screen.dart | 2 +- 8 files changed, 381 insertions(+), 360 deletions(-) diff --git a/lib/new_ui/screens/committees_screen/committees_screen.dart b/lib/new_ui/screens/committees_screen/committees_screen.dart index 195b448a..c954b071 100644 --- a/lib/new_ui/screens/committees_screen/committees_screen.dart +++ b/lib/new_ui/screens/committees_screen/committees_screen.dart @@ -41,13 +41,13 @@ class _CommitteesScreenState extends State { double _height = MediaQuery.of(context).size.height; double _width = MediaQuery.of(context).size.width; return Scaffold( - appBar: CommonAppbar(), + appBar: const CommonAppbar(), body: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( + /*Padding( padding: const EdgeInsets.all(8.0).copyWith( top: 15, ), @@ -58,7 +58,7 @@ class _CommitteesScreenState extends State { .titleMedium! .copyWith(fontWeight: FontWeight.bold, fontSize: 30), ), - ), + ),*/ const SizedBox( height: 25, ), diff --git a/lib/new_ui/screens/main_screen/main_screen.dart b/lib/new_ui/screens/main_screen/main_screen.dart index a102c3a7..5e10bfb4 100644 --- a/lib/new_ui/screens/main_screen/main_screen.dart +++ b/lib/new_ui/screens/main_screen/main_screen.dart @@ -9,6 +9,7 @@ import 'package:tsec_app/models/user_model/user_model.dart'; import 'package:tsec_app/new_ui/screens/erp_screen/erp_screen.dart'; import 'package:tsec_app/new_ui/screens/home_screen/widgets/home_widget.dart'; import 'package:tsec_app/new_ui/screens/main_screen/widgets/main_bottom_nav_bar.dart'; +import 'package:tsec_app/new_ui/screens/notes_screen/notes_screen.dart'; import 'package:tsec_app/new_ui/screens/profile_screen/profile_screen.dart'; import 'package:tsec_app/new_ui/screens/railway_screen/railway_screen.dart'; import 'package:tsec_app/new_ui/screens/timetable_screen/timetable_screen.dart'; @@ -17,6 +18,7 @@ import 'package:tsec_app/provider/auth_provider.dart'; import 'package:tsec_app/provider/railway_concession_provider.dart'; import 'package:tsec_app/new_ui/screens/committees_screen/committees_screen.dart'; import 'package:tsec_app/screens/departmentlist_screen/department_list.dart'; +import 'package:tsec_app/screens/notification_screen/notification_screen.dart'; import 'package:tsec_app/screens/tpc_screen.dart'; import 'package:url_launcher/link.dart'; @@ -59,7 +61,7 @@ class _MainScreenState extends ConsumerState { }); }, ), - "attendance": ERPScreen(), + "notes": const NotesScreen(), "timetable": const TimeTable(), "concession": const RailwayConcessionScreen(), "profile": ProfilePage( @@ -76,7 +78,6 @@ class _MainScreenState extends ConsumerState { }); }, ), - "attendance": ERPScreen(), "profile": ProfilePage( justLoggedIn: false, ) @@ -87,6 +88,9 @@ class _MainScreenState extends ConsumerState { @override Widget build(BuildContext context) { + + Size size = MediaQuery.of(context).size; + pages = [ HomeWidget( changeCurrentPage: (page,index) { @@ -96,8 +100,7 @@ class _MainScreenState extends ConsumerState { }); }, ), - ERPScreen(), - const TimeTable(), + const NotesScreen(), const RailwayConcessionScreen(), ProfilePage(justLoggedIn: false), const TPCScreen(), @@ -138,8 +141,8 @@ class _MainScreenState extends ConsumerState { ? "Home" : currentBottomNavPage == "attendance" ? "ERP" - : currentBottomNavPage == "timetable" - ? "Schedule" + : currentBottomNavPage == "notes" + ? "Notes" : currentBottomNavPage == "concession" ? "Railway Concession" : "") @@ -163,21 +166,16 @@ class _MainScreenState extends ConsumerState { _scaffoldKey.currentState?.openDrawer(); }, child: CircleAvatar( - radius: 35, + radius: 20, backgroundImage: MemoryImage(profilePic), // backgroundImage: MemoryImage(_image!), ), ) - : GestureDetector( + : InkWell( onTap: () { _scaffoldKey.currentState?.openDrawer(); }, - child: SizedBox( - height: 30, - width: 30, - child: - Image.asset("assets/icons/profileIcon.png"), - ), + child: CircleAvatar(radius: 15,backgroundColor: Colors.blue.shade400,child: Icon(Icons.menu,color: Colors.white,)), ) // SingleChildScrollView( @@ -217,11 +215,14 @@ class _MainScreenState extends ConsumerState { actions: userDetails != null ? [ InkWell( - child: Image.asset( - "assets/icons/notes.png" // Black icon color - ), + child: CircleAvatar( + backgroundColor: Colors.blue.shade400, + child: Icon(Icons.notifications,color: Colors.white,), + ), onTap: () { - GoRouter.of(context).push('/notes'); + //Add the Notification Screen here + //GoRouter.of(context).push('/notes'); + Navigator.push(context,MaterialPageRoute(builder: (context)=> NotificationScreen(),),); }, ), SizedBox( @@ -252,315 +253,316 @@ class _MainScreenState extends ConsumerState { drawer: !concessionOpen ? BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Drawer( - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topRight: Radius.circular(20), - bottomRight: Radius.circular(20)), - ), - backgroundColor: Colors.black, - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 20,), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - profilePic != null - ? CircleAvatar( - radius: 35, - backgroundImage: MemoryImage(profilePic), - // backgroundImage: MemoryImage(_image!), - ) - : const CircleAvatar( - radius: 35, - backgroundImage: - AssetImage("assets/images/pfpholder.jpg"), - ), - SizedBox(width: 10,), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - userDetails != null - ? (userDetails.isStudent - ? userDetails.studentModel!.name - : userDetails.facultyModel!.name) - : "Tsecite", - style: Theme.of(context) - .textTheme - .headlineLarge! - .copyWith(fontSize: 20), - ), - SizedBox(height: 5,), - Text( - userDetails != null ? (userDetails.isStudent ? '${userDetails.studentModel!.branch} ${userDetails.studentModel!.gradyear}' : '') : '', - style: Theme.of(context).textTheme.headlineLarge!.copyWith(fontSize: 12), - ) - ], - )) - ], - ), + child: Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow(color: Colors.blue,blurRadius: 5,spreadRadius: 3), + ], + ), + child: Drawer( + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topRight: Radius.circular(20), + bottomRight: Radius.circular(20)), + ), + backgroundColor: Colors.black, + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 20,), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + profilePic != null + ? CircleAvatar( + radius: 35, + backgroundImage: MemoryImage(profilePic), + // backgroundImage: MemoryImage(_image!), + ) + : const CircleAvatar( + radius: 35, + backgroundImage: + AssetImage("assets/images/pfpholder.jpg"), + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + userDetails != null + ? (userDetails.isStudent + ? userDetails.studentModel!.name + : userDetails.facultyModel!.name) + : "Tsecite", + style: Theme.of(context) + .textTheme + .headlineLarge! + .copyWith(fontSize: 20), + ), + SizedBox(height: 5,), + Text( + userDetails != null ? (userDetails.isStudent ? '${userDetails.studentModel!.branch} ${userDetails.studentModel!.gradyear}' : '') : '', + style: Theme.of(context).textTheme.headlineLarge!.copyWith(fontSize: 12), + ) + ], + )) + ], + ), - const SizedBox( - height: 30, - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Home', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - fontSize: 13, - color: currentPage == 0 - ? Theme.of(context).colorScheme.onBackground - : Colors.white, - ), + const SizedBox( + height: 30, ), - onTap: () { - setState(() { - currentPage = 0; - }); - Navigator.pop(context); - }, - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Railway Concession', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - fontSize: 13, - color: currentPage == 3 ? Theme.of(context).colorScheme.onBackground : Colors.white, + ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Home', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: currentPage == 0 + ? Theme.of(context).colorScheme.onBackground + : Colors.white, + ), ), - ), - onTap: () { - //page 3 - setState(() { - currentPage = 3; + onTap: () { + setState(() { + currentPage = 0; + }); Navigator.pop(context); - }); - }, - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Departments', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - fontSize: 13, - color: currentPage == 7 - ? Theme.of(context).colorScheme.onBackground - : Colors.white, - ), - ), - onTap: () { - ref.read(titleProvider.notifier).state = 'Departments'; - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => DepartmentListScreen(), - ), - ); - }, - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Committees', - style: Theme.of(context) - .textTheme - .headlineSmall! - .copyWith( - fontSize: 13, - color: currentPage == 6 - ? Theme.of(context).colorScheme.onBackground - : Colors.white, - ), + }, ), - onTap: () { - ref.read(titleProvider.notifier).state = 'Committees'; - /*setState(() { - currentPage = 6; - });*/ - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CommitteesScreen(), + /*ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Railway Concession', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: currentPage == 3 ? Theme.of(context).colorScheme.onBackground : Colors.white, ), - ); - }, - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Training and Placement Cell', - style: Theme.of(context) - .textTheme - .headlineSmall! - .copyWith( - fontSize: 13, - color: currentPage == 5 - ? Theme.of(context).colorScheme.onBackground - : Colors.white, + ), + onTap: () { + //page 3 + setState(() { + currentPage = 3; + Navigator.pop(context); + }); + }, + ),*/ + ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Departments', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: currentPage == 7 + ? Theme.of(context).colorScheme.onBackground + : Colors.white, + ), + ), + onTap: () { + ref.read(titleProvider.notifier).state = 'Departments'; + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DepartmentListScreen(), ), + ); + }, ), - onTap: () { - ref.read(titleProvider.notifier).state = 'Training and Placement Cell'; - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => TPCScreen(), - ), - ); - }, - ), - - // ListTile( - // contentPadding: EdgeInsets.zero, - // title: Text( - // 'Profile', - // style: Theme.of(context).textTheme.headlineMedium!.copyWith( - // fontSize: 22, - // color: currentPage == 5 - // ? Theme.of(context).colorScheme.onBackground - // : Colors.white, - // ), - // ), - // onTap: () { - // setState(() { - // currentPage = 5; - // }); - // Navigator.pop(context); - // }, - // ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Manage Account', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( + ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Committees', + style: Theme.of(context) + .textTheme + .headlineSmall! + .copyWith( fontSize: 13, - color: Colors.white, + color: currentPage == 6 + ? Theme.of(context).colorScheme.onBackground + : Colors.white, ), + ), + onTap: () { + ref.read(titleProvider.notifier).state = 'Committees'; + /*setState(() { + currentPage = 6; + });*/ + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CommitteesScreen(), ), - onTap: () { - //page 4 - // setState(() { - // currentPage = 4; - // Navigator.pop(context); - // }); - }, // TODO: Make this navigate to profile edit - ), - ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'About', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( + ); + }, + ), + ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Training and Placement Cell', + style: Theme.of(context) + .textTheme + .headlineSmall! + .copyWith( fontSize: 13, - color: Colors.white, + color: currentPage == 5 + ? Theme.of(context).colorScheme.onBackground + : Colors.white, ), + ), + onTap: () { + ref.read(titleProvider.notifier).state = 'Training and Placement Cell'; + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TPCScreen(), ), - onTap: () { }, // TODO: Make this navigate to the About screen + ); + }, + ), + + // ListTile( + // contentPadding: EdgeInsets.zero, + // title: Text( + // 'Profile', + // style: Theme.of(context).textTheme.headlineMedium!.copyWith( + // fontSize: 22, + // color: currentPage == 5 + // ? Theme.of(context).colorScheme.onBackground + // : Colors.white, + // ), + // ), + // onTap: () { + // setState(() { + // currentPage = 5; + // }); + // Navigator.pop(context); + // }, + // ), + /*ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Manage Account', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: Colors.white, ), - Link( - uri: Uri.parse("mailto:devsclubtsec@gmail.com"), - builder: (context, followLink) => ListTile( - contentPadding: EdgeInsets.zero, - title: Text( - 'Contact Us', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - fontSize: 13, - color: currentPage == 4 - ? Theme.of(context) - .colorScheme - .onBackground - : Colors.white, - ), - ), - onTap: () => followLink?.call(), - ), + ), + onTap: () { + //page 4 + // setState(() { + // currentPage = 4; + // Navigator.pop(context); + // }); + }, // TODO: Make this navigate to profile edit + ),*/ + ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'About', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: Colors.white, ), - Container( - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(50)), - color: Color(0xff383838), + ), + onTap: () { }, // TODO: Make this navigate to the About screen + ), + Link( + uri: Uri.parse("mailto:devsclubtsec@gmail.com"), + builder: (context, followLink) => ListTile( + contentPadding: EdgeInsets.zero, + title: Text( + 'Contact Us', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 13, + color: currentPage == 4 + ? Theme.of(context) + .colorScheme + .onBackground + : Colors.white, ), - child: ListTile( - contentPadding: EdgeInsets.zero, - title: Center( - child: Text( - data != null ? 'Logout' : 'Login', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - fontSize: 22, - color: Theme.of(context).colorScheme.error, - ), + ), + onTap: () => followLink?.call(), + ), + ), + + Spacer(), + Container( + alignment: Alignment.center, + width: size.width, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: Color(0xff383838), + ), + child: InkWell( + child: Text( + data != null ? 'Logout' : 'Login', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: 22, + color: Theme.of(context).colorScheme.error, ), - ), - onTap: () { - if (data != null) { - ref.watch(authProvider.notifier).signout(); - GoRouter.of(context).go('/login'); - // Navigator.pop(context); - } else { - GoRouter.of(context).go('/login'); - } - }, - ), ), - const SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text.rich( + onTap: () { + if (data != null) { + ref.watch(authProvider.notifier).signout(); + GoRouter.of(context).go('/login'); + // Navigator.pop(context); + } else { + GoRouter.of(context).go('/login'); + } + }, + ), + ), + const SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text.rich( + TextSpan( + text: 'Made with ♥️ TSEC', + style: TextStyle(fontSize: 10, color: Colors.white), + children: [ TextSpan( - text: 'Made with ♥️ TSEC', - style: TextStyle(fontSize: 10, color: Colors.white), - children: [ - TextSpan( - text: 'Devs Club', - style: TextStyle(fontSize: 10, color: Colors.blue) - ) - ] - ), - ) - ], + text: 'Devs Club', + style: TextStyle(fontSize: 10, color: Colors.blue) + ) + ] + ), ) ], - ), - ) - ], + ) + ], + ), ), ), - ), + ), ) : null, bottomNavigationBar: MainBottomNavBar( diff --git a/lib/new_ui/screens/main_screen/widgets/main_bottom_nav_bar.dart b/lib/new_ui/screens/main_screen/widgets/main_bottom_nav_bar.dart index bd356346..00ac5523 100644 --- a/lib/new_ui/screens/main_screen/widgets/main_bottom_nav_bar.dart +++ b/lib/new_ui/screens/main_screen/widgets/main_bottom_nav_bar.dart @@ -10,6 +10,8 @@ import 'package:tsec_app/provider/auth_provider.dart'; import 'package:tsec_app/new_ui/screens/profile_screen/profile_screen.dart'; import 'package:tsec_app/provider/railway_concession_provider.dart'; +import '../../notes_screen/notes_screen.dart'; + class MainBottomNavBar extends ConsumerStatefulWidget { String currentBottomNavPage; Function changeCurrentBottomNavPage; @@ -48,7 +50,7 @@ class _HomeScreenState extends ConsumerState { }); }, ), - "attendance": ERPScreen(), + "notes": NotesScreen(), "timetable": const TimeTable(), "concession": const RailwayConcessionScreen(), "profile": ProfilePage( @@ -64,7 +66,6 @@ class _HomeScreenState extends ConsumerState { }); }, ), - "attendance": ERPScreen(), "profile": ProfilePage( justLoggedIn: false, ) @@ -89,27 +90,21 @@ class _HomeScreenState extends ConsumerState { elevation: 0, showSelectedLabels: false, showUnselectedLabels: false, - unselectedItemColor: Colors.white, - selectedItemColor: Colors.white, + unselectedItemColor: Colors.blue, + selectedItemColor: Colors.blue, items: [ BottomNavigationBarItem( backgroundColor: Colors.transparent, - activeIcon: Icon(Icons.home), - icon: Icon(Icons.home_outlined), + activeIcon: Icon(Icons.home,), + icon: Icon(Icons.home_outlined,), label: "Home", ), - BottomNavigationBarItem( - backgroundColor: Colors.transparent, - icon: Icon(Icons.people_outline), - activeIcon: Icon(Icons.people_rounded), - label: "Library", - ), if(user.isStudent) ...[ BottomNavigationBarItem( backgroundColor: Colors.transparent, - activeIcon: Icon(Icons.calendar_today), - icon: Icon(Icons.calendar_today_outlined), - label: "Time Table", + activeIcon: Icon(Icons.notes), + icon: Icon(Icons.notes_outlined), + label: "Notes", ), BottomNavigationBarItem( backgroundColor: Colors.transparent, diff --git a/lib/new_ui/screens/notes_screen/notes_screen.dart b/lib/new_ui/screens/notes_screen/notes_screen.dart index 80f367bd..77a17fe4 100644 --- a/lib/new_ui/screens/notes_screen/notes_screen.dart +++ b/lib/new_ui/screens/notes_screen/notes_screen.dart @@ -1,6 +1,4 @@ -import 'dart:collection'; import 'dart:ui'; - import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -188,13 +186,13 @@ class _NotesScreenState extends ConsumerState { child: CustomScrollView( slivers: [ SliverAppBar( - leading: _buildNavigation( + /*leading: _buildNavigation( context, icon: const Icon(Icons.chevron_left_rounded), onPressed: () { GoRouter.of(context).pop(); }, - ), + ),*/ backgroundColor: Colors.transparent, floating: false, pinned: false, diff --git a/lib/new_ui/screens/railway_screen/railway_screen.dart b/lib/new_ui/screens/railway_screen/railway_screen.dart index fa78c1c9..fd864154 100644 --- a/lib/new_ui/screens/railway_screen/railway_screen.dart +++ b/lib/new_ui/screens/railway_screen/railway_screen.dart @@ -825,30 +825,41 @@ class _RailwayConcessionScreenState ? Padding( padding: const EdgeInsets.all(8.0), child: Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, children: [ - FilledButton( - onPressed: () { - ref - .read(railwayConcessionOpenProvider.state) - .state = true; - }, - style: FilledButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 10.0), // Set the border radius - ), + SizedBox( + width: 10, + ), + Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow(color: Theme.of(context).colorScheme.tertiaryContainer,blurRadius: 5,spreadRadius: 3) + ], ), - child: Padding( - padding: - const EdgeInsets.fromLTRB(22, 12, 22, 12), - child: Text('Apply', - style: Theme.of(context) - .textTheme - .headlineMedium! - .copyWith( - color: Colors.black, - )), + child: FilledButton( + onPressed: () { + ref + .read(railwayConcessionOpenProvider.state) + .state = true; + }, + style: FilledButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 10.0), // Set the border radius + ), + backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, + ), + child: Padding( + padding: + const EdgeInsets.fromLTRB(22, 12, 22, 12), + child: Text('Apply', + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + color: Colors.white, + )), + ), ), ), ], diff --git a/lib/new_ui/screens/railway_screen/widgets/concession_status_modal.dart b/lib/new_ui/screens/railway_screen/widgets/concession_status_modal.dart index ad0f47f9..4e8bda5b 100644 --- a/lib/new_ui/screens/railway_screen/widgets/concession_status_modal.dart +++ b/lib/new_ui/screens/railway_screen/widgets/concession_status_modal.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:tsec_app/models/concession_details_model/concession_details_model.dart'; import 'package:tsec_app/provider/concession_provider.dart'; import 'package:tsec_app/utils/railway_enum.dart'; @@ -44,6 +45,9 @@ class _ConcessionStatusModalState extends ConsumerState { height: 50, width: size.width*0.6, decoration: BoxDecoration( + boxShadow: [ + BoxShadow(color: Colors.green.shade400,spreadRadius: 3,blurRadius: 5), + ], color: concessionDetails?.status == ConcessionStatus.rejected ? Theme.of(context).colorScheme.error : widget.canIssuePass(concessionDetails, lastPassIssued, duration) @@ -57,7 +61,8 @@ class _ConcessionStatusModalState extends ConsumerState { child: Padding( padding: const EdgeInsets.all(8.0), child: Text( - "Status : ${concessionDetails?.status == ConcessionStatus.rejected + concessionDetails?.status != null ? getStatusText(concessionDetails!.status) : "", + /*"Status : ${concessionDetails?.status == ConcessionStatus.rejected ? "Rejected" : concessionDetails?.status == ConcessionStatus.unserviced @@ -65,7 +70,7 @@ class _ConcessionStatusModalState extends ConsumerState { : widget.canIssuePass( concessionDetails, lastPassIssued, duration) ? "Can apply" - : ""}", + : ""}",*/ style: Theme.of(context).textTheme.headlineSmall!.copyWith( color: Colors.black, fontWeight: FontWeight.w600, @@ -75,4 +80,13 @@ class _ConcessionStatusModalState extends ConsumerState { ), ); } + + String getStatusText(String status){ + if(status == ConcessionStatus.rejected){ + return "Sorry Cnncession Rejected"; + }else if(status == ConcessionStatus.unserviced){ + return "Pending"; + } + return "You can apply for new pass"; + } } diff --git a/lib/screens/departmentlist_screen/department_list.dart b/lib/screens/departmentlist_screen/department_list.dart index 9c4949ed..2c6a6093 100644 --- a/lib/screens/departmentlist_screen/department_list.dart +++ b/lib/screens/departmentlist_screen/department_list.dart @@ -24,41 +24,42 @@ class DepartmentList extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( + return const Scaffold( appBar: CommonAppbar(), body: SingleChildScrollView( + physics: BouncingScrollPhysics(), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( + /*Padding( padding: const EdgeInsets.all(8.0), child: Text("Department", style: Theme.of(context).textTheme.titleLarge), - ), - const DeptWidget( + ),*/ + DeptWidget( image: "aids", department: DepartmentEnum.aids, ), - const DeptWidget( + DeptWidget( image: "extc", department: DepartmentEnum.extc, ), - const DeptWidget( + DeptWidget( image: "cs", department: DepartmentEnum.cs, ), - const DeptWidget( + DeptWidget( image: "it", department: DepartmentEnum.it, ), - const DeptWidget( + DeptWidget( image: "biomed", department: DepartmentEnum.biomed, ), - const DeptWidget( + DeptWidget( image: "biotech", department: DepartmentEnum.biotech, ), - const DeptWidget( + DeptWidget( image: "chem", department: DepartmentEnum.chem, ), diff --git a/lib/screens/notification_screen/notification_screen.dart b/lib/screens/notification_screen/notification_screen.dart index 64fe4dc0..ad1d9836 100644 --- a/lib/screens/notification_screen/notification_screen.dart +++ b/lib/screens/notification_screen/notification_screen.dart @@ -34,7 +34,7 @@ class _NotificationScreenState extends State { title: "Notifications", image: Image.asset(ImageAssets.committes), ), - ) + ), ], body: Column(), /*body: FirestoreListView( query: locator()