UI_BUGFIX
This commit is contained in:
parent
cb82278834
commit
705731d2ab
@ -32,7 +32,6 @@ import 'package:nhance_app_pwa/pages/session/SetPinBiometric.dart';
|
||||
import 'package:nhance_app_pwa/pages/session/changePin.dart';
|
||||
import 'package:nhance_app_pwa/pages/session/settingUpPinAndBiometric.dart';
|
||||
|
||||
|
||||
import 'package:nhance_app_pwa/pages/verify.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'models/environment.dart';
|
||||
@ -61,12 +60,10 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
final isMpinSkipped = prefs.getString('is_mpin_skipped');
|
||||
|
||||
if (isMpinSkipped == '0') {
|
||||
if (mounted) context.go('/pinPage');
|
||||
if (mounted) context.go('/pinPage');
|
||||
} else {
|
||||
if (mounted) context.go('/login');
|
||||
if (mounted) context.go('/login');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -82,7 +79,6 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Middleware logic for tokens + mpin
|
||||
Future<String?> tokenRedirectLogic(
|
||||
BuildContext context, GoRouterState state) async {
|
||||
@ -110,7 +106,8 @@ Future<String?> tokenRedirectLogic(
|
||||
await SessionManager().clear();
|
||||
// Show toast once
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
ToastHelper.showErrorToast(context, 'Session expired. Please login again.');
|
||||
ToastHelper.showErrorToast(
|
||||
context, 'Session expired. Please login again.');
|
||||
});
|
||||
return '/login';
|
||||
}
|
||||
@ -192,7 +189,8 @@ Future<void> main() async {
|
||||
final router = GoRouter(
|
||||
initialLocation: initialLocation,
|
||||
routes: [
|
||||
GoRoute(path: '/splash', builder: (context, state) => const SplashScreen()),
|
||||
GoRoute(
|
||||
path: '/splash', builder: (context, state) => const SplashScreen()),
|
||||
GoRoute(path: '/login', builder: (context, state) => login()),
|
||||
// GoRoute(
|
||||
// path: '/verify',
|
||||
@ -241,7 +239,9 @@ Future<void> main() async {
|
||||
// ),
|
||||
// GoRoute(path: '/mailVerify', builder: (context, state) => MyEmailVerify(email: '')),
|
||||
GoRoute(path: '/pinPage', builder: (context, state) => pinPage()),
|
||||
GoRoute(path: '/pinSettingPage', builder: (context, state) => pinSettingPage()),
|
||||
GoRoute(
|
||||
path: '/pinSettingPage',
|
||||
builder: (context, state) => pinSettingPage()),
|
||||
GoRoute(
|
||||
path: '/changePin',
|
||||
builder: (context, state) => changePin(),
|
||||
@ -249,24 +249,31 @@ Future<void> main() async {
|
||||
GoRoute(path: '/home', builder: (context, state) => Home()),
|
||||
GoRoute(path: '/profile', builder: (context, state) => profile()),
|
||||
GoRoute(path: '/help', builder: (context, state) => help()),
|
||||
GoRoute(path: '/claimprocess', builder: (context, state) => claimprocess()),
|
||||
GoRoute(
|
||||
path: '/claimprocess', builder: (context, state) => claimprocess()),
|
||||
GoRoute(path: '/wellness', builder: (context, state) => wellness()),
|
||||
GoRoute(path: '/privacypolicy', builder: (context, state) => privacypolicy()),
|
||||
GoRoute(
|
||||
path: '/privacypolicy', builder: (context, state) => privacypolicy()),
|
||||
GoRoute(path: '/termsofuse', builder: (context, state) => termsofuse()),
|
||||
GoRoute(path: '/generalExclusionsDeductibles', builder: (context, state) => generalExclusionsDeductibles()),
|
||||
GoRoute(path: '/raisedTicketHistory', builder: (context, state) => raisedTicketHistory()),
|
||||
GoRoute(
|
||||
path: '/generalExclusionsDeductibles',
|
||||
builder: (context, state) => generalExclusionsDeductibles()),
|
||||
GoRoute(
|
||||
path: '/raisedTicketHistory',
|
||||
builder: (context, state) => raisedTicketHistory()),
|
||||
GoRoute(path: '/tickets', builder: (context, state) => tickets()),
|
||||
GoRoute(
|
||||
path: '/policies',
|
||||
builder: (context, state) {
|
||||
final arguments = state.extra as Map<String, dynamic>?; // 👈 receive here
|
||||
final arguments =
|
||||
state.extra as Map<String, dynamic>?; // 👈 receive here
|
||||
return policies(arguments: arguments);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: '/claims',
|
||||
builder: (context, state) {
|
||||
final int tabIndex = state.extra as int? ?? 1 ; // default to 0
|
||||
final int tabIndex = state.extra as int? ?? 0; // default to 0
|
||||
return claims(initialTab: tabIndex);
|
||||
},
|
||||
),
|
||||
@ -284,14 +291,20 @@ Future<void> main() async {
|
||||
return tickettracklist(ticketID: ticketID);
|
||||
},
|
||||
),
|
||||
GoRoute(path: '/empDetails',builder:(context,state) => empDetails(),),
|
||||
GoRoute(path: '/addOnsDetails', builder: (context, state) => addOnsDetails()),
|
||||
GoRoute(path: '/empReviewDetails', builder: (context, state) => empReviewDetails()),
|
||||
GoRoute(
|
||||
path: '/empDetails',
|
||||
builder: (context, state) => empDetails(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/addOnsDetails', builder: (context, state) => addOnsDetails()),
|
||||
GoRoute(
|
||||
path: '/empReviewDetails',
|
||||
builder: (context, state) => empReviewDetails()),
|
||||
],
|
||||
|
||||
// ✅ Middleware hook
|
||||
redirect: (context, state) async =>
|
||||
await tokenRedirectLogic(context, state),
|
||||
await tokenRedirectLogic(context, state),
|
||||
);
|
||||
// ✅ Load API data once at startup
|
||||
// runApp(
|
||||
@ -323,11 +336,10 @@ class _MyAppState extends State<MyApp> {
|
||||
super.initState();
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final apiService = ApiService(context);
|
||||
DataManager().init(apiService);
|
||||
DataManager().loadAdvertisementImages();
|
||||
final apiService = ApiService(context);
|
||||
DataManager().init(apiService);
|
||||
DataManager().loadAdvertisementImages();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -674,7 +674,20 @@ class _loginState extends State<login> {
|
||||
SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 40,
|
||||
child: TextField(
|
||||
// child: TextField(
|
||||
// controller:
|
||||
// countryController,
|
||||
// keyboardType:
|
||||
// TextInputType
|
||||
// .number,
|
||||
// decoration:
|
||||
// InputDecoration(
|
||||
// border:
|
||||
// InputBorder
|
||||
// .none,
|
||||
// ),
|
||||
// ),
|
||||
child: TextFormField(
|
||||
controller:
|
||||
countryController,
|
||||
keyboardType:
|
||||
@ -686,6 +699,23 @@ class _loginState extends State<login> {
|
||||
InputBorder
|
||||
.none,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value ==
|
||||
null ||
|
||||
value
|
||||
.isEmpty) {
|
||||
return 'Required';
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter
|
||||
.allow(RegExp(
|
||||
r'[0-9+]')),
|
||||
LengthLimitingTextInputFormatter(
|
||||
3),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -93,7 +93,7 @@ class _claimsState extends State<claims> {
|
||||
trackClaimsActive = 0;
|
||||
yourPlanActive = 1;
|
||||
isActive = false;
|
||||
} else if(arguments == 2){
|
||||
} else if (arguments == 2) {
|
||||
print(arguments);
|
||||
trackClaimsActive = 0;
|
||||
yourPlanActive = 1;
|
||||
@ -250,378 +250,413 @@ class _claimsState extends State<claims> {
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
if (didPop) return;
|
||||
if(widget.initialTab == 2){
|
||||
if (widget.initialTab == 2) {
|
||||
context.go('/home');
|
||||
} else {
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.03, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Column(children: [
|
||||
Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if(widget.initialTab == 2){
|
||||
context.go('/home');
|
||||
} else {
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_left, // Replace with your desired icon
|
||||
color: Color(0xFF000000),
|
||||
size: 30,
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
5), // Adjust space between icon and text
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Claims assistance',
|
||||
textAlign: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Manage your claims',
|
||||
textAlign: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12, // Adjust the font size as needed
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Add more rows as needed
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.push('/help');
|
||||
},
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: Color(0xFFD9D9D9), // Set the border color here
|
||||
width: 1.0, // Set the border width here
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
8.0), // Set the border radius here
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.03, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Column(children: [
|
||||
Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Set background color for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 11,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
print("CACLAIMS - ${widget.initialTab}");
|
||||
if (widget.initialTab == 2) {
|
||||
context.go('/home');
|
||||
}
|
||||
if (widget.initialTab == 0) {
|
||||
context.go('/home');
|
||||
} else {
|
||||
context.pop();
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.string(
|
||||
SvgService.getSvg('contactUs'),
|
||||
width: 25,
|
||||
height: 25,
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_left, // Replace with your desired icon
|
||||
color: Color(0xFF000000),
|
||||
size: 30,
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
7), // Adjust space between icon and text
|
||||
Text(
|
||||
'Contact Us',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
5), // Adjust space between icon and text
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Claims Assistance',
|
||||
textAlign: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Manage your claims',
|
||||
textAlign: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12, // Adjust the font size as needed
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_right, // Replace with your desired icon
|
||||
color: Color(0xFFE26728),
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Add more rows as needed
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.go('/claimprocess');
|
||||
},
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: Color(0xFFD9D9D9), // Set the border color here
|
||||
width: 1.0, // Set the border width here
|
||||
SizedBox(height: 15),
|
||||
MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.push('/help');
|
||||
},
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color: Color(0xFFD9D9D9), // Set the border color here
|
||||
width: 1.0, // Set the border width here
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
8.0), // Set the border radius here
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Set background color for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 11,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.string(
|
||||
SvgService.getSvg('contactUs'),
|
||||
width: 25,
|
||||
height: 25,
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
7), // Adjust space between icon and text
|
||||
Text(
|
||||
'Contact Us',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_right, // Replace with your desired icon
|
||||
color: Color(0xFFE26728),
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
8.0), // Set the border radius here
|
||||
),
|
||||
child: Column(children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Set background color for the container
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.go('/claimprocess');
|
||||
},
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
color:
|
||||
Color(0xFFD9D9D9), // Set the border color here
|
||||
width: 1.0, // Set the border width here
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
8.0), // Set the border radius here
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 11,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.string(
|
||||
SvgService.getSvg('fileClaims'),
|
||||
width: 25,
|
||||
height: 25,
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
7), // Adjust space between icon and text
|
||||
Text(
|
||||
'Know how to file a claim',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors
|
||||
.white, // Set background color for the container
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_right, // Replace with your desired icon
|
||||
color: Color(0xFFE26728),
|
||||
size: 20,
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 11,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.string(
|
||||
SvgService.getSvg('fileClaims'),
|
||||
width: 25,
|
||||
height: 25,
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
7), // Adjust space between icon and text
|
||||
Text(
|
||||
'Know how to file a claim',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.chevron_right, // Replace with your desired icon
|
||||
color: Color(0xFFE26728),
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
])),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Color(0xFFF6FAFF), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
5), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(top: 10, bottom: 10, left: 25, right: 25)
|
||||
: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
),
|
||||
])),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(
|
||||
0xFFF6FAFF), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
5), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 25, right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isActive = true;
|
||||
// policyList.clear();
|
||||
yourPlanActive = 0;
|
||||
trackClaimsActive = 1;
|
||||
});
|
||||
getActiveAndInactivePolicyDetails();
|
||||
},
|
||||
child: isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 140
|
||||
: 50,
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 15
|
||||
: 5),
|
||||
// primary: Color(0xFF000000),
|
||||
),
|
||||
child: Text(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isActive = true;
|
||||
// policyList.clear();
|
||||
yourPlanActive = 0;
|
||||
trackClaimsActive = 1;
|
||||
});
|
||||
getActiveAndInactivePolicyDetails();
|
||||
},
|
||||
child: isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
10),
|
||||
color: Colors.white,
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton
|
||||
.styleFrom(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 140
|
||||
: 50,
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 15
|
||||
: 5),
|
||||
// primary: Color(0xFF000000),
|
||||
),
|
||||
child: Text(
|
||||
'Your Plan',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w500,
|
||||
color: Color(
|
||||
0xFF000000)),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Your Plan',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
color: Color(
|
||||
0xFF000000)),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Your Plan',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isActive = false;
|
||||
// trackClaimsList.clear();
|
||||
yourPlanActive = 1;
|
||||
trackClaimsActive = 0;
|
||||
});
|
||||
getTrackClaimsList();
|
||||
},
|
||||
child: !isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 130
|
||||
: 30,
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 15
|
||||
: 5),
|
||||
// primary: Color(0xFF000000),
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
color:
|
||||
Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isActive = false;
|
||||
// trackClaimsList.clear();
|
||||
yourPlanActive = 1;
|
||||
trackClaimsActive = 0;
|
||||
});
|
||||
getTrackClaimsList();
|
||||
},
|
||||
child: !isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
10),
|
||||
color: Colors.white,
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton
|
||||
.styleFrom(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 130
|
||||
: 30,
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 15
|
||||
: 5),
|
||||
// primary: Color(0xFF000000),
|
||||
),
|
||||
child: Text(
|
||||
'Track claims',
|
||||
style: GoogleFonts
|
||||
.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
color: Color(
|
||||
0xFF000000),
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Track claims',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
@ -630,127 +665,112 @@ class _claimsState extends State<claims> {
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
color:
|
||||
Color(0xFF000000),
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
FontWeight.w400,
|
||||
color:
|
||||
Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Track claims',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
),
|
||||
))
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
))),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
if (policyList != null && policyList.length > 0)
|
||||
if (yourPlanActive == 0)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
...generateYourPlanList(policyList),
|
||||
],
|
||||
),
|
||||
if (trackClaimsList != null && trackClaimsList.length > 0)
|
||||
if (trackClaimsActive == 0)
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: generateTrackList(trackClaimsList),
|
||||
))),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
|
||||
SizedBox(height: 15),
|
||||
if (policyList != null && policyList.length > 0)
|
||||
if (yourPlanActive == 0)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
...generateYourPlanList(policyList),
|
||||
],
|
||||
),
|
||||
if (trackClaimsList != null && trackClaimsList.length > 0)
|
||||
if (trackClaimsActive == 0)
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: generateTrackList(trackClaimsList),
|
||||
),
|
||||
),
|
||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
|
||||
]),
|
||||
)),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
height: 60,
|
||||
width: 60,
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
)),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
height: 60,
|
||||
width: 60,
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
// floatingActionButton: Responsive.isDesktop(context)
|
||||
// ? null
|
||||
// : FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.pushNamed(context, 'chatbot');
|
||||
// },
|
||||
// child: Icon(Icons.chat),
|
||||
// ),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// Add your navigation logic here
|
||||
// For example:
|
||||
if (index == 0) {
|
||||
context.push('/home');
|
||||
} else if (index == 1) {
|
||||
context.push('/claims');
|
||||
} else if (index == 2) {
|
||||
context.push('/profile');
|
||||
} else if (index == 3) {
|
||||
context.push('/help');
|
||||
} else if (index == 4) {
|
||||
// Wellness tab clicked → show popup
|
||||
PopupHelper.showRedirectPopup(
|
||||
context: context,
|
||||
apiService: apiService,
|
||||
empPrimaryId: session.empPrimaryId,
|
||||
);
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
Icons.health_and_safety_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claims",
|
||||
"Profile",
|
||||
"Help",
|
||||
"Wellness",
|
||||
],
|
||||
initialIndex: 1, // Initial index of the bottom navigation bar
|
||||
),
|
||||
)
|
||||
);
|
||||
// floatingActionButton: Responsive.isDesktop(context)
|
||||
// ? null
|
||||
// : FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.pushNamed(context, 'chatbot');
|
||||
// },
|
||||
// child: Icon(Icons.chat),
|
||||
// ),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// Add your navigation logic here
|
||||
// For example:
|
||||
if (index == 0) {
|
||||
context.push('/home');
|
||||
} else if (index == 1) {
|
||||
context.push('/claims');
|
||||
} else if (index == 2) {
|
||||
context.push('/profile');
|
||||
} else if (index == 3) {
|
||||
context.push('/help');
|
||||
} else if (index == 4) {
|
||||
// Wellness tab clicked → show popup
|
||||
PopupHelper.showRedirectPopup(
|
||||
context: context,
|
||||
apiService: apiService,
|
||||
empPrimaryId: session.empPrimaryId,
|
||||
);
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
Icons.health_and_safety_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claims",
|
||||
"Profile",
|
||||
"Help",
|
||||
"Wellness",
|
||||
],
|
||||
initialIndex: 1, // Initial index of the bottom navigation bar
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
List<Widget> generateYourPlanList(List<dynamic> data) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'dart:html' as html;
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -30,10 +31,10 @@ import 'chatbot.dart';
|
||||
// import 'dart:html' as html;
|
||||
|
||||
import '/pages/helpers/botman_stub.dart'
|
||||
if (dart.library.html) '/pages/helpers/botman_web.dart';
|
||||
if (dart.library.html) '/pages/helpers/botman_web.dart';
|
||||
|
||||
import '/../pages/helpers/mobile_helpers.dart'
|
||||
if (dart.library.html) '/../pages/helpers/web_helpers.dart';
|
||||
if (dart.library.html) '/../pages/helpers/web_helpers.dart';
|
||||
import 'package:webview_flutter_android/webview_flutter_android.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
@ -45,6 +46,7 @@ class Home extends StatefulWidget {
|
||||
|
||||
class _HomeState extends State<Home> {
|
||||
bool _dialogShown = false;
|
||||
late StreamSubscription<html.PopStateEvent> _popStateListener;
|
||||
bool isLoadingGif = false;
|
||||
late ApiService apiService;
|
||||
int _currentIndex = 0;
|
||||
@ -60,7 +62,7 @@ class _HomeState extends State<Home> {
|
||||
dynamic policyHeading;
|
||||
dynamic policyName;
|
||||
dynamic EmployeePolicy;
|
||||
dynamic emp_name;
|
||||
dynamic emp_name = '';
|
||||
dynamic pre_policy_count;
|
||||
dynamic client_branch_id;
|
||||
dynamic mobileNo;
|
||||
@ -86,42 +88,37 @@ class _HomeState extends State<Home> {
|
||||
_loadToken();
|
||||
checkEnrollToken();
|
||||
|
||||
// 🔹 Load ads
|
||||
// dataManager.loadAdvertisementImages();
|
||||
if(kIsWeb){
|
||||
// 🔹 Load ads
|
||||
// dataManager.loadAdvertisementImages();
|
||||
if (kIsWeb) {
|
||||
getAdvertisementSliderImage();
|
||||
} else {
|
||||
advertisementImages = DataManager().advertisementImages;
|
||||
}
|
||||
|
||||
print('starts');
|
||||
print(advertisementImages);
|
||||
print('Ends');
|
||||
|
||||
// // 🔹 Load policies (Active ones)
|
||||
activePoliciesDetails = dataManager.loadPolicies(
|
||||
clientId: session.client_id,
|
||||
empCode: session.empCodeString,
|
||||
status: "Active",
|
||||
clientBranchId: session.empClientBranchId,
|
||||
mobileNo: session.mobileNo,
|
||||
);
|
||||
|
||||
print('activePoliciesDetails');
|
||||
print(activePoliciesDetails);
|
||||
|
||||
// 🔹 Load self employee profile
|
||||
dataManager.loadSelfEmployeeProfile(
|
||||
clientId: session.client_id!,
|
||||
empCode: session.empCodeString!,
|
||||
clientBranchId: session.empClientBranchId!,
|
||||
);
|
||||
print('loadSelfEmployeeProfile');
|
||||
|
||||
|
||||
print('starts');
|
||||
print(advertisementImages);
|
||||
print('Ends');
|
||||
|
||||
// // 🔹 Load policies (Active ones)
|
||||
activePoliciesDetails = dataManager.loadPolicies(
|
||||
clientId: session.client_id,
|
||||
empCode: session.empCodeString,
|
||||
status: "Active",
|
||||
clientBranchId: session.empClientBranchId,
|
||||
mobileNo: session.mobileNo,
|
||||
);
|
||||
|
||||
print('activePoliciesDetails');
|
||||
print(activePoliciesDetails);
|
||||
|
||||
// 🔹 Load self employee profile
|
||||
dataManager.loadSelfEmployeeProfile(
|
||||
clientId: session.client_id!,
|
||||
empCode: session.empCodeString!,
|
||||
clientBranchId: session.empClientBranchId!,
|
||||
);
|
||||
print('loadSelfEmployeeProfile');
|
||||
|
||||
// if (kIsWeb) {
|
||||
// openBotmanChat();
|
||||
@ -189,6 +186,9 @@ class _HomeState extends State<Home> {
|
||||
final preToken = TokenService.getPreToken();
|
||||
print('preToken');
|
||||
print(preToken);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
checkbackbutton();
|
||||
});
|
||||
setState(() {
|
||||
isTokenAvailable = preToken != null;
|
||||
});
|
||||
@ -314,7 +314,7 @@ class _HomeState extends State<Home> {
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
final random = Random.secure();
|
||||
return List.generate(
|
||||
length, (index) => characters[random.nextInt(characters.length)])
|
||||
length, (index) => characters[random.nextInt(characters.length)])
|
||||
.join();
|
||||
}
|
||||
|
||||
@ -352,11 +352,11 @@ class _HomeState extends State<Home> {
|
||||
actions: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly, // Space buttons evenly
|
||||
MainAxisAlignment.spaceEvenly, // Space buttons evenly
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
child: TextButton(
|
||||
onPressed: () => Navigator.pop(dialogContext),
|
||||
style: TextButton.styleFrom(
|
||||
@ -379,7 +379,7 @@ class _HomeState extends State<Home> {
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
MediaQuery.of(context).size.width * 0.3, // Set button width
|
||||
child: TextButton(
|
||||
onPressed: () => TokenService().logout(context),
|
||||
style: TextButton.styleFrom(
|
||||
@ -411,9 +411,22 @@ class _HomeState extends State<Home> {
|
||||
);
|
||||
}
|
||||
|
||||
void checkbackbutton() async {
|
||||
// Push a dummy state so back button triggers popstate instead of navigating
|
||||
html.window.history.pushState(null, 'home', html.window.location.href);
|
||||
|
||||
_popStateListener = html.window.onPopState.listen((event) {
|
||||
if (!_dialogShown && mounted) {
|
||||
_showBackConfirmationDialog();
|
||||
}
|
||||
|
||||
// Re-push to prevent leaving
|
||||
html.window.history.pushState(null, 'home', html.window.location.href);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
if (!Responsive.isDesktop(context))
|
||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||
statusBarColor: Color(0xFFFFFBDE), // Status bar color
|
||||
@ -421,23 +434,27 @@ class _HomeState extends State<Home> {
|
||||
));
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
_showExitConfirmation(context);
|
||||
},
|
||||
// onPopInvokedWithResult: (didPop, result) {
|
||||
// if (didPop) return;
|
||||
// _showExitConfirmation(context);
|
||||
// },
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.03, // 5% of screen height as vertical padding
|
||||
)
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.03, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(15),
|
||||
color: Colors.white,
|
||||
child: Column(children: [
|
||||
@ -459,9 +476,10 @@ class _HomeState extends State<Home> {
|
||||
'Hello, $emp_name!',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(context)
|
||||
? 20
|
||||
: 20,
|
||||
fontSize:
|
||||
Responsive.isDesktop(context)
|
||||
? 20
|
||||
: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
@ -489,7 +507,7 @@ class _HomeState extends State<Home> {
|
||||
color: Color(0xFFDDF3FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10), // Set the border radius here
|
||||
BorderRadius.circular(10), // Set the border radius here
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
@ -505,9 +523,9 @@ class _HomeState extends State<Home> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10)
|
||||
top: 10, bottom: 10, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@ -520,8 +538,9 @@ class _HomeState extends State<Home> {
|
||||
'Policies for enrollment : $pre_policy_count',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(context) ? 18 : 12,
|
||||
fontSize: Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF404040),
|
||||
),
|
||||
@ -537,8 +556,8 @@ class _HomeState extends State<Home> {
|
||||
ElevatedButton(
|
||||
onPressed: isTokenAvailable
|
||||
? () {
|
||||
context.go('/empDetails');
|
||||
}
|
||||
context.go('/empDetails');
|
||||
}
|
||||
: null,
|
||||
child: Text('View Details'),
|
||||
),
|
||||
@ -565,84 +584,84 @@ class _HomeState extends State<Home> {
|
||||
child: advertisementImages.isEmpty
|
||||
? Center(child: Text("No images available"))
|
||||
: Container(
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: ImageSlideshow(
|
||||
/// Width of the [ImageSlideshow].
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: ImageSlideshow(
|
||||
/// Width of the [ImageSlideshow].
|
||||
width: double.infinity,
|
||||
|
||||
/// Height of the [ImageSlideshow].
|
||||
height:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 200
|
||||
: 150,
|
||||
/// Height of the [ImageSlideshow].
|
||||
height:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 200
|
||||
: 150,
|
||||
|
||||
/// The page to show when first creating the [ImageSlideshow].
|
||||
initialPage: 0,
|
||||
/// The page to show when first creating the [ImageSlideshow].
|
||||
initialPage: 0,
|
||||
|
||||
/// The color to paint the indicator.
|
||||
indicatorColor:
|
||||
Color(0xFFE26728),
|
||||
/// The color to paint the indicator.
|
||||
indicatorColor:
|
||||
Color(0xFFE26728),
|
||||
|
||||
/// The color to paint behind the indicator.
|
||||
indicatorBackgroundColor:
|
||||
Colors.grey,
|
||||
/// The color to paint behind the indicator.
|
||||
indicatorBackgroundColor:
|
||||
Colors.grey,
|
||||
|
||||
/// The widgets to display in the [ImageSlideshow].
|
||||
children:
|
||||
advertisementImages
|
||||
.map(
|
||||
(imageUrl) =>
|
||||
ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
8),
|
||||
child: Image
|
||||
.network(
|
||||
imageUrl,
|
||||
fit: BoxFit
|
||||
.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
/// The widgets to display in the [ImageSlideshow].
|
||||
children:
|
||||
advertisementImages
|
||||
.map(
|
||||
(imageUrl) =>
|
||||
ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
8),
|
||||
child: Image
|
||||
.network(
|
||||
imageUrl,
|
||||
fit: BoxFit
|
||||
.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
||||
/// Called whenever the page in the center of the viewport changes.
|
||||
onPageChanged: (value) {
|
||||
print(
|
||||
'Page changed: $value');
|
||||
},
|
||||
/// Called whenever the page in the center of the viewport changes.
|
||||
onPageChanged: (value) {
|
||||
print(
|
||||
'Page changed: $value');
|
||||
},
|
||||
|
||||
/// Auto scroll interval.
|
||||
/// Do not auto scroll with null or 0.
|
||||
autoPlayInterval: 3000,
|
||||
/// Auto scroll interval.
|
||||
/// Do not auto scroll with null or 0.
|
||||
autoPlayInterval: 3000,
|
||||
|
||||
/// Loops back to the first slide.
|
||||
isLoop: true,
|
||||
/// Loops back to the first slide.
|
||||
isLoop: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -667,9 +686,10 @@ class _HomeState extends State<Home> {
|
||||
'Your Policies',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 18,
|
||||
fontSize:
|
||||
Responsive.isDesktop(context)
|
||||
? 18
|
||||
: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
@ -694,14 +714,16 @@ class _HomeState extends State<Home> {
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Color(0xFFEEF5FF), // Set background color for the container
|
||||
color: Color(
|
||||
0xFFEEF5FF), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
5), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(top: 10, bottom: 10, left: 25, right: 25)
|
||||
: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10),
|
||||
? EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 25, right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@ -731,58 +753,64 @@ class _HomeState extends State<Home> {
|
||||
},
|
||||
child: isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
child: SizedBox(
|
||||
width: Responsive.isDesktop(
|
||||
context)
|
||||
? 400
|
||||
: 150, // Set the width here
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style:
|
||||
TextButton.styleFrom(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 12
|
||||
: 5,
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
10),
|
||||
color: Colors.white,
|
||||
child: SizedBox(
|
||||
width: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 400
|
||||
: 150, // Set the width here
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton
|
||||
.styleFrom(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 12
|
||||
: 5,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Active',
|
||||
style: GoogleFonts
|
||||
.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w500,
|
||||
color: Color(
|
||||
0xFF593AFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
)
|
||||
: Text(
|
||||
'Active',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
FontWeight.w400,
|
||||
color:
|
||||
Color(0xFF593AFF),
|
||||
Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Active',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
@ -800,58 +828,64 @@ class _HomeState extends State<Home> {
|
||||
},
|
||||
child: !isActive
|
||||
? Material(
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
child: SizedBox(
|
||||
width: Responsive.isDesktop(
|
||||
context)
|
||||
? 400
|
||||
: 150, // Set the width here
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style:
|
||||
TextButton.styleFrom(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 12
|
||||
: 5,
|
||||
elevation: 5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
10),
|
||||
color: Colors.white,
|
||||
child: SizedBox(
|
||||
width: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 400
|
||||
: 150, // Set the width here
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton
|
||||
.styleFrom(
|
||||
padding: EdgeInsets
|
||||
.symmetric(
|
||||
vertical: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 12
|
||||
: 5,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Inactive',
|
||||
style: GoogleFonts
|
||||
.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w500,
|
||||
color: Color(
|
||||
0xFF593AFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
)
|
||||
: Text(
|
||||
'Inactive',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
FontWeight.w400,
|
||||
color:
|
||||
Color(0xFF593AFF),
|
||||
Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Inactive',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF636363),
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
],
|
||||
@ -1070,7 +1104,7 @@ class _HomeState extends State<Home> {
|
||||
onTap: () {
|
||||
context.go(
|
||||
'/policies',
|
||||
extra: item, // 👈 pass arguments here
|
||||
extra: item, // 👈 pass arguments here
|
||||
);
|
||||
},
|
||||
child: MouseRegion(
|
||||
@ -1079,7 +1113,7 @@ class _HomeState extends State<Home> {
|
||||
elevation: 5,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(15.0), // Set border radius here
|
||||
BorderRadius.circular(15.0), // Set border radius here
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -1089,12 +1123,12 @@ class _HomeState extends State<Home> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 15, right: 15)
|
||||
top: 15, bottom: 15, left: 15, right: 15)
|
||||
: EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10), // Add padding to the container
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10), // Add padding to the container
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@ -1104,7 +1138,7 @@ class _HomeState extends State<Home> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
@ -1112,17 +1146,17 @@ class _HomeState extends State<Home> {
|
||||
flex: 7,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
policyHeading ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 10
|
||||
: 10,
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 10
|
||||
: 10,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF785EFF),
|
||||
),
|
||||
@ -1134,17 +1168,17 @@ class _HomeState extends State<Home> {
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Expires on $formattedDate',
|
||||
textAlign: TextAlign.right,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 10
|
||||
: 10,
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 10
|
||||
: 10,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF747474),
|
||||
),
|
||||
@ -1161,17 +1195,17 @@ class _HomeState extends State<Home> {
|
||||
flex: 6,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
policyName ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
@ -1183,7 +1217,7 @@ class _HomeState extends State<Home> {
|
||||
flex: 5,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
formatToCroresLakhsAndThousands(
|
||||
@ -1191,10 +1225,10 @@ class _HomeState extends State<Home> {
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
@ -1206,13 +1240,13 @@ class _HomeState extends State<Home> {
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment:
|
||||
Alignment.centerRight,
|
||||
Alignment.centerRight,
|
||||
child: Icon(
|
||||
Icons.chevron_right,
|
||||
color: Color(
|
||||
0xFFE26728), // Replace with your desired icon
|
||||
size: Responsive.isDesktop(
|
||||
context)
|
||||
context)
|
||||
? 30
|
||||
: 26,
|
||||
),
|
||||
@ -1222,28 +1256,67 @@ class _HomeState extends State<Home> {
|
||||
SizedBox(height: 7),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
memberNames ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFF000000),
|
||||
Flexible(
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Tooltip(
|
||||
message: '$memberNames',
|
||||
child: Text(
|
||||
memberNames ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 14
|
||||
: 13,
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
color: const Color(
|
||||
0xFF000000),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: Container(
|
||||
// color: Colors.red,
|
||||
// child: Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// memberNames ?? '',
|
||||
// textAlign: TextAlign.left,
|
||||
// style: GoogleFonts.poppins(
|
||||
// fontSize:
|
||||
// Responsive.isDesktop(
|
||||
// context)
|
||||
// ? 14
|
||||
// : 13,
|
||||
// fontWeight:
|
||||
// FontWeight.w400,
|
||||
// color: Color(0xFF000000),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 7),
|
||||
@ -1267,4 +1340,4 @@ class _HomeState extends State<Home> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1503,4 +1503,4 @@ SizedBox(height: 15),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1214,4 +1214,4 @@ class _policiesState extends State<policies> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -779,44 +779,17 @@ class _profileState extends State<profile> {
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Container(
|
||||
// color: Colors.amberAccent,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
width: 150,
|
||||
// height: Responsive.isDesktop(context) ? 150 : 100,
|
||||
alignment: Alignment.center,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
logout(context);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.logout,
|
||||
color: Color(0xFFE26728),
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
8), // Adjust space between icon and text
|
||||
Text(
|
||||
'Logout',
|
||||
style: GoogleFonts.poppins(
|
||||
color: Color(0xFFE26728)),
|
||||
),
|
||||
],
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
side: BorderSide(color: Color(0xFFE26728)),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
Responsive.isDesktop(context)
|
||||
? _buildLogoutButton(context)
|
||||
: Expanded(
|
||||
flex: 12, child: _buildLogoutButton(context)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -935,4 +908,31 @@ class _profileState extends State<profile> {
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildLogoutButton(BuildContext context) {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => logout(context),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
side: const BorderSide(color: Color(0xFFE26728)),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.logout, color: Color(0xFFE26728)),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Logout',
|
||||
style: GoogleFonts.poppins(color: const Color(0xFFE26728)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,7 +109,6 @@ class _ticketsState extends State<tickets> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> getActiveAndInactivePolicyDetails() async {
|
||||
if (client_id == null || empCodeString == null) {
|
||||
return;
|
||||
@ -213,8 +212,7 @@ class _ticketsState extends State<tickets> {
|
||||
print('Check One');
|
||||
Map<String, dynamic> formData = {
|
||||
'email': decodedToken?['email_corporate'],
|
||||
'empcode':
|
||||
decodedToken?['emp_code'],
|
||||
'empcode': decodedToken?['emp_code'],
|
||||
'message': messageController.text,
|
||||
'mobile': decodedToken?['mobile'],
|
||||
'name': decodedToken?['name'],
|
||||
@ -268,365 +266,377 @@ class _ticketsState extends State<tickets> {
|
||||
context.go('/help');
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.05, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Column(children: [
|
||||
Card(
|
||||
elevation: 5,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(15.0), // Set border radius here
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, // Set background color to white
|
||||
borderRadius: BorderRadius.circular(
|
||||
15.0), // Set border radius for Container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15)
|
||||
: EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10), // Add padding to the container
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(
|
||||
0xFFFFFCE5), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
10), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
left: 0,
|
||||
right: 0)
|
||||
: EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.go('/help');
|
||||
},
|
||||
child: Icon(
|
||||
Icons
|
||||
.chevron_left, // Replace with your desired icon
|
||||
color: Color(0xFF000000),
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 11,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
Responsive.isDesktop(context)
|
||||
? MainAxisAlignment.center
|
||||
: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Raise a Query',
|
||||
textAlign: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
), // Space between rows
|
||||
// Add more rows as needed
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: CustomAppBar(),
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: MediaQuery.of(context).size.width *
|
||||
0.2, // 30% of screen width as horizontal padding
|
||||
vertical: MediaQuery.of(context).size.height *
|
||||
0.05, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Column(children: [
|
||||
Card(
|
||||
elevation: 5,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(15.0), // Set border radius here
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, // Set background color to white
|
||||
borderRadius: BorderRadius.circular(
|
||||
15.0), // Set border radius for Container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 15, right: 15)
|
||||
: EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10), // Add padding to the container
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(
|
||||
0xFFFFFCE5), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
10), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
left: 0,
|
||||
right: 0)
|
||||
: EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Form(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildDropdownField<
|
||||
int>(
|
||||
'Type',
|
||||
(value) {
|
||||
setState(() {
|
||||
serviceId =
|
||||
value;
|
||||
selectedServiceName =
|
||||
serviceList
|
||||
.firstWhere(
|
||||
(serList) =>
|
||||
serList[
|
||||
'id'] ==
|
||||
value,
|
||||
orElse: () =>
|
||||
{
|
||||
'name': ''
|
||||
},
|
||||
)['name'];
|
||||
isServiceValid =
|
||||
true;
|
||||
});
|
||||
},
|
||||
false,
|
||||
serviceList,
|
||||
'name',
|
||||
serviceId,
|
||||
valueKey: 'id',
|
||||
),
|
||||
if (!isServiceValid)
|
||||
Text(
|
||||
'Please select a Service',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.red)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
if (selectedServiceName !=
|
||||
"Sales")
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildDropdownField<
|
||||
String>(
|
||||
'Policy Number',
|
||||
(value) {
|
||||
setState(() {
|
||||
policyNumberId =
|
||||
value;
|
||||
isPolicyValid =
|
||||
true;
|
||||
});
|
||||
},
|
||||
false,
|
||||
policyList,
|
||||
'policy_no',
|
||||
policyNumberId,
|
||||
valueKey:
|
||||
'policy_no',
|
||||
),
|
||||
if (!isPolicyValid)
|
||||
Text(
|
||||
'Please select a policy',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.red)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildTextField(
|
||||
'Subject',
|
||||
subjectController),
|
||||
if (!isSubjectValid)
|
||||
Text(
|
||||
'Please enter the Subject',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.red)),
|
||||
SizedBox(
|
||||
height: 15),
|
||||
buildTextAreaField(
|
||||
'Message',
|
||||
messageController),
|
||||
if (!isMessageValid)
|
||||
Text(
|
||||
'Please enter the Message',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.red)),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
sendFormDataToApi();
|
||||
},
|
||||
child: Text(
|
||||
'Send',
|
||||
style: GoogleFonts.poppins(
|
||||
color: Colors.white),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
Color(0xFFE26728),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
// flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
context.go('/help');
|
||||
},
|
||||
child: Icon(
|
||||
Icons
|
||||
.chevron_left, // Replace with your desired icon
|
||||
color: Color(0xFF000000),
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 11,
|
||||
child: Row(
|
||||
mainAxisAlignment: Responsive
|
||||
.isDesktop(context)
|
||||
? MainAxisAlignment.start
|
||||
: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Raise a Query',
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
color:
|
||||
Color(0xFF000000),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
), // Space between rows
|
||||
// Add more rows as needed
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Form(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildDropdownField<
|
||||
int>(
|
||||
'Type',
|
||||
(value) {
|
||||
setState(() {
|
||||
serviceId =
|
||||
value;
|
||||
selectedServiceName =
|
||||
serviceList
|
||||
.firstWhere(
|
||||
(serList) =>
|
||||
serList[
|
||||
'id'] ==
|
||||
value,
|
||||
orElse:
|
||||
() =>
|
||||
{
|
||||
'name':
|
||||
''
|
||||
},
|
||||
)['name'];
|
||||
isServiceValid =
|
||||
true;
|
||||
});
|
||||
},
|
||||
false,
|
||||
serviceList,
|
||||
'name',
|
||||
serviceId,
|
||||
valueKey: 'id',
|
||||
),
|
||||
if (!isServiceValid)
|
||||
Text(
|
||||
'Please select a Service',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.red)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
if (selectedServiceName !=
|
||||
"Sales")
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildDropdownField<
|
||||
String>(
|
||||
'Policy Number',
|
||||
(value) {
|
||||
setState(
|
||||
() {
|
||||
policyNumberId =
|
||||
value;
|
||||
isPolicyValid =
|
||||
true;
|
||||
});
|
||||
},
|
||||
false,
|
||||
policyList,
|
||||
'policy_no',
|
||||
policyNumberId,
|
||||
valueKey:
|
||||
'policy_no',
|
||||
),
|
||||
if (!isPolicyValid)
|
||||
Text(
|
||||
'Please select a policy',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Colors.red)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
buildTextField(
|
||||
'Subject',
|
||||
subjectController),
|
||||
if (!isSubjectValid)
|
||||
Text(
|
||||
'Please enter the Subject',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Colors.red)),
|
||||
SizedBox(
|
||||
height: 15),
|
||||
buildTextAreaField(
|
||||
'Message',
|
||||
messageController),
|
||||
if (!isMessageValid)
|
||||
Text(
|
||||
'Please enter the Message',
|
||||
style: TextStyle(
|
||||
color:
|
||||
Colors.red)),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Container(
|
||||
alignment:
|
||||
Alignment.centerRight,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
sendFormDataToApi();
|
||||
},
|
||||
child: Text(
|
||||
'Send',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
color:
|
||||
Colors.white),
|
||||
),
|
||||
style: ElevatedButton
|
||||
.styleFrom(
|
||||
backgroundColor:
|
||||
Color(0xFFE26728),
|
||||
shape:
|
||||
RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(5),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
|
||||
]),
|
||||
)),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
height: 60,
|
||||
width: 60,
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
|
||||
]),
|
||||
)),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
height: 60,
|
||||
width: 60,
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
// floatingActionButton: Responsive.isDesktop(context)
|
||||
// ? null
|
||||
// : FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.pushNamed(context, 'chatbot');
|
||||
// },
|
||||
// child: Icon(Icons.chat),
|
||||
// ),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// repositionBotman();
|
||||
if (index == 0) {
|
||||
context.go('/home');
|
||||
} else if (index == 1) {
|
||||
context.go('/claims');
|
||||
} else if (index == 2) {
|
||||
context.go('/profile');
|
||||
} else if (index == 3) {
|
||||
context.go('/help');
|
||||
} else if (index == 4) {
|
||||
// Wellness tab clicked → show popup
|
||||
PopupHelper.showRedirectPopup(
|
||||
context: context,
|
||||
apiService: apiService,
|
||||
empPrimaryId: session.empPrimaryId,
|
||||
);
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
Icons.health_and_safety_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claims",
|
||||
"Profile",
|
||||
"Help",
|
||||
"Wellness",
|
||||
],
|
||||
initialIndex: 3, // Initial index of the bottom navigation bar
|
||||
),
|
||||
)
|
||||
);
|
||||
// floatingActionButton: Responsive.isDesktop(context)
|
||||
// ? null
|
||||
// : FloatingActionButton(
|
||||
// onPressed: () {
|
||||
// Navigator.pushNamed(context, 'chatbot');
|
||||
// },
|
||||
// child: Icon(Icons.chat),
|
||||
// ),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// repositionBotman();
|
||||
if (index == 0) {
|
||||
context.go('/home');
|
||||
} else if (index == 1) {
|
||||
context.go('/claims');
|
||||
} else if (index == 2) {
|
||||
context.go('/profile');
|
||||
} else if (index == 3) {
|
||||
context.go('/help');
|
||||
} else if (index == 4) {
|
||||
// Wellness tab clicked → show popup
|
||||
PopupHelper.showRedirectPopup(
|
||||
context: context,
|
||||
apiService: apiService,
|
||||
empPrimaryId: session.empPrimaryId,
|
||||
);
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
Icons.health_and_safety_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claims",
|
||||
"Profile",
|
||||
"Help",
|
||||
"Wellness",
|
||||
],
|
||||
initialIndex: 3, // Initial index of the bottom navigation bar
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget buildTextField(String label, TextEditingController controller,
|
||||
|
||||
@ -1282,4 +1282,4 @@
|
||||
// print('Title: ${message.notification?.title}');
|
||||
// print('Body: ${message.notification?.body}');
|
||||
// print('Data: ${message.data}');
|
||||
// }
|
||||
// }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user