From 705731d2ab146e1f25ae48c19ff041df4de1e326 Mon Sep 17 00:00:00 2001 From: venbaittech Date: Fri, 7 Nov 2025 10:17:58 +0530 Subject: [PATCH] UI_BUGFIX --- lib/main.dart | 58 +- lib/pages/email_verify.dart | 890 +-- lib/pages/enrollment/empDetails.dart | 1422 ++--- lib/pages/enrollment/empReview.dart | 4853 +++++++++-------- lib/pages/login.dart | 32 +- lib/pages/postEnrollment/claimprocess.dart | 1298 ++--- lib/pages/postEnrollment/claims.dart | 926 ++-- .../generalexclusionsdeductibles.dart | 1270 ++--- lib/pages/postEnrollment/help.dart | 1520 +++--- lib/pages/postEnrollment/home.dart | 603 +- lib/pages/postEnrollment/planclaimsform.dart | 2 +- lib/pages/postEnrollment/policies.dart | 2 +- lib/pages/postEnrollment/profile.dart | 72 +- lib/pages/postEnrollment/tickets.dart | 710 +-- lib/pages/verify.dart | 2 +- 15 files changed, 7126 insertions(+), 6534 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8e4ee62..e81643d 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 { 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 { } } - /// Middleware logic for tokens + mpin Future tokenRedirectLogic( BuildContext context, GoRouterState state) async { @@ -110,7 +106,8 @@ Future 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 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 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 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?; // 👈 receive here + final arguments = + state.extra as Map?; // 👈 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 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 { super.initState(); WidgetsBinding.instance.addPostFrameCallback((_) { - final apiService = ApiService(context); - DataManager().init(apiService); - DataManager().loadAdvertisementImages(); + final apiService = ApiService(context); + DataManager().init(apiService); + DataManager().loadAdvertisementImages(); }); - } @override diff --git a/lib/pages/email_verify.dart b/lib/pages/email_verify.dart index b0ac7e9..4f4107b 100755 --- a/lib/pages/email_verify.dart +++ b/lib/pages/email_verify.dart @@ -2,6 +2,7 @@ // import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart'; @@ -20,11 +21,11 @@ import '../customAppBar/responsive.dart'; import '../customAppBar/toastHelper.dart'; import '../models/environment.dart'; import '../models/platform_helper_mobile.dart' -if (dart.library.html) '../models/platform_helper_other.dart'; + if (dart.library.html) '../models/platform_helper_other.dart'; // import 'dart:html' as html; import '../pages/helpers/html_stub.dart' -if (dart.library.html) '../pages/helpers/html_web.dart'; + if (dart.library.html) '../pages/helpers/html_web.dart'; // import '../pages/helpers/html_stub.dart' if (dart.library.html) 'html_web.dart'; @@ -159,8 +160,8 @@ class _MyEmailVerifyState extends State { try { final response = await http.post( Uri.parse(Environment.apiUrl + 'storeFireBase'), - body: json - .encode({'mobile': session.mobileNo, 'firebase_token': deviceToken}), + body: json.encode( + {'mobile': session.mobileNo, 'firebase_token': deviceToken}), headers: { HttpHeaders.contentTypeHeader: 'application/json', 'Authorization': 'Bearer $_preToken', @@ -203,13 +204,12 @@ class _MyEmailVerifyState extends State { try { // print('EMAIL PARAMS : ${widget.email} - OTP : $otp'); final Map payload = (widget.type == 'mobile') - ? {'otp': _otpController.text,'mobile_number': widget.value} + ? {'otp': _otpController.text, 'mobile_number': widget.value} : {'otp': _otpController.text, 'email_id': widget.value}; final response = await http.post( Uri.parse(Environment.apiUrlEnrollment + 'getVerifiedUserData'), - body: - json.encode(payload), + body: json.encode(payload), headers: { HttpHeaders.contentTypeHeader: 'application/json', }, @@ -238,7 +238,8 @@ class _MyEmailVerifyState extends State { } String? postToken; - if (data['post_enrollment'] != null && data['post_enrollment']['data'] is String) { + if (data['post_enrollment'] != null && + data['post_enrollment']['data'] is String) { postToken = data['post_enrollment']['data']; } @@ -427,7 +428,7 @@ class _MyEmailVerifyState extends State { // if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') { if (_postToken != null && _postToken.isNotEmpty) { final SharedPreferences prefs = await SharedPreferences.getInstance(); - if(widget.type == 'mobile'){ + if (widget.type == 'mobile') { prefs.setString('empMobileNo', widget.value); } else { prefs.setString('empEmailid', widget.value); @@ -485,7 +486,7 @@ class _MyEmailVerifyState extends State { // if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') { if (_preToken != null && _preToken.isNotEmpty) { final SharedPreferences prefs = await SharedPreferences.getInstance(); - if(widget.type == 'mobile'){ + if (widget.type == 'mobile') { prefs.setString('empMobileNo', widget.value); } else { prefs.setString('empEmailid', widget.value); @@ -526,7 +527,7 @@ class _MyEmailVerifyState extends State { String apiEndpoint = (widget.type == 'mobile') ? Environment.apiUrlEnrollment + 'verifyEmployeeNumber' - : Environment.apiUrlEnrollment + 'verifyEmployeeEmailId'; + : Environment.apiUrlEnrollment + 'verifyEmployeeEmailId'; final response = await http.post( Uri.parse(apiEndpoint), @@ -541,14 +542,13 @@ class _MyEmailVerifyState extends State { bool userVerification = data['data']['user_verification']; String message = data['data']['message']; if (userVerification) { - if(widget.type == 'mobile'){ + if (widget.type == 'mobile') { ToastHelper.showSuccessToast( context, 'Verification code sent to ${widget.value}'); } else { ToastHelper.showSuccessToast( context, 'Verification code sent to ${widget.value}'); } - } else { ToastHelper.showErrorToast(context, message); print('Invalid mobile number'); @@ -647,13 +647,14 @@ class _MyEmailVerifyState extends State { } Future getClientLogoAndDetails() async { - var url = Uri.parse(Environment.apiUrlEnrollment + 'getClientDetails?post_client_id=${session.client_id}&post_branch_id=${session.empClientBranchId}&pre_client_id=${session.enrollmentClient_id}&pre_branch_id=${session.enrollmentEmpClientBranchId}'); + var url = Uri.parse(Environment.apiUrlEnrollment + + 'getClientDetails?post_client_id=${session.client_id}&post_branch_id=${session.empClientBranchId}&pre_client_id=${session.enrollmentClient_id}&pre_branch_id=${session.enrollmentEmpClientBranchId}'); try { var response = await http.get( url, headers: { 'Authorization': - 'Bearer $_preToken', // Add token to the Authorization header + 'Bearer $_preToken', // Add token to the Authorization header }, ); if (response.statusCode == 200) { @@ -664,9 +665,11 @@ class _MyEmailVerifyState extends State { if (data.containsKey('data')) { dynamic clientDetails = data['data']; final SharedPreferences prefs = await SharedPreferences.getInstance(); - await prefs.setString('clientLogo', clientDetails['client']['client_logo']); - await prefs.setString('clientName', clientDetails['client']['client_name']); - await prefs.setString( + await prefs.setString( + 'clientLogo', clientDetails['client']['client_logo']); + await prefs.setString( + 'clientName', clientDetails['client']['client_name']); + await prefs.setString( 'addon_subheading', clientDetails['client']['addon_subheading']); setState(() { // dynamic clientDetails = data['data']; @@ -756,487 +759,496 @@ class _MyEmailVerifyState extends State { }, child: Scaffold( body: SingleChildScrollView( - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, - child: Container( - height: _size.height, - color: Colors.white, - child: Stack( - children: [ - Visibility( - visible: _size.width <= 1100, - child: ClipRRect( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(30), - bottomRight: Radius.circular(30), - ), - child: Container( - height: _size.height / 3, - width: double.infinity, - color: Color(0xFFFFFCE5), - child: Stack( + keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, + child: Container( + height: _size.height, + color: Colors.white, + child: Stack( + children: [ + Visibility( + visible: _size.width <= 1100, + child: ClipRRect( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(30), + bottomRight: Radius.circular(30), + ), + child: Container( + height: _size.height / 3, + width: double.infinity, + color: Color(0xFFFFFCE5), + child: Stack( + children: [ + Column( children: [ - Column( + SizedBox( + height: _size.height / + 6.4), // Adjust the spacing between the rows + Row( + mainAxisAlignment: MainAxisAlignment + .center, // Align to the center children: [ - SizedBox( - height: _size.height / - 6.4), // Adjust the spacing between the rows - Row( - mainAxisAlignment: MainAxisAlignment - .center, // Align to the center - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 10 - : 12, - child: Align( - alignment: Responsive.isDesktop(context) - ? Alignment.centerLeft - : Alignment.bottomCenter, - child: Image.asset( - 'assets/nhance_app_logo.png', - width: 150, - height: 150, + Expanded( + flex: Responsive.isDesktop(context) + ? 10 + : 12, + child: Align( + alignment: Responsive.isDesktop(context) + ? Alignment.centerLeft + : Alignment.bottomCenter, + child: Image.asset( + 'assets/nhance_app_logo.png', + width: 150, + height: 150, + ), + ), + ), + if (!Responsive.isMobile(context) && + !Responsive.isTablet(context)) + Expanded( + flex: 2, + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + context.go('/hrLogin'); + // Navigator.pushNamed( + // context, 'hrLogin'); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment + .end, // Align to the end (right) + children: [ + Text( + 'HR Login', + style: GoogleFonts.poppins( + color: Color( + 0xFF000000), // Text color + // Add other text styles as needed + ), + ), + SizedBox(width: 5), + Icon( + Icons + .east, // Icon for customer login + color: Colors + .black, // Adjust color as needed + ), + ], ), ), ), - if (!Responsive.isMobile(context) && - !Responsive.isTablet(context)) - Expanded( - flex: 2, - child: MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - context.go('/hrLogin'); - // Navigator.pushNamed( - // context, 'hrLogin'); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment - .end, // Align to the end (right) - children: [ - Text( - 'HR Login', - style: GoogleFonts.poppins( - color: Color( - 0xFF000000), // Text color - // Add other text styles as needed - ), - ), - SizedBox(width: 5), - Icon( - Icons - .east, // Icon for customer login - color: Colors - .black, // Adjust color as needed - ), - ], - ), - ), - ), - ), - ], - ), + ), ], ), ], ), - ), + ], ), ), - Container( - margin: marginInsets, - alignment: Alignment.bottomCenter, - child: SingleChildScrollView( - child: Form( - key: _formKey, - child: Column( + ), + ), + Container( + margin: marginInsets, + alignment: Alignment.bottomCenter, + child: SingleChildScrollView( + child: Form( + key: _formKey, + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - flex: _size.width < 1100 ? 6 : 12, - child: Container( - margin: _size.width > 1100 - ? EdgeInsets.only(left: 20, right: 20) - : EdgeInsets.only(left: 0, right: 0), - child: Column( - mainAxisAlignment: + Expanded( + flex: _size.width < 1100 ? 6 : 12, + child: Container( + margin: _size.width > 1100 + ? EdgeInsets.only(left: 20, right: 20) + : EdgeInsets.only(left: 0, right: 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (!Responsive.isMobile(context) && - !Responsive.isTablet(context)) - Row( - children: [ - Expanded( - flex: 10, - child: Align( - alignment: Responsive + children: [ + if (!Responsive.isMobile(context) && + !Responsive.isTablet(context)) + Row( + children: [ + Expanded( + flex: 10, + child: Align( + alignment: Responsive .isDesktop(context) - ? Alignment.centerLeft - : Alignment + ? Alignment.centerLeft + : Alignment .bottomCenter, // Align to the start - child: _size.width <= 1100 + child: _size.width <= 1100 + ? Image.asset( + 'assets/nhance_app_logo.png', + width: 150, + height: 150, + ) + : _size.width > 1100 ? Image.asset( - 'assets/nhance_app_logo.png', - width: 150, - height: 150, - ) - : _size.width > 1100 - ? Image.asset( - 'assets/nhance_app_logo.png', - width: 150, - height: 150, - ) + 'assets/nhance_app_logo.png', + width: 150, + height: 150, + ) : Image.asset( - 'assets/nhance_app_logo.png', - width: 150, - height: 150, - ), - )), - ], - ), - SizedBox(height: 10), - // SizedBox( - // height: Responsive.isDesktop(context) - // ? _size.height * 0.1 - // : 10, - // ), - Container( - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( + 'assets/nhance_app_logo.png', + width: 150, + height: 150, + ), + )), + ], + ), + SizedBox(height: 10), + // SizedBox( + // height: Responsive.isDesktop(context) + // ? _size.height * 0.1 + // : 10, + // ), + Container( + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( horizontal: 150) - : EdgeInsets.symmetric( + : EdgeInsets.symmetric( horizontal: 0), - child: Row( - mainAxisAlignment: + child: Row( + mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "Welcome to Nhance", - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.bold, - ), - ), - ], + children: [ + Text( + "Welcome to Nhance", + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.bold, + ), ), - ), - SizedBox(height: 10), - Container( - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( + ], + ), + ), + SizedBox(height: 10), + Container( + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( horizontal: 150) - : EdgeInsets.symmetric( + : EdgeInsets.symmetric( horizontal: 0), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: "Please enter the one-time usage code sent to your ", + style: TextStyle( + fontSize: 12, + height: 1.5, + color: Color(0xFF000000)), + children: [ + TextSpan( + text: widget.type == 'mobile' + ? 'mobile number ${widget.value}' + : 'Email Id ${widget.value}', + ), + TextSpan( + text: widget.type == 'mobile' + ? ' (Change Mobile)' + : ' (Change Email)', style: TextStyle( fontSize: 12, - height: 1.5, - color: Color(0xFF000000)), - children: [ - TextSpan( - text: widget.type == 'mobile' ? 'mobile number ${widget.value}' : 'Email Id ${widget.value}', - ), - TextSpan( - text: widget.type == 'mobile' ? ' (Change Mobile)' : ' (Change Email)', - style: TextStyle( - fontSize: 12, - color: Color( - 0xFFE26728) - ), // Change color as desired - recognizer: TapGestureRecognizer() + color: Color( + 0xFFE26728)), // Change color as desired + recognizer: + TapGestureRecognizer() ..onTap = () { context.go('/login'); // Navigator.pushNamed( // context, 'login'); }, - ), - ], ), - ), + ], ), - SizedBox(height: 15), - Container( - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( + ), + ), + SizedBox(height: 15), + Container( + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( horizontal: 150) - : EdgeInsets.symmetric( + : EdgeInsets.symmetric( horizontal: 0), - child: Pinput( - length: 6, - // defaultPinTheme: defaultPinTheme, - // focusedPinTheme: focusedPinTheme, - // submittedPinTheme: submittedPinTheme, - showCursor: true, - controller: _otpController, - ), - ), - SizedBox(height: 10), - Container( - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( + child: Pinput( + length: 6, + // defaultPinTheme: defaultPinTheme, + // focusedPinTheme: focusedPinTheme, + // submittedPinTheme: submittedPinTheme, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly, // ✅ allows only 0–9 + ], + keyboardType: TextInputType.number, + showCursor: true, + controller: _otpController, + ), + ), + SizedBox(height: 10), + Container( + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( horizontal: 150) - : EdgeInsets.symmetric( + : EdgeInsets.symmetric( horizontal: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment - .end, // Align text to the right - children: [ - _isTimerRunning - ? Text( - "Resend OTP in $_secondsRemaining seconds", - style: - GoogleFonts.poppins( - color: - Colors.black), - ) - : InkWell( - onTap: () { - _resendOTP(); - }, - child: Text( - "Resend OTP", + child: Row( + mainAxisAlignment: MainAxisAlignment + .end, // Align text to the right + children: [ + _isTimerRunning + ? Text( + "Resend OTP in $_secondsRemaining seconds", style: - GoogleFonts.poppins( - color: Colors - .blue), + GoogleFonts.poppins( + color: + Colors.black), + ) + : InkWell( + onTap: () { + _resendOTP(); + }, + child: Text( + "Resend OTP", + style: + GoogleFonts.poppins( + color: Colors + .blue), + ), ), - ), - ], - ), - ), - SizedBox(height: 10), - Container( - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( + ], + ), + ), + SizedBox(height: 10), + Container( + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( horizontal: 150) - : EdgeInsets.symmetric( + : EdgeInsets.symmetric( horizontal: 0), - child: SizedBox( - width: double.infinity, - height: 45, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: + child: SizedBox( + width: double.infinity, + height: 45, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF00989E), - shape: RoundedRectangleBorder( - borderRadius: + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), - ), - ), - onPressed: () { - if (_formKey.currentState! - .validate()) { - _formKey.currentState! - .save(); // Save form fields before calling verifyOTP - verifyOTP( - _otpController.text); - } - }, - child: Text( - "Submit", - style: GoogleFonts.poppins( - color: Color(0xFFFFFFFF)), - ), ), ), + onPressed: () { + if (_formKey.currentState! + .validate()) { + _formKey.currentState! + .save(); // Save form fields before calling verifyOTP + verifyOTP( + _otpController.text); + } + }, + child: Text( + "Submit", + style: GoogleFonts.poppins( + color: Color(0xFFFFFFFF)), + ), ), - // _size.width > 1100 - // ? Container( - // margin: EdgeInsets.symmetric( - // horizontal: 150), - // child: Column( - // children: [ - // SizedBox(height: 20), - // Text( - // "Benefits of Login", - // style: - // GoogleFonts.poppins( - // fontSize: 20, - // fontWeight: - // FontWeight.bold, - // ), - // ), - // SizedBox(height: 15), - // ], - // )) - // : SizedBox(), - // _size.width > 1100 - // ? Container( - // margin: EdgeInsets.symmetric( - // horizontal: 150), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // Expanded( - // flex: 6, - // child: Container( - // padding: EdgeInsets - // .symmetric( - // vertical: 8), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment - // .center, - // children: [ - // Expanded( - // child: Container( - // padding: EdgeInsets - // .symmetric( - // vertical: - // 12), - // decoration: - // BoxDecoration( - // border: - // Border( - // right: - // BorderSide( - // width: 1, - // color: Colors - // .black, - // ), - // ), - // ), - // child: Column( - // children: [ - // Icon( - // Icons - // .policy, - // color: Color( - // 0xFFE26728)), - // SizedBox( - // height: - // 10), - // Text( - // "View Policy", - // style: GoogleFonts - // .poppins()), - // ], - // ), - // ), - // ), - // Expanded( - // child: Container( - // padding: EdgeInsets - // .symmetric( - // vertical: - // 12), - // child: Column( - // children: [ - // Icon( - // Icons - // .edit, - // color: Color( - // 0xFFE26728)), - // SizedBox( - // height: - // 10), - // Text( - // "Manage Claims", - // style: GoogleFonts - // .poppins()), - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ], - // ), - // ) - // : SizedBox( - // height: Responsive.isDesktop( - // context) - // ? _size.height * 0.1 - // : _size.height * 0.2, - // ), - SizedBox( - height: Responsive.isDesktop(context) - ? _size.height * 0.3 - : _size.height * 0.2, - ), - // SizedBox( - // height: _size.height * 0.1, - // ), - Container( - alignment: Alignment.bottomCenter, - padding: + ), + ), + // _size.width > 1100 + // ? Container( + // margin: EdgeInsets.symmetric( + // horizontal: 150), + // child: Column( + // children: [ + // SizedBox(height: 20), + // Text( + // "Benefits of Login", + // style: + // GoogleFonts.poppins( + // fontSize: 20, + // fontWeight: + // FontWeight.bold, + // ), + // ), + // SizedBox(height: 15), + // ], + // )) + // : SizedBox(), + // _size.width > 1100 + // ? Container( + // margin: EdgeInsets.symmetric( + // horizontal: 150), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.center, + // children: [ + // Expanded( + // flex: 6, + // child: Container( + // padding: EdgeInsets + // .symmetric( + // vertical: 8), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment + // .center, + // children: [ + // Expanded( + // child: Container( + // padding: EdgeInsets + // .symmetric( + // vertical: + // 12), + // decoration: + // BoxDecoration( + // border: + // Border( + // right: + // BorderSide( + // width: 1, + // color: Colors + // .black, + // ), + // ), + // ), + // child: Column( + // children: [ + // Icon( + // Icons + // .policy, + // color: Color( + // 0xFFE26728)), + // SizedBox( + // height: + // 10), + // Text( + // "View Policy", + // style: GoogleFonts + // .poppins()), + // ], + // ), + // ), + // ), + // Expanded( + // child: Container( + // padding: EdgeInsets + // .symmetric( + // vertical: + // 12), + // child: Column( + // children: [ + // Icon( + // Icons + // .edit, + // color: Color( + // 0xFFE26728)), + // SizedBox( + // height: + // 10), + // Text( + // "Manage Claims", + // style: GoogleFonts + // .poppins()), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ) + // : SizedBox( + // height: Responsive.isDesktop( + // context) + // ? _size.height * 0.1 + // : _size.height * 0.2, + // ), + SizedBox( + height: Responsive.isDesktop(context) + ? _size.height * 0.3 + : _size.height * 0.2, + ), + // SizedBox( + // height: _size.height * 0.1, + // ), + Container( + alignment: Alignment.bottomCenter, + padding: EdgeInsets.symmetric(vertical: 8), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: 'By continuing, you agree with our ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + children: [ + TextSpan( + text: 'privacy policy ', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + TextSpan( + text: 'and ', style: GoogleFonts.poppins( color: Colors.black, fontSize: 9, ), - children: [ - TextSpan( - text: 'privacy policy ', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - TextSpan( - text: 'and ', - style: GoogleFonts.poppins( - color: Colors.black, - fontSize: 9, - ), - ), - TextSpan( - text: 'terms of use', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - ], ), - ), + TextSpan( + text: 'terms of use', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + ], ), - ], + ), ), - ), + ], ), - if (_size.width > 1100) - Expanded( - flex: _size.width < 1100 ? 6 : 12, - child: LayoutBuilder( - builder: (BuildContext context, - BoxConstraints constraints) { - if (constraints.maxWidth > 600) { - return Image.asset( - 'assets/login_web.jpg', - height: _size.height, - fit: BoxFit.cover, - ); - } else { - return SizedBox(); - } - }, - ), - ), - ], + ), ), + if (_size.width > 1100) + Expanded( + flex: _size.width < 1100 ? 6 : 12, + child: LayoutBuilder( + builder: (BuildContext context, + BoxConstraints constraints) { + if (constraints.maxWidth > 600) { + return Image.asset( + 'assets/login_web.jpg', + height: _size.height, + fit: BoxFit.cover, + ); + } else { + return SizedBox(); + } + }, + ), + ), ], ), - ), + ], ), ), - ], - )), - ))); + ), + ), + ], + )), + ))); } } @@ -1247,4 +1259,4 @@ class _MyEmailVerifyState extends State { // print('Title: ${message.notification?.title}'); // print('Body: ${message.notification?.body}'); // print('Data: ${message.data}'); -// } \ No newline at end of file +// } diff --git a/lib/pages/enrollment/empDetails.dart b/lib/pages/enrollment/empDetails.dart index fd24c4d..cc00340 100755 --- a/lib/pages/enrollment/empDetails.dart +++ b/lib/pages/enrollment/empDetails.dart @@ -134,7 +134,8 @@ class _empDetailsState extends State { Future getTokenStatus() async { // final SharedPreferences prefs = await SharedPreferences.getInstance(); setState(() async { - isTokenAvailable = (await TokenService.getPostToken())?.isNotEmpty ?? false; + isTokenAvailable = + (await TokenService.getPostToken())?.isNotEmpty ?? false; print('isTokenAvailable $isTokenAvailable'); }); } @@ -149,8 +150,9 @@ class _empDetailsState extends State { // Decode the JWT token received from the API response enrollmentEmpClientBranchId = session.enrollmentEmpClientBranchId; enrollmentEmpCodeString = session.enrollmentEmpCodeString; - print('enrollmentEmpCodeString : $enrollmentEmpCodeString'); // Check if emp_code is correct - enrollmentEmpPrimaryId =session.enrollmentEmpPrimaryId; + print( + 'enrollmentEmpCodeString : $enrollmentEmpCodeString'); // Check if emp_code is correct + enrollmentEmpPrimaryId = session.enrollmentEmpPrimaryId; enrollmentGpaEmpName = session.enrollmentGpaEmpName; enrollmentClient_id = session.enrollmentClient_id; selfEmpStatus = prefs.getString('selfEmpStatus'); @@ -223,14 +225,16 @@ class _empDetailsState extends State { Future getClientLogoAndDetails() async { try { final SharedPreferences prefs = await SharedPreferences.getInstance(); - final empClientId = await session.client_id; - final empClientBranchId = await session.empClientBranchId; + final empClientId = await session.client_id; + final empClientBranchId = await session.empClientBranchId; // if (enrollmentClient_id == null || // enrollmentEmpCodeString == null || // enrollmentEmpClientBranchId == null) { // return; // } - final response = await apiService.getClientLogoAndDetailsToApi(empClientId,empClientBranchId, + final response = await apiService.getClientLogoAndDetailsToApi( + empClientId, + empClientBranchId, enrollmentClient_id!, enrollmentEmpClientBranchId!); print('check 1'); @@ -481,6 +485,16 @@ class _empDetailsState extends State { } } + String formatDate(String inputDate) { + // Parse the input date string + DateTime dateTime = DateFormat('dd-MM-yyyy').parse(inputDate); + + // Format the date to the desired format + String formattedDate = DateFormat('dd MMM yyyy').format(dateTime); + + return formattedDate; + } + Future deleteItem(Map deletedItem) async { print(deletedItem); try { @@ -551,7 +565,7 @@ class _empDetailsState extends State { // Prepare the API request final response = - await apiService.saveFamilyMemberDetailsToApi(formDataList); + await apiService.saveFamilyMemberDetailsToApi(formDataList); // Check the response if (response['status'] == 'success') { @@ -616,11 +630,11 @@ class _empDetailsState extends State { 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( @@ -643,7 +657,7 @@ class _empDetailsState extends State { ), 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( @@ -687,121 +701,121 @@ class _empDetailsState extends State { _showExitConfirmation(context); }, child: Scaffold( - appBar: CustomAppBar(), - body: 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: Color(0xFFEFF3F6), - child: Column( - children: [ - Card( - elevation: 0, - color: Colors.white, - child: Container( - width: double.infinity, - height: 75, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, - bottom: 12, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerLeft, - child: Image.network( - clientLogo ?? '', - width: 80, // Set the width here - height: 80, // Set the height here - loadingBuilder: (BuildContext context, - Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - value: - loadingProgress.expectedTotalBytes != - null - ? loadingProgress - .cumulativeBytesLoaded / - loadingProgress - .expectedTotalBytes! - : null, - ), - ); - }, - // errorBuilder: (BuildContext context, - // Object error, StackTrace? stackTrace) { - // return Image.asset( - // 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - // width: 80, - // height: 80, - // fit: BoxFit.cover, - // ); - // }, + appBar: CustomAppBar(), + body: 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: Color(0xFFEFF3F6), + child: Column( + children: [ + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 75, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, + bottom: 12, + left: 10, + right: 10), // Add padding to the container + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerLeft, + child: Image.network( + clientLogo ?? '', + width: 80, // Set the width here + height: 80, // Set the height here + loadingBuilder: (BuildContext context, + Widget child, + ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress + .expectedTotalBytes != + null + ? loadingProgress + .cumulativeBytesLoaded / + loadingProgress + .expectedTotalBytes! + : null, + ), + ); + }, + // errorBuilder: (BuildContext context, + // Object error, StackTrace? stackTrace) { + // return Image.asset( + // 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + // width: 80, + // height: 80, + // fit: BoxFit.cover, + // ); + // }, + ), + ), ), - ), - ), - Expanded( - flex: 9, - child: Text( - clientName ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 20 : 18, - fontWeight: FontWeight.w600, - ), - ), - ) - ], - ), - ), - ), - SizedBox(height: 16), - Card( - elevation: 0, - color: Colors.white, - child: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, bottom: 12, left: 10, right: 10), - child: Center( - child: Text( - 'No Active Current policies ', - textAlign: TextAlign - .center, // Align text center within the Card - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - height: 5, + Expanded( + flex: 9, + child: Text( + clientName ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 20 : 18, + fontWeight: FontWeight.w600, + ), + ), + ) + ], ), ), ), - ), + SizedBox(height: 16), + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, bottom: 12, left: 10, right: 10), + child: Center( + child: Text( + 'No Active Current policies ', + textAlign: TextAlign + .center, // Align text center within the Card + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + height: 5, + ), + ), + ), + ), + ), + ], ), - ], - ), - ), - ))); + ), + ))); } else { return PopScope( canPop: false, @@ -810,239 +824,261 @@ class _empDetailsState extends State { _showExitConfirmation(context); }, child: Scaffold( - backgroundColor: Color(0xFFFFFFFF), - 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: Color(0xFFEFF3F6), - child: Column( - children: [ - Card( - elevation: 0, - color: Colors.white, - child: Container( - width: double.infinity, - height: 80, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, - bottom: 12, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 200, - height: 200, - alignment: Alignment.centerLeft, - child: Image.network( - clientLogo ?? '', - // width: 200, // Set the width here - // height: 200, // Set the height here - loadingBuilder: (BuildContext context, - Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - value: - loadingProgress.expectedTotalBytes != - null - ? loadingProgress - .cumulativeBytesLoaded / - loadingProgress - .expectedTotalBytes! - : null, + backgroundColor: Color(0xFFFFFFFF), + 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: Color(0xFFEFF3F6), + child: Column( + children: [ + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 80, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, + bottom: 12, + left: 10, + right: 10), // Add padding to the container + child: Row( + children: [ + InkWell( + onTap: () { + context.go('/home'); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // if (!Responsive.isDesktop(context)) + Icon( + Icons.chevron_left, + color: Color(0xFF000000), + size: 30, ), - ); - }, - errorBuilder: (BuildContext context, - Object error, StackTrace? stackTrace) { - return Image.asset( - 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - width: 80, - height: 80, - fit: BoxFit.cover, - ); - }, + SizedBox( + width: Responsive.isDesktop(context) + ? 0 + : 5), + ], + ), ), - ), - ), - Expanded( - flex: 9, - child: Text( - clientName ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 20 : 18, - fontWeight: FontWeight.w600, - ), - ), - ) - ], - ), - ), - ), - SizedBox(height: 16), - if (gpaPolicies != null && gpaPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateGpaCards(gpaPolicies), - ], - ), - SizedBox(height: 16), - if (gmcPolicies != null && gmcPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateCards(gmcPolicies), - ], - ), - SizedBox(height: 16), - if (gmcPolicies != null && gmcPolicies.length > 0) - Card( - elevation: 0, - color: Colors.white, - child: Container( - width: double.infinity, - height: 75, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 10, - bottom: 10, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 12, + Expanded( + flex: 6, child: Container( - width: 150, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: () { - context.go('/addOnsDetails'); - // Navigator.pushNamed( - // context, 'addOnsDetails'); + width: 200, + height: 200, + alignment: Alignment.centerLeft, + child: Image.network( + clientLogo ?? '', + // width: 200, // Set the width here + // height: 200, // Set the height here + loadingBuilder: (BuildContext context, + Widget child, + ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress + .expectedTotalBytes != + null + ? loadingProgress + .cumulativeBytesLoaded / + loadingProgress + .expectedTotalBytes! + : null, + ), + ); + }, + errorBuilder: (BuildContext context, + Object error, StackTrace? stackTrace) { + return Image.asset( + 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + width: 80, + height: 80, + fit: BoxFit.cover, + ); }, - child: Text( - 'Continue', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - ), - ), ), - )), - ], + ), + ), + Expanded( + flex: 9, + child: Text( + clientName ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 20 : 18, + fontWeight: FontWeight.w600, + ), + ), + ) + ], + ), ), ), - ), - SizedBox(height: 40), - ], + SizedBox(height: 16), + if (gpaPolicies != null && gpaPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateGpaCards(gpaPolicies), + ], + ), + SizedBox(height: 16), + if (gmcPolicies != null && gmcPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateCards(gmcPolicies), + ], + ), + SizedBox(height: 16), + if (gmcPolicies != null && gmcPolicies.length > 0) + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 75, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), // Add padding to the container + child: Row( + children: [ + Expanded( + flex: 12, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: () { + context.go('/addOnsDetails'); + // Navigator.pushNamed( + // context, 'addOnsDetails'); + }, + child: Text( + 'Continue', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + ), + ), + ), + )), + ], + ), + ), + ), + SizedBox(height: 40), + ], + ), + ), ), - ), - ), - 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) || - (!Responsive.isDesktop(context) && !isTokenAvailable)) - Align( - alignment: Alignment.bottomCenter, - child: Container( - width: double.infinity, // Make the footer full width - child: CustomFooter(), - ), - ), - ]), - // floatingActionButton: Responsive.isDesktop(context) - // ? null - // : isTokenAvailable - // ? FloatingActionButton( - // onPressed: () => Navigator.push( - // context, - // MaterialPageRoute(builder: (context) => chatbot()), - // ), - // child: Icon(Icons.chat), - // ) - // : null, - floatingActionButtonLocation: Responsive.isDesktop(context) - ? null - : isTokenAvailable - ? FloatingActionButtonLocation.miniEndFloat - : null, - bottomNavigationBar: Responsive.isDesktop(context) - ? null - : isTokenAvailable - ? CustomBottomNavigationBar( - onTabChanged: (index) { - // For example: - if (index == 0) { - context.go('/home'); - // Navigator.pushNamed(context, 'home'); - } else if (index == 1) { - context.go('/claims'); - // Navigator.pushNamed(context, 'claims'); - } else if (index == 2) { - context.go('/profile'); - // Navigator.pushNamed(context, 'profile'); - } else if (index == 3) { - context.go('/help'); - // Navigator.pushNamed(context, 'help'); - } else if (index == 4) { - context.go('/wellness'); - // Navigator.pushNamed(context, 'wellness'); - } - }, - 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: - 0, // Initial index of the bottom navigation bar - ) : null, - )); + 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) || + (!Responsive.isDesktop(context) && !isTokenAvailable)) + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ]), + // floatingActionButton: Responsive.isDesktop(context) + // ? null + // : isTokenAvailable + // ? FloatingActionButton( + // onPressed: () => Navigator.push( + // context, + // MaterialPageRoute(builder: (context) => chatbot()), + // ), + // child: Icon(Icons.chat), + // ) + // : null, + floatingActionButtonLocation: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? FloatingActionButtonLocation.miniEndFloat + : null, + bottomNavigationBar: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? CustomBottomNavigationBar( + onTabChanged: (index) { + // For example: + if (index == 0) { + context.go('/home'); + // Navigator.pushNamed(context, 'home'); + } else if (index == 1) { + context.go('/claims'); + // Navigator.pushNamed(context, 'claims'); + } else if (index == 2) { + context.go('/profile'); + // Navigator.pushNamed(context, 'profile'); + } else if (index == 3) { + context.go('/help'); + // Navigator.pushNamed(context, 'help'); + } else if (index == 4) { + context.go('/wellness'); + // Navigator.pushNamed(context, 'wellness'); + } + }, + 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: + 0, // Initial index of the bottom navigation bar + ) + : null, + )); } } @@ -1070,7 +1106,7 @@ class _empDetailsState extends State { selectedRelationships = relationshipOptions .where( (option) => option['dependent'] == floaterData['form_type'], - ) + ) .toList(); // Set the dropdown value based on the form_type @@ -1102,7 +1138,7 @@ class _empDetailsState extends State { selectedRelationships.removeWhere((relationship) => getTrueDataObjects.any((dataObject) => - dataObject['relationship'] == + dataObject['relationship'] == relationship['relationship_name'])); print(selectedRelationships); @@ -1111,12 +1147,13 @@ class _empDetailsState extends State { // Set values to all fields _relationShipController.text = floaterData['relationship'] ?? ''; _memberNameController.text = floaterData['name'] ?? ''; - _dobController.text = floaterData['dob'] ?? ''; + _dobController.text = formatDate(floaterData['dob']) ?? ''; // Add more fields as needed } showDialog( context: context, + barrierDismissible: false, builder: (BuildContext context) { return AlertDialog( shape: RoundedRectangleBorder( @@ -1148,9 +1185,9 @@ class _empDetailsState extends State { alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text(popupName ?? '', style: GoogleFonts.poppins( @@ -1174,7 +1211,7 @@ class _empDetailsState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ DropdownButtonFormField( decoration: InputDecoration( @@ -1196,7 +1233,7 @@ class _empDetailsState extends State { .map((relationship) { final String relationshipName = relationship[ - 'relationship_name'] ?? + 'relationship_name'] ?? ''; return DropdownMenuItem( value: relationshipName, @@ -1214,7 +1251,7 @@ class _empDetailsState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Container( child: TextFormField( @@ -1225,9 +1262,9 @@ class _empDetailsState extends State { hintText: 'Member Full Name', labelText: 'Member Full Name', contentPadding: - EdgeInsets.symmetric( - vertical: 10, - horizontal: 15), + EdgeInsets.symmetric( + vertical: 10, + horizontal: 15), ), validator: (value) { if (value == null || @@ -1268,7 +1305,7 @@ class _empDetailsState extends State { }, ), contentPadding: - EdgeInsets.symmetric( + EdgeInsets.symmetric( vertical: 10, horizontal: 15, ), @@ -1303,7 +1340,7 @@ class _empDetailsState extends State { backgroundColor: Color(0xFFE26728), shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(5), + BorderRadius.circular(5), ), ), ), @@ -1315,7 +1352,7 @@ class _empDetailsState extends State { child: ElevatedButton( onPressed: () { if (_relationShipController - .text.isEmpty || + .text.isEmpty || _memberNameController .text.isEmpty || _dobController.text.isEmpty) { @@ -1325,11 +1362,11 @@ class _empDetailsState extends State { } else { Map formData = { 'relationship': - _relationShipController.text, + _relationShipController.text, 'memberName': - _memberNameController.text, + _memberNameController.text, 'dateOfBirth': - _dobController.text, + _dobController.text, // Add more form fields as needed }; @@ -1355,7 +1392,7 @@ class _empDetailsState extends State { backgroundColor: Color(0xFFE26728), shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(5), + BorderRadius.circular(5), ), ), ), @@ -1410,9 +1447,9 @@ class _empDetailsState extends State { alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text('Member Details', style: GoogleFonts.poppins( @@ -1537,7 +1574,7 @@ class _empDetailsState extends State { child: TextFormField( readOnly: true, initialValue: - selfGender == 'M' ? 'Male' : 'Female', + selfGender == 'M' ? 'Male' : 'Female', decoration: InputDecoration( border: OutlineInputBorder(), hintText: 'Gender', @@ -1658,7 +1695,7 @@ class _empDetailsState extends State { TextFormField( readOnly: true, initialValue: - selfGender == 'M' ? 'Male' : 'Female', + selfGender == 'M' ? 'Male' : 'Female', decoration: InputDecoration( border: OutlineInputBorder(), hintText: 'Gender', @@ -1713,7 +1750,7 @@ class _empDetailsState extends State { backgroundColor: Color(0xFFE26728), shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(5), + BorderRadius.circular(5), ), ), ), @@ -1831,7 +1868,7 @@ class _empDetailsState extends State { ), ), Text( - '${floaterData['relationship']} - ${floaterData['dob']}' ?? + '${floaterData['relationship']} - ${formatDate(floaterData['dob'])}' ?? 'NA', textAlign: TextAlign.left, style: GoogleFonts.poppins( @@ -1861,7 +1898,7 @@ class _empDetailsState extends State { textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 16 : 15, + Responsive.isDesktop(context) ? 16 : 15, color: Color(0xFFE26728), ), ), @@ -1909,37 +1946,37 @@ class _empDetailsState extends State { textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 18 : 13, + Responsive.isDesktop(context) ? 18 : 13, ), ), Row( children: [ !Responsive.isDesktop(context) ? Tooltip( - message: gpaPolicyType ?? 'NA', - child: Text( - gpaPolicyType ?? 'NA', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 20 - : 14, - fontWeight: FontWeight.w600, - ), - ), - ) + message: gpaPolicyType ?? 'NA', + child: Text( + gpaPolicyType ?? 'NA', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 20 + : 14, + fontWeight: FontWeight.w600, + ), + ), + ) : Text( - gpaPolicyName ?? 'NA', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 20 - : 14, - fontWeight: FontWeight.w600, - ), - ), + gpaPolicyName ?? 'NA', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 20 + : 14, + fontWeight: FontWeight.w600, + ), + ), if (item['eCardDownload'] != null) GestureDetector( onTap: () async { @@ -1973,7 +2010,7 @@ class _empDetailsState extends State { textAlign: TextAlign.right, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 18 : 13, + Responsive.isDesktop(context) ? 18 : 13, ), ), Text( @@ -1981,7 +2018,7 @@ class _empDetailsState extends State { textAlign: TextAlign.right, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 20 : 14, + Responsive.isDesktop(context) ? 20 : 14, fontWeight: FontWeight.w600, ), ), @@ -2082,133 +2119,133 @@ class _empDetailsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Additional Premium', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'Additional Premium', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaSiPremiumValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + (gpaSiPremiumValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'GST', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'GST', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaGstValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + (gpaGstValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaTotalableValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) + children: [ + Text( + (gpaTotalableValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + ])) ], ), ), @@ -2242,7 +2279,7 @@ class _empDetailsState extends State { gmcGstValue = item['family_floaters_of_dependent_and_gst_value']; print('gmcGstValue $gmcGstValue'); gmcSiPremiumValue = - item['family_floaters_of_dependent_and_si_premium_value']; + item['family_floaters_of_dependent_and_si_premium_value']; print('gmcSiPremiumValue $gmcSiPremiumValue'); gmcTotalableValue = gmcGstValue + gmcSiPremiumValue; gmcIsValueValid = (gmcSiPremiumValue != 0 && gmcGstValue != 0); @@ -2332,7 +2369,7 @@ class _empDetailsState extends State { ), ), Text( - '${floaterData['relationship']} - ${floaterData['dob']}', + '${floaterData['relationship']} - ${formatDate(floaterData['dob'])}', textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: Responsive.isDesktop(context) ? 18 : 16, @@ -2359,17 +2396,24 @@ class _empDetailsState extends State { onTap: () { deleteItem(floaterData); }, - child: Text( - 'Delete', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 16 - : 15, - color: Color( - 0xFFE26728), // Add underline decoration + child: Tooltip( + message: 'Delete', + child: Icon( + Icons.delete, + color: Color(0xFFE26728), ), ), + // child: Text( + // 'Delete', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: Responsive.isDesktop(context) + // ? 16 + // : 15, + // color: Color( + // 0xFFE26728), // Add underline decoration + // ), + // ), ), ) ], @@ -2380,18 +2424,19 @@ class _empDetailsState extends State { if (gmcECardDownload == null) Expanded( flex: (isValueExist && - floaterData['relationship'] != 'Self') + floaterData['relationship'] != 'Self') ? Responsive.isDesktop(context) - ? 1 - : 2 + ? 1 + : 4 : Responsive.isDesktop(context) - ? 2 - : 4, + ? 1 + : 4, child: Container( - alignment: Alignment.topRight, + // alignment: Alignment.topRight, + // color: Colors.yellow, child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ MouseRegion( cursor: SystemMouseCursors.click, @@ -2404,19 +2449,34 @@ class _empDetailsState extends State { floaterData, 'Edit', gmcSumInsured); } }, - child: Text( - floaterData['relationship'] == 'Self' - ? 'View' - : 'Edit', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 16 - : 15, - color: Color( - 0xFFE26728), // Add underline decoration - ), - ), + // child: Text( + // floaterData['relationship'] == 'Self' + // ? 'View' + // : 'Edit', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: Responsive.isDesktop(context) + // ? 16 + // : 15, + // color: Color( + // 0xFFE26728), // Add underline decoration + // ), + // ), + child: floaterData['relationship'] == 'Self' + ? Tooltip( + message: 'View', + child: Icon( + Icons.remove_red_eye, + color: const Color(0xFFE26728), + ), + ) + : Tooltip( + message: 'Edit', + child: Icon( + Icons.edit, + color: const Color(0xFFE26728), + ), + ), ), ) ], @@ -2491,7 +2551,7 @@ class _empDetailsState extends State { textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 22 : 18, + Responsive.isDesktop(context) ? 22 : 18, fontWeight: FontWeight.w500, ), ), @@ -2526,9 +2586,9 @@ class _empDetailsState extends State { ), padding: Responsive.isDesktop(context) ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) + top: 15, bottom: 15, left: 25, right: 25) : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), + top: 10, bottom: 10, left: 10, right: 10), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -2558,9 +2618,9 @@ class _empDetailsState extends State { textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) - ? 20 - : 14, + Responsive.isDesktop(context) + ? 20 + : 14, fontWeight: FontWeight.w600, ), ), @@ -2617,7 +2677,7 @@ class _empDetailsState extends State { SizedBox(height: 10), Container( padding: - EdgeInsets.only(top: 0, bottom: 0, left: 10, right: 10), + EdgeInsets.only(top: 0, bottom: 0, left: 10, right: 10), child: Text(gmcFloaterTextDescription, style: GoogleFonts.poppins( fontSize: Responsive.isDesktop(context) ? 14 : 11, @@ -2634,9 +2694,9 @@ class _empDetailsState extends State { ), padding: Responsive.isDesktop(context) ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) + top: 15, bottom: 15, left: 25, right: 25) : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), + top: 10, bottom: 10, left: 10, right: 10), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -2675,7 +2735,7 @@ class _empDetailsState extends State { SizedBox(height: 15), Container( padding: - EdgeInsets.only(top: 0, bottom: 0, left: 15, right: 15), + EdgeInsets.only(top: 0, bottom: 0, left: 15, right: 15), child: Text('Please review your enrolled dependents.', style: GoogleFonts.poppins( fontSize: Responsive.isDesktop(context) ? 18 : 16, @@ -2773,139 +2833,139 @@ class _empDetailsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Additional Premium', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: + children: [ + Text( + 'Additional Premium', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gmcSiPremiumValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: + children: [ + Text( + (gmcSiPremiumValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'GST', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: + children: [ + Text( + 'GST', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gmcGstValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: + children: [ + Text( + (gmcGstValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gmcTotalableValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) + children: [ + Text( + (gmcTotalableValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + ])) ], ), )); @@ -2915,4 +2975,4 @@ class _empDetailsState extends State { return cards; } -} \ No newline at end of file +} diff --git a/lib/pages/enrollment/empReview.dart b/lib/pages/enrollment/empReview.dart index 1c86992..5bff0ff 100755 --- a/lib/pages/enrollment/empReview.dart +++ b/lib/pages/enrollment/empReview.dart @@ -42,7 +42,7 @@ class _empReviewDetailsState extends State { bool topUpSiIsChecked = false; // Declare the _isSwitched variable here bool topUpParentIsChecked = false; // Declare the _isSwitched variable here bool addOnsDependentIsChecked = - false; // Declare the _isSwitched variable here + false; // Declare the _isSwitched variable here dynamic _token; dynamic enrollmentEmpCodeString; @@ -168,7 +168,7 @@ class _empReviewDetailsState extends State { bool gpahasPremiumSummary = false; bool gmchasPremiumSummary = false; List> allDisclaimer = - []; // Declare this to store all disclaimers + []; // Declare this to store all disclaimers late List checkboxValues; bool isTokenAvailable = false; bool isEnrollCompletedStatus = false; @@ -192,7 +192,8 @@ class _empReviewDetailsState extends State { Future getTokenStatus() async { // final SharedPreferences prefs = await SharedPreferences.getInstance(); setState(() async { - isTokenAvailable = (await TokenService.getPostToken())?.isNotEmpty ?? false; + isTokenAvailable = + (await TokenService.getPostToken())?.isNotEmpty ?? false; }); } @@ -206,7 +207,7 @@ class _empReviewDetailsState extends State { DateTime dateTime = DateFormat('dd-MM-yyyy').parse(inputDate); // Format the date to the desired format - String formattedDate = DateFormat('dd MMM yyyy').format(dateTime); + String formattedDate = DateFormat('dd-MM-yyyy').format(dateTime); return formattedDate; } @@ -218,7 +219,7 @@ class _empReviewDetailsState extends State { if (token != null && token.isNotEmpty) { selfEmpStatus = prefs.getString('selfEmpStatus'); enrollmentEmpClientBranchId = session.enrollmentEmpClientBranchId; - enrollmentEmpCodeString =session.enrollmentEmpCodeString; + enrollmentEmpCodeString = session.enrollmentEmpCodeString; print(enrollmentEmpCodeString); // Check if emp_code is correct enrollmentEmpPrimaryId = session.enrollmentEmpPrimaryId; enrollmentGpaEmpName = session.enrollmentGpaEmpName; @@ -311,7 +312,7 @@ class _empReviewDetailsState extends State { Map firstSiParentData = siParentDataList.first; // Get the value of topUpSiPremiumValue topUpParentSiPremiumValue = - firstSiParentData['topUpParentSiPremiumValue']; + firstSiParentData['topUpParentSiPremiumValue']; topUpParentSiPremiumGst = firstSiParentData['topUpParentSiPremiumGst']; topUpParentSiTotalAmt = firstSiParentData['topUpParentSiTotalAmt']; } @@ -330,13 +331,13 @@ class _empReviewDetailsState extends State { // Get the value of topUpSiPremiumValue print('150000000000'); addOnDependentPremiumValue = - firstDependentListData['addOnDependentPremiumValue']; + firstDependentListData['addOnDependentPremiumValue']; print(addOnDependentPremiumValue); addOnsDependentPremiumGst = - firstDependentListData['addOnsDependentPremiumGst']; + firstDependentListData['addOnsDependentPremiumGst']; print(addOnsDependentPremiumGst); addOnsDependentTotalAmt = - firstDependentListData['addOnsDependentTotalAmt']; + firstDependentListData['addOnsDependentTotalAmt']; print(addOnsDependentTotalAmt); } } @@ -380,7 +381,9 @@ class _empReviewDetailsState extends State { // } final empClientId = await session.client_id; final empClientBranchId = await session.empClientBranchId; - final response = await apiService.getClientLogoAndDetailsToApi(empClientId,empClientBranchId, + final response = await apiService.getClientLogoAndDetailsToApi( + empClientId, + empClientBranchId, enrollmentClient_id!, enrollmentEmpClientBranchId!); if (response['status'] == 'success') { @@ -452,11 +455,11 @@ class _empReviewDetailsState extends State { newEntries.addAll( List>.from( disclaimer.map((text) => { - 'id': allDisclaimer.length + newEntries.length + 1, - 'text': text, - 'checked': false, - 'type': item['type'] - }), + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + 'type': item['type'] + }), ), ); } else { @@ -539,11 +542,11 @@ class _empReviewDetailsState extends State { newEntries.addAll( List>.from( disclaimer.map((text) => { - 'id': allDisclaimer.length + newEntries.length + 1, - 'text': text, - 'checked': false, - 'type': item['type'] - }), + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + 'type': item['type'] + }), ), ); } else { @@ -597,10 +600,10 @@ class _empReviewDetailsState extends State { if (topUpSiPolicies.isNotEmpty) { // setState(() { topUpClientPolicyId = - topUpSiPolicies['gmc_si_topup']['client_policy_id']; + topUpSiPolicies['gmc_si_topup']['client_policy_id']; topUpSumInsured = topUpSiPolicies['gmc_si_topup'] - ['family_floaters_of_only_si_value']; + ['family_floaters_of_only_si_value']; print(topUpSumInsured); if (topUpSumInsured == 0) { @@ -610,37 +613,37 @@ class _empReviewDetailsState extends State { } topUpOpenForEnrollment = - topUpSiPolicies['gmc_si_topup']['OpenForEnrollment']; + topUpSiPolicies['gmc_si_topup']['OpenForEnrollment']; topUpPolicyName = - await topUpSiPolicies['gmc_si_topup']['policy_name']; + await topUpSiPolicies['gmc_si_topup']['policy_name']; topUpPolicyType = await topUpSiPolicies['gmc_si_topup']['type']; topUpMappedFamilyFloatersSiArray = topUpSiPolicies['gmc_si_topup'] - ['family_floaters_of_only_si_array']; + ['family_floaters_of_only_si_array']; print('topUpMappedFamilyFloatersSiArray'); print(topUpMappedFamilyFloatersSiArray); topUpTypeName = topUpSiPolicies['gmc_si_topup']['type']; topUpFloaterTextHeading = - topUpSiPolicies['gmc_si_topup']['floter_text_heading']; + topUpSiPolicies['gmc_si_topup']['floter_text_heading']; topUpECardDownload = - topUpSiPolicies['gmc_si_topup']['eCardDownload']; + topUpSiPolicies['gmc_si_topup']['eCardDownload']; setState(() { - topUpIsPremiumSummary = topUpSiPolicies['gmc_si_topup']['is_premium_summery']; + topUpIsPremiumSummary = + topUpSiPolicies['gmc_si_topup']['is_premium_summery']; }); - // if(topUpIsPremiumSummary == '1'){ // tabHide = '0'; // } topUpDisclaimer = - await topUpSiPolicies['gmc_si_topup']['disclaimer']; + await topUpSiPolicies['gmc_si_topup']['disclaimer']; if (topUpOpenForEnrollment == '1' && activeSiData == 1) { if (topUpDisclaimer != null && topUpDisclaimer.isNotEmpty) { @@ -660,11 +663,11 @@ class _empReviewDetailsState extends State { newEntries.addAll( List>.from( topUpDisclaimer.map((text) => { - 'id': allDisclaimer.length + newEntries.length + 1, - 'text': text, - 'checked': false, - 'type': topUpTypeName - }), + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + 'type': topUpTypeName + }), ), ); } else { @@ -724,43 +727,44 @@ class _empReviewDetailsState extends State { }); if (topUpSiParentPolicies.isNotEmpty) { topUpParentClientPolicyId = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['client_policy_id']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['client_policy_id']; topUpParentSlabRates = - await topUpSiParentPolicies['gmc_si_parent_topup']['SlabRates']; + await topUpSiParentPolicies['gmc_si_parent_topup']['SlabRates']; print('topUpParentSlabRates'); print(topUpParentSlabRates); topUpParentPolicyName = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['policy_name']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['policy_name']; topUpParentPolicyType = - await topUpSiParentPolicies['gmc_si_parent_topup']['type']; + await topUpSiParentPolicies['gmc_si_parent_topup']['type']; topUpParentFamilyFloater = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['policy_terms']['family_floater']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['policy_terms']['family_floater']; print('topUpParentFamilyFloater'); print(topUpParentFamilyFloater); topUpParentMappedFamilyFloatersSi = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['family_floaters_of_only_si_array']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['family_floaters_of_only_si_array']; print('topUpParentMappedFamilyFloatersSi'); print(topUpParentMappedFamilyFloatersSi); print('topUpECardDownload'); topUpParentECardDownload = - topUpSiParentPolicies['gmc_si_parent_topup']['eCardDownload']; + topUpSiParentPolicies['gmc_si_parent_topup']['eCardDownload']; setState(() { - topUpParentIsPremiumSummary = topUpSiParentPolicies['gmc_si_parent_topup']['is_premium_summery']; + topUpParentIsPremiumSummary = + topUpSiParentPolicies['gmc_si_parent_topup'] + ['is_premium_summery']; print(topUpParentECardDownload); }); - // if(topUpParentIsPremiumSummary == '1'){ // tabHide = '0'; // } @@ -771,15 +775,15 @@ class _empReviewDetailsState extends State { // print(topUpParentOpenForEnrollment); topUpParentTypeName = - topUpSiParentPolicies['gmc_si_parent_topup']['type']; + topUpSiParentPolicies['gmc_si_parent_topup']['type']; topUpParentFloterTextHeading = - topUpSiParentPolicies['gmc_si_parent_topup'] - ['floter_text_heading']; + topUpSiParentPolicies['gmc_si_parent_topup'] + ['floter_text_heading']; topUpParentSiValue = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['family_floaters_of_only_si_value']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['family_floaters_of_only_si_value']; if (topUpParentSiValue == 0) { showHideTopUpParentCard = 0; @@ -788,12 +792,12 @@ class _empReviewDetailsState extends State { } topUpParentOpenForEnrollment = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['OpenForEnrollment']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['OpenForEnrollment']; topUpParentDisclaimer = - await topUpSiParentPolicies['gmc_si_parent_topup'] - ['disclaimer']; + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['disclaimer']; if (topUpParentOpenForEnrollment == '1' && activeSiParentData == 1) { @@ -815,11 +819,11 @@ class _empReviewDetailsState extends State { newEntries.addAll( List>.from( topUpParentDisclaimer.map((text) => { - 'id': allDisclaimer.length + newEntries.length + 1, - 'text': text, - 'checked': false, - 'type': topUpParentTypeName - }), + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + 'type': topUpParentTypeName + }), ), ); } else { @@ -874,18 +878,18 @@ class _empReviewDetailsState extends State { print(addOnsDependentPolicies); if (addOnsDependentPolicies.isNotEmpty) { addOnsDependentClientPolicyId = - addOnsDependentPolicies['gmc_dependent_addon'] - ['client_policy_id']; + addOnsDependentPolicies['gmc_dependent_addon'] + ['client_policy_id']; print(addOnsDependentClientPolicyId); addOnsDependentSumInsured = int.parse( addOnsDependentPolicies['gmc_dependent_addon'] - ['family_floaters_of_dependent_and_si_value'] + ['family_floaters_of_dependent_and_si_value'] .toString()); print('addOnsDependentSumInsured $addOnsDependentSumInsured'); var value = int.parse(addOnsDependentPolicies['gmc_dependent_addon'] - ['family_floaters_of_dependent_and_si_premium_value'] + ['family_floaters_of_dependent_and_si_premium_value'] .toString()); print(value); @@ -904,37 +908,39 @@ class _empReviewDetailsState extends State { // } addOnsDependentPolicyName = - addOnsDependentPolicies['gmc_dependent_addon']['policy_name']; + addOnsDependentPolicies['gmc_dependent_addon']['policy_name']; print(addOnsDependentPolicyName); addOnsDependentPolicyType = - addOnsDependentPolicies['gmc_dependent_addon']['type']; + addOnsDependentPolicies['gmc_dependent_addon']['type']; print(addOnsDependentPolicyType); addOnsDependentMappedFamilyFloatersArray = - await addOnsDependentPolicies['gmc_dependent_addon'] - ['family_floaters_of_dependent_and_si_array']; + await addOnsDependentPolicies['gmc_dependent_addon'] + ['family_floaters_of_dependent_and_si_array']; print('addOnsDependentMappedFamilyFloatersArray'); print(addOnsDependentMappedFamilyFloatersArray); addOnsFloaterTextHeading = - addOnsDependentPolicies['gmc_dependent_addon'] - ['floter_text_heading']; + addOnsDependentPolicies['gmc_dependent_addon'] + ['floter_text_heading']; addOnsDependentECardDownload = - addOnsDependentPolicies['gmc_dependent_addon']['eCardDownload']; + addOnsDependentPolicies['gmc_dependent_addon']['eCardDownload']; addOnsDependentDisclaimer = - await addOnsDependentPolicies['gmc_dependent_addon'] - ['disclaimer']; + await addOnsDependentPolicies['gmc_dependent_addon'] + ['disclaimer']; print( 'addOnsDependentOpenForEnrollment $addOnsDependentDisclaimer'); addOnsDependentOpenForEnrollment = - await addOnsDependentPolicies['gmc_dependent_addon'] - ['OpenForEnrollment']; + await addOnsDependentPolicies['gmc_dependent_addon'] + ['OpenForEnrollment']; setState(() { - addOnsDependentIsPremiumSummary = addOnsDependentPolicies['gmc_dependent_addon']['is_premium_summery']; + addOnsDependentIsPremiumSummary = + addOnsDependentPolicies['gmc_dependent_addon'] + ['is_premium_summery']; }); // if(addOnsDependentIsPremiumSummary == '1'){ @@ -964,11 +970,11 @@ class _empReviewDetailsState extends State { newEntries.addAll( List>.from( addOnsDependentDisclaimer.map((text) => { - 'id': allDisclaimer.length + newEntries.length + 1, - 'text': text, - 'checked': false, - 'type': addOnsDependentPolicyType - }), + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + 'type': addOnsDependentPolicyType + }), ), ); } else { @@ -1124,7 +1130,7 @@ class _empReviewDetailsState extends State { // Wait 3 seconds, then navigate to home page Future.delayed(const Duration(seconds: 3), () { - if(isTokenAvailable) { + if (isTokenAvailable) { context.go('/home'); // Navigator.pushNamed(context, 'home'); } else { @@ -1300,11 +1306,11 @@ class _empReviewDetailsState extends State { 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( @@ -1327,7 +1333,7 @@ class _empReviewDetailsState extends State { ), 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( @@ -1370,1737 +1376,2008 @@ class _empReviewDetailsState extends State { context.go('/addOnsDetails'); }, child: Scaffold( - appBar: CustomAppBar(), - body: SingleChildScrollView( - child: Container( - color: Color(0xFFEFF3F6), - child: Column( - children: [ - Center( - child: Text('No Data Available', - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.bold, - )), - ) - ], - ), - ), - )) - ); + appBar: CustomAppBar(), + body: SingleChildScrollView( + child: Container( + color: Color(0xFFEFF3F6), + child: Column( + children: [ + Center( + child: Text('No Data Available', + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.bold, + )), + ) + ], + ), + ), + ))); } else { - return isEnrollCompletedStatus == true ? PopScope( - canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop) return; - _showExitConfirmation(context); - }, - child: Scaffold( - backgroundColor: const Color(0xFFF2F6FA), // Matches your light gray background - appBar: CustomAppBar(), - body: Center( - 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( - mainAxisSize: MainAxisSize.min, // Shrink wrap to content - children: [ - SizedBox(height: 20), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.network( - clientLogo ?? '', // Nhance logo - height: 40, - ), - // Image.network( - // 'https://i.imgur.com/qOihOvk.png', // Prodapt logo - // height: 28, - // ), - ], - ), - SizedBox(height: 32), - Icon(Icons.check_circle, size: 70, color: Color(0xFF1A73E8)), - SizedBox(height: 24), - Text( - 'Congratulations!', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Color(0xFF2D2A4A), - ), - ), - SizedBox(height: 12), - Text( - 'You have completed your enrolment. You can now close this tab', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 16, - color: Color(0xFF2D2A4A), - ), - ), - // const SizedBox(height: 12), - Container( - width: 180, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: () => { - if(isTokenAvailable) { - context.go('/home') - // Navigator.pushNamed(context, 'home') - } else { - context.go('/empDetails') - // Navigator.pushNamed(context, 'empDetails') - } - - }, - child: Text( - 'Return to Home', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - ), - ), - ), - ), - // const SizedBox(height: 20), - ], - ), - ), - ), - floatingActionButtonLocation: Responsive.isDesktop(context) - ? null - : isTokenAvailable - ? FloatingActionButtonLocation.miniEndFloat - : null, - bottomNavigationBar: Responsive.isDesktop(context) - ? null - : CustomBottomNavigationBar( - onTabChanged: (index) { - // Add your navigation logic here - // For example: - if (index == 0) { - context.go('/home'); - // Navigator.pushNamed(context, 'home'); - } else if (index == 1) { - context.go('/claims'); - // Navigator.pushNamed(context, 'claims'); - } else if (index == 2) { - context.go('/profile'); - // Navigator.pushNamed(context, 'profile'); - } else if (index == 3) { - context.go('/help'); - // Navigator.pushNamed(context, 'help'); - } else if (index == 4) { - context.go('/wellness'); - // Navigator.pushNamed(context, 'wellness'); - } - }, - 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: - 0, // Initial index of the bottom navigation bar - ), - )) : PopScope( - canPop: false, - onPopInvokedWithResult: (didPop, result) { - if (didPop) return; - context.go('/addOnsDetails'); - }, - 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: Color(0xFFEFF3F6), - child: Column( - children: [ - Card( - elevation: 0, + return isEnrollCompletedStatus == true + ? PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop) return; + _showExitConfirmation(context); + }, + child: Scaffold( + backgroundColor: const Color( + 0xFFF2F6FA), // Matches your light gray background + appBar: CustomAppBar(), + body: Center( + 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: Container( - width: double.infinity, - height: 80, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, - bottom: 12, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 200, - height: 200, - alignment: Alignment.centerLeft, - child: Image.network( - clientLogo ?? '', - // width: 200, // Set the width here - // height: 200, // Set the height here - loadingBuilder: (BuildContext context, - Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - value: - loadingProgress.expectedTotalBytes != - null - ? loadingProgress - .cumulativeBytesLoaded / - loadingProgress - .expectedTotalBytes! - : null, - ), - ); - }, - errorBuilder: (BuildContext context, - Object error, StackTrace? stackTrace) { - return Image.asset( - 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - width: 80, - height: 80, - fit: BoxFit.cover, - ); - }, + child: Column( + mainAxisSize: MainAxisSize.min, // Shrink wrap to content + children: [ + SizedBox(height: 20), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.network( + clientLogo ?? '', // Nhance logo + height: 40, + ), + // Image.network( + // 'https://i.imgur.com/qOihOvk.png', // Prodapt logo + // height: 28, + // ), + ], + ), + SizedBox(height: 32), + Icon(Icons.check_circle, + size: 70, color: Color(0xFF1A73E8)), + SizedBox(height: 24), + Text( + 'Congratulations!', + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Color(0xFF2D2A4A), + ), + ), + SizedBox(height: 12), + Text( + 'You have completed your enrolment. You can now close this tab', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + color: Color(0xFF2D2A4A), + ), + ), + // const SizedBox(height: 12), + Container( + width: 180, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: () => { + if (isTokenAvailable) + { + context.go('/home') + // Navigator.pushNamed(context, 'home') + } + else + { + context.go('/empDetails') + // Navigator.pushNamed(context, 'empDetails') + } + }, + child: Text( + 'Return to Home', + style: GoogleFonts.poppins(color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), ), ), ), - Expanded( - flex: 9, - child: Text( - clientName ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 20 : 18, - fontWeight: FontWeight.w600, + ), + // const SizedBox(height: 20), + ], + ), + ), + ), + floatingActionButtonLocation: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? FloatingActionButtonLocation.miniEndFloat + : null, + bottomNavigationBar: Responsive.isDesktop(context) + ? null + : CustomBottomNavigationBar( + onTabChanged: (index) { + // Add your navigation logic here + // For example: + if (index == 0) { + context.go('/home'); + // Navigator.pushNamed(context, 'home'); + } else if (index == 1) { + context.go('/claims'); + // Navigator.pushNamed(context, 'claims'); + } else if (index == 2) { + context.go('/profile'); + // Navigator.pushNamed(context, 'profile'); + } else if (index == 3) { + context.go('/help'); + // Navigator.pushNamed(context, 'help'); + } else if (index == 4) { + context.go('/wellness'); + // Navigator.pushNamed(context, 'wellness'); + } + }, + 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: + 0, // Initial index of the bottom navigation bar + ), + )) + : PopScope( + canPop: false, + onPopInvokedWithResult: (didPop, result) { + if (didPop) return; + context.go('/addOnsDetails'); + }, + 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: Color(0xFFEFF3F6), + child: Column( + children: [ + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 80, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, + bottom: 12, + left: 10, + right: + 10), // Add padding to the container + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 200, + height: 200, + alignment: Alignment.centerLeft, + child: Image.network( + clientLogo ?? '', + // width: 200, // Set the width here + // height: 200, // Set the height here + loadingBuilder: (BuildContext context, + Widget child, + ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) + return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress + .expectedTotalBytes != + null + ? loadingProgress + .cumulativeBytesLoaded / + loadingProgress + .expectedTotalBytes! + : null, + ), + ); + }, + errorBuilder: (BuildContext context, + Object error, + StackTrace? stackTrace) { + return Image.asset( + 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + width: 80, + height: 80, + fit: BoxFit.cover, + ); + }, + ), + ), + ), + Expanded( + flex: 9, + child: Text( + clientName ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) + ? 20 + : 18, + fontWeight: FontWeight.w600, + ), + ), + ) + ], ), ), - ) + ), + SizedBox(height: 16), + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == true || + topUpIsPremiumSummary == '1' || + topUpParentIsPremiumSummary == '1' || + addOnsDependentIsPremiumSummary == '1') + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all( + 10), // Add padding to the container + child: Column(children: [ + Row( + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Review', + textAlign: TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 18, + color: + Color(0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + Row( + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: + Color(0xFF181818), + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + '₹${allTotalSum()}/Year', + textAlign: TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 22 + : 18, + color: + Color(0xFFE26728), + fontWeight: + FontWeight.w500, + ), + ), + ], + ))), + ], + ), + ])), + ), + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == true || + topUpIsPremiumSummary == '1' || + topUpParentIsPremiumSummary == '1' || + addOnsDependentIsPremiumSummary == '1') + SizedBox(height: 16), + if (gpaPolicies != null && gpaPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateGpaCards(gpaPolicies), + ], + ), + SizedBox(height: 16), + if (gmcPolicies != null && gmcPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateGmcCards(gmcPolicies), + ], + ), + SizedBox(height: 16), + if (showHideAddOnsCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + 'Add Ons', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 9 + : 7, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + ), + ), + Row( + children: [ + Text( + Responsive.isDesktop( + context) + ? addOnsDependentPolicyName + : addOnsDependentPolicyType, + textAlign: + TextAlign + .left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight + .w600, + ), + ), + if (addOnsDependentECardDownload != + null) + GestureDetector( + onTap: + () async { + _launchURL( + addOnsDependentECardDownload); + }, + child: + MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: Responsive.isDesktop( + context) + ? 3 + : 5, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Text( + addOnsFloaterTextHeading ?? + '', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${addOnsDependentSumInsured != null ? addOnsDependentSumInsured : 'NA'}', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, + bottom: 0, + left: 5, + right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + addOnsDependentMappedFamilyFloatersArray + .where((item) => + item['is_value_exist'] == + true) + .map((item) { + Map data = + item['data']; + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} - ${data['relationship']} - ${data['dob']}', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox(height: showHideAddOnsCard == 1 ? 16 : 0), + if (showHideTopUpCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + 'Add Ons', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 9 + : 7, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 13, + ), + ), + Row( + children: [ + Text( + Responsive.isDesktop( + context) + ? topUpPolicyName + : topUpPolicyType, + textAlign: + TextAlign + .left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 14, + fontWeight: + FontWeight + .w600, + ), + ), + if (topUpECardDownload != + null) + GestureDetector( + onTap: + () async { + _launchURL( + topUpECardDownload); + }, + child: + MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: Responsive.isDesktop( + context) + ? 3 + : 5, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Text( + topUpFloaterTextHeading ?? + '', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 13, + ), + ), + Text( + '₹ ${topUpSumInsured != null ? topUpSumInsured : 'NA'}', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 14, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, + bottom: 0, + left: 5, + right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + topUpMappedFamilyFloatersSiArray + .where((item) => + item['is_value_exist'] == + true) + .map((item) { + Map data = + item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), + if (showHideTopUpParentCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + 'Add Ons', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 9 + : 7, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 13, + ), + ), + Container( + // padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Flexible( + child: Text( + Responsive.isDesktop( + context) + ? topUpParentPolicyName + : topUpParentPolicyType, + textAlign: + TextAlign + .left, + style: GoogleFonts + .poppins( + fontSize: + Responsive.isDesktop(context) + ? 20 + : 14, + fontWeight: + FontWeight + .w600, + ), + softWrap: + true, + overflow: + TextOverflow + .visible, + ), + ), + if (topUpParentECardDownload != + null) + GestureDetector( + onTap: + () async { + _launchURL( + topUpParentECardDownload); + }, + child: + MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ) + ], + ))), + Expanded( + flex: Responsive.isDesktop( + context) + ? 3 + : 5, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Text( + topUpParentFloterTextHeading ?? + '', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 13, + ), + ), + Text( + '₹ ${topUpParentSiValue != null ? topUpParentSiValue : 'NA'}', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 14, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, + bottom: 0, + left: 5, + right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + topUpParentMappedFamilyFloatersSi + .where((item) => + item['is_value_exist'] == + true) + .map((item) { + Map data = + item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox( + height: showHideTopUpParentCard == 1 ? 16 : 0), + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == true || + topUpIsPremiumSummary == '1' || + topUpParentIsPremiumSummary == '1' || + addOnsDependentIsPremiumSummary == '1') + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + 'Premium Summary', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment + .centerLeft, // Adjust padding as needed + child: Table( + columnWidths: { + 0: FlexColumnWidth( + 2), // Adjust column width as needed + 1: FlexColumnWidth(2), + 2: FlexColumnWidth( + 2), // Adjust column width as needed + 3: FlexColumnWidth(2), + }, + children: [ + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == + true || + topUpIsPremiumSummary == + '1' || + topUpParentIsPremiumSummary == + '1' || + addOnsDependentIsPremiumSummary == + '1') + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + 'Policy ', + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + 'Additional Premium', + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + 'GST', + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + 'Total', + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + ], + ), + if (gpaPolicies != null && + gpaPolicies.length > 0) + ...gpaBuildPolicyRows( + gpaPolicies, context), + if (gmcPolicies != null && + gmcPolicies.length > 0) + ...gmcBuildPolicyRows( + gmcPolicies, context), + if (activeSiData == 1 && + topUpIsPremiumSummary == + '1') + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + (Responsive.isDesktop( + context) + ? (topUpPolicyName ?? + 'Default Top Up Name') + : 'GMC - Top Up'), + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpSiPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpSiPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpSiTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + ], + ), + if (activeSiParentData == + 1 && + topUpParentIsPremiumSummary == + '1') + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + (Responsive.isDesktop( + context) + ? (topUpParentPolicyName ?? + 'Default Parent Top Up Name') + : 'GMC - Parents Top Up'), + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpParentSiPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpParentSiPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$topUpParentSiTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + ], + ), + if (activeDependentData == + 1 && + addOnsDependentIsPremiumSummary == + '1') + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + Responsive.isDesktop( + context) + ? (addOnsDependentPolicyName ?? + 'Default Add Dependent Up Name') + : 'GMC - Dependent', + textAlign: + TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$addOnDependentPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$addOnsDependentPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets + .all(8.0), + child: Text( + '₹$addOnsDependentTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign + .start + : TextAlign + .start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 14 + : 12), + ), + ), + ), + ], + ), + ], + ), + )) + ], + ), + ), + SizedBox(height: 10), + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == true || + topUpIsPremiumSummary == '1' || + topUpParentIsPremiumSummary == '1' || + addOnsDependentIsPremiumSummary == '1') + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + color: Color( + 0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Text( + '₹${allTotalSum()}/Year', + textAlign: + TextAlign.right, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFFE26728), + fontWeight: + FontWeight.w500, + ), + ), + ], + ))) + ], + ), + ), + SizedBox(height: 15), + Container( + alignment: Alignment.topLeft, + child: Row( + crossAxisAlignment: CrossAxisAlignment + .start, // Aligns top + children: [ + Checkbox( + value: isChecked, + onChanged: (bool? value) { + setState(() { + isChecked = value!; + }); + }, + activeColor: + const Color(0xFFE26728), + ), + Expanded( + child: Text( + 'I declare that the information I have provided is true and accurate to the best of my knowledge', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 15, + color: const Color(0xFF292929), + ), + ), + ), + ], + ), + ), + SizedBox( + height: Responsive.isDesktop(context) + ? 15 + : 10), + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: allDisclaimer.isEmpty + ? [] // If allDisclaimer is empty, show nothing + : allDisclaimer + .map((entry) { + int id = entry[ + 'id']; // ID of disclaimer + String disclaimer = entry[ + 'text']; // Disclaimer text + bool isChecked = entry[ + 'checked']; // Checked state + + return Padding( + padding: const EdgeInsets + .only( + bottom: + 12.0), // spacing between disclaimers + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, // Align top + children: [ + Checkbox( + value: + isChecked, // Bind to the checked value + onChanged: + (bool? value) { + setState(() { + // Update the checked status + allDisclaimer + .firstWhere( + (item) => + item['id'] == + id, + )['checked'] = + value!; + print( + allDisclaimer); + }); + }, + activeColor: const Color( + 0xFFE26728), // Custom color + ), + Expanded( + child: Text( + disclaimer, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 15, + color: const Color( + 0xFF292929), + ), + ), + ), + ], + ), + ); + }).toList(), + ), + ), + SizedBox( + height: Responsive.isDesktop(context) + ? 15 + : 0), + Container( + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: Responsive.isDesktop( + context) + ? 150 + : 100, + alignment: Alignment.centerLeft, + child: ElevatedButton( + onPressed: () async { + // Remove siData, siParentData, and dependentData from local storage + final SharedPreferences + prefs = + await SharedPreferences + .getInstance(); + prefs.remove('siData'); + prefs + .remove('siParentData'); + prefs.remove( + 'dependentData'); + context + .go('/addOnsDetails'); + // Navigator.pushNamed( + // context, 'addOnsDetails'); + }, + child: Text( + 'Back', + style: GoogleFonts.poppins( + color: + Color(0xFFE26728)), + ), + style: + ElevatedButton.styleFrom( + backgroundColor: + Colors.white, + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5), + side: BorderSide( + color: Color( + 0xFFE26728)), + ), + ), + ), + )), + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: + Alignment.centerRight, + child: ElevatedButton( + onPressed: isSubmitEnabled() + ? sendAddOnAPI + : null, + child: Text( + 'Submit', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: + ElevatedButton.styleFrom( + backgroundColor: + Color(0xFFE26728), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5), + ), + ), + ), + )), + ], + ), + ), + ], + ), + )), + SizedBox(height: 30) ], ), ), ), - SizedBox(height: 16), - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - Card( - elevation: 0, - color: Colors.white, + 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) || + (!Responsive.isDesktop(context) && !isTokenAvailable)) + Align( + alignment: Alignment.bottomCenter, child: Container( - width: double.infinity, - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all( - 10), // Add padding to the container - child: Column(children: [ - Row( - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Review', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 20 - : 18, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - - Row( - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF181818), - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '₹${allTotalSum()}/Year', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 22 - : 18, - color: Color(0xFFE26728), - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - ], - ), - ])), + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), ), - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - SizedBox(height: 16), - if (gpaPolicies != null && gpaPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateGpaCards(gpaPolicies), - ], - ), - SizedBox(height: 16), - if (gmcPolicies != null && gmcPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateGmcCards(gmcPolicies), - ], - ), - SizedBox(height: 16), - if (showHideAddOnsCard == 1) - Card( - elevation: 0, - color: Colors.white, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, - bottom: 15, - left: 25, - right: 25) - : EdgeInsets.only( - top: 10, - bottom: 10, - left: 10, - right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 9 - : 7, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( - children: [ - Text( - Responsive.isDesktop( - context) - ? addOnsDependentPolicyName - : addOnsDependentPolicyType, - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (addOnsDependentECardDownload != - null) - GestureDetector( - onTap: () async { - _launchURL( - addOnsDependentECardDownload); - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: Color( - 0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: Responsive.isDesktop(context) - ? 3 - : 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - addOnsFloaterTextHeading ?? - '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${addOnsDependentSumInsured != null ? addOnsDependentSumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: - addOnsDependentMappedFamilyFloatersArray - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: Color( - 0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} - ${data['relationship']} - ${data['dob']}', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 14, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), + ]), + // floatingActionButton: Responsive.isDesktop(context) + // ? null + // : isTokenAvailable + // ? FloatingActionButton( + // onPressed: () => Navigator.push( + // context, + // MaterialPageRoute(builder: (context) => chatbot()), + // ), + // child: Icon(Icons.chat), + // ) + // : null, + floatingActionButtonLocation: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? FloatingActionButtonLocation.miniEndFloat + : null, + bottomNavigationBar: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? CustomBottomNavigationBar( + onTabChanged: (index) { + // Add your navigation logic here + // For example: + if (index == 0) { + context.go('/home'); + // Navigator.pushNamed(context, 'home'); + } else if (index == 1) { + context.go('/claims'); + // Navigator.pushNamed(context, 'claims'); + } else if (index == 2) { + context.go('/profile'); + // Navigator.pushNamed(context, 'profile'); + } else if (index == 3) { + context.go('/help'); + // Navigator.pushNamed(context, 'help'); + } else if (index == 4) { + context.go('/wellness'); + // Navigator.pushNamed(context, 'wellness'); + } + }, + icons: [ + Icons.home_outlined, + Icons.sticky_note_2_outlined, + Icons.person_outline_outlined, + Icons.headset_mic_outlined, + Icons.health_and_safety_outlined, ], - ), - )), - SizedBox(height: showHideAddOnsCard == 1 ? 16 : 0), - if (showHideTopUpCard == 1) - Card( - elevation: 0, - color: Colors.white, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, - bottom: 15, - left: 25, - right: 25) - : EdgeInsets.only( - top: 10, - bottom: 10, - left: 10, - right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 9 - : 7, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 13, - ), - ), - Row( - children: [ - Text( - Responsive.isDesktop( - context) - ? topUpPolicyName - : topUpPolicyType, - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 14, - fontWeight: - FontWeight.w600, - ), - ), - if (topUpECardDownload != - null) - GestureDetector( - onTap: () async { - _launchURL( - topUpECardDownload); - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: Color( - 0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: Responsive.isDesktop(context) - ? 3 - : 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - topUpFloaterTextHeading ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 13, - ), - ), - Text( - '₹ ${topUpSumInsured != null ? topUpSumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 14, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: topUpMappedFamilyFloatersSiArray - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: Color( - 0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 14, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), + labels: [ + "Home", + "Claims", + "Profile", + "Help", + "wellness", ], - ), - )), - SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), - if (showHideTopUpParentCard == 1) - Card( - elevation: 0, - color: Colors.white, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, - bottom: 15, - left: 25, - right: 25) - : EdgeInsets.only( - top: 10, - bottom: 10, - left: 10, - right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 9 - : 7, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 13, - ), - ), - Container( - // padding: EdgeInsets.all(8.0), - child: Row( - children: [ - Flexible( - child: Text( - Responsive.isDesktop( - context) - ? topUpParentPolicyName - : topUpParentPolicyType, - textAlign: - TextAlign.left, - style: GoogleFonts - .poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 14, - fontWeight: - FontWeight.w600, - ), - softWrap: true, - overflow: TextOverflow - .visible, - ), - ), - if (topUpParentECardDownload != - null) - GestureDetector( - onTap: () async { - _launchURL( - topUpParentECardDownload); - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons - .file_download, - color: Color( - 0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ) - ], - ))), - Expanded( - flex: Responsive.isDesktop(context) - ? 3 - : 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - topUpParentFloterTextHeading ?? - '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 13, - ), - ), - Text( - '₹ ${topUpParentSiValue != null ? topUpParentSiValue : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 14, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: topUpParentMappedFamilyFloatersSi - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: Color( - 0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 14, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), - ], - ), - )), - SizedBox(height: showHideTopUpParentCard == 1 ? 16 : 0), - Card( - elevation: 0, - color: Colors.white, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Premium Summary', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment - .centerLeft, // Adjust padding as needed - child: Table( - columnWidths: { - 0: FlexColumnWidth( - 2), // Adjust column width as needed - 1: FlexColumnWidth(2), - 2: FlexColumnWidth( - 2), // Adjust column width as needed - 3: FlexColumnWidth(2), - }, - children: [ - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - 'Policy ', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - 'Additional Premium', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - 'GST', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - 'Total', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - ], - ), - if (gpaPolicies != null && - gpaPolicies.length > 0) - ...gpaBuildPolicyRows( - gpaPolicies, context), - if (gmcPolicies != null && - gmcPolicies.length > 0) - ...gmcBuildPolicyRows( - gmcPolicies, context), - if (activeSiData == 1 && topUpIsPremiumSummary == '1') - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - (Responsive.isDesktop( - context) - ? (topUpPolicyName ?? - 'Default Top Up Name') - : 'GMC - Top Up'), - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiPremiumValue/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiPremiumGst/-', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiTotalAmt/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - if (activeSiParentData == 1 && topUpParentIsPremiumSummary == '1') - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - (Responsive.isDesktop( - context) - ? (topUpParentPolicyName ?? - 'Default Parent Top Up Name') - : 'GMC - Parents Top Up'), - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiPremiumValue/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiPremiumGst/-', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiTotalAmt/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - if (activeDependentData == 1 && addOnsDependentIsPremiumSummary == '1') - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop( - context) - ? (addOnsDependentPolicyName ?? - 'Default Add Dependent Up Name') - : 'GMC - Dependent', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnDependentPremiumValue/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnsDependentPremiumGst/-', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnsDependentTotalAmt/Year', - textAlign: Responsive - .isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - ], - ), - )) - ], - ), - ), - SizedBox(height:10), - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - '₹${allTotalSum()}/Year', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFFE26728), - fontWeight: FontWeight.w500, - ), - ), - ], - ))) - ], - ), - ), - - SizedBox(height: 15), - Container( - alignment: Alignment.topLeft, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start , // Aligns top - children: [ - Checkbox( - value: isChecked, - onChanged: (bool? value) { - setState(() { - isChecked = value!; - }); - }, - activeColor: const Color(0xFFE26728), - ), - Expanded( - child: Text( - 'I declare that the information I have provided is true and accurate to the best of my knowledge', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 18 : 15, - color: const Color(0xFF292929), - ), - ), - ), - ], - ), - ), - SizedBox( - height: - Responsive.isDesktop(context) ? 15 : 10), - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: allDisclaimer.isEmpty - ? [] // If allDisclaimer is empty, show nothing - : allDisclaimer.map((entry) { - int id = entry['id']; // ID of disclaimer - String disclaimer = entry['text']; // Disclaimer text - bool isChecked = entry['checked']; // Checked state - - return Padding( - padding: const EdgeInsets.only(bottom: 12.0), // spacing between disclaimers - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, // Align top - children: [ - Checkbox( - value: isChecked, // Bind to the checked value - onChanged: (bool? value) { - setState(() { - // Update the checked status - allDisclaimer.firstWhere( - (item) => item['id'] == id, - )['checked'] = value!; - print(allDisclaimer); - }); - }, - activeColor: const Color(0xFFE26728), // Custom color - ), - Expanded( - child: Text( - disclaimer, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 18 : 15, - color: const Color(0xFF292929), - ), - ), - ), - ], - ), - ); - }).toList(), - ), - ), - - SizedBox( - height: Responsive.isDesktop(context) ? 15 : 0), - Container( - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: Responsive.isDesktop(context) - ? 150 - : 100, - alignment: Alignment.centerLeft, - child: ElevatedButton( - onPressed: () async { - // Remove siData, siParentData, and dependentData from local storage - final SharedPreferences prefs = - await SharedPreferences - .getInstance(); - prefs.remove('siData'); - prefs.remove('siParentData'); - prefs.remove('dependentData'); - context.go('/addOnsDetails'); - // Navigator.pushNamed( - // context, 'addOnsDetails'); - }, - child: Text( - 'Back', - style: GoogleFonts.poppins( - color: Color(0xFFE26728)), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - side: BorderSide( - color: Color(0xFFE26728)), - ), - ), - ), - )), - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: isSubmitEnabled() - ? sendAddOnAPI - : null, - child: Text( - 'Submit', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - ), - ), - ), - )), - ], - ), - ), - ], - ), - )), - SizedBox(height: 30) - ], - ), - ), - ), - 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) || - (!Responsive.isDesktop(context) && !isTokenAvailable)) - Align( - alignment: Alignment.bottomCenter, - child: Container( - width: double.infinity, // Make the footer full width - child: CustomFooter(), - ), - ), - ]), - // floatingActionButton: Responsive.isDesktop(context) - // ? null - // : isTokenAvailable - // ? FloatingActionButton( - // onPressed: () => Navigator.push( - // context, - // MaterialPageRoute(builder: (context) => chatbot()), - // ), - // child: Icon(Icons.chat), - // ) - // : null, - floatingActionButtonLocation: Responsive.isDesktop(context) - ? null - : isTokenAvailable - ? FloatingActionButtonLocation.miniEndFloat - : null, - bottomNavigationBar: Responsive.isDesktop(context) - ? null - : isTokenAvailable - ? CustomBottomNavigationBar( - onTabChanged: (index) { - // Add your navigation logic here - // For example: - if (index == 0) { - context.go('/home'); - // Navigator.pushNamed(context, 'home'); - } else if (index == 1) { - context.go('/claims'); - // Navigator.pushNamed(context, 'claims'); - } else if (index == 2) { - context.go('/profile'); - // Navigator.pushNamed(context, 'profile'); - } else if (index == 3) { - context.go('/help'); - // Navigator.pushNamed(context, 'help'); - } else if (index == 4) { - context.go('/wellness'); - // Navigator.pushNamed(context, 'wellness'); - } - }, - 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: - 0, // Initial index of the bottom navigation bar - ) : null, - )); + initialIndex: + 0, // Initial index of the bottom navigation bar + ) + : null, + )); } } @@ -3236,7 +3513,7 @@ class _empReviewDetailsState extends State { textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 20 : 14, + Responsive.isDesktop(context) ? 20 : 14, fontWeight: FontWeight.w600, ), ), @@ -3273,7 +3550,7 @@ class _empReviewDetailsState extends State { textAlign: TextAlign.right, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 18 : 13, + Responsive.isDesktop(context) ? 18 : 13, ), ), Text( @@ -3281,7 +3558,7 @@ class _empReviewDetailsState extends State { textAlign: TextAlign.right, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) ? 20 : 14, + Responsive.isDesktop(context) ? 20 : 14, fontWeight: FontWeight.w600, ), ), @@ -3296,7 +3573,9 @@ class _empReviewDetailsState extends State { Column( children: familyFloaterContainers, ), - if (Responsive.isDesktop(context) && isValueValid && gpaIsPremiumSummery == '1') + if (Responsive.isDesktop(context) && + isValueValid && + gpaIsPremiumSummery == '1') Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -3377,139 +3656,147 @@ class _empReviewDetailsState extends State { ))), ], ), - if (!Responsive.isDesktop(context) && isValueValid && gpaIsPremiumSummery == '1') + if (!Responsive.isDesktop(context) && + isValueValid && + gpaIsPremiumSummery == '1') Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Additional Premium', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'Additional Premium', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaSiPremiumValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + (gpaSiPremiumValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'GST', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'GST', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaGstValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - if(gpahasPremiumSummary == true || gmchasPremiumSummary == true || topUpIsPremiumSummary == '1' || topUpParentIsPremiumSummary == '1' || addOnsDependentIsPremiumSummary == '1') - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + (gpaGstValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + if (gpahasPremiumSummary == true || + gmchasPremiumSummary == true || + topUpIsPremiumSummary == '1' || + topUpParentIsPremiumSummary == '1' || + addOnsDependentIsPremiumSummary == '1') + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - (gpaTotalableValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) + children: [ + Text( + (gpaTotalableValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + ), + ), + ], + ))), + ], + ), + ])) ], ), ), @@ -3534,7 +3821,7 @@ class _empReviewDetailsState extends State { gmcECardDownload = item['eCardDownload']; gmcGstValue = item['family_floaters_of_dependent_and_gst_value']; gmcSiPremiumValue = - item['family_floaters_of_dependent_and_si_premium_value']; + item['family_floaters_of_dependent_and_si_premium_value']; gmcTotalableValue = gmcGstValue + gmcSiPremiumValue; gmcIsValueValid = (gmcSiPremiumValue != 0 && gmcGstValue != 0); setState(() { @@ -3569,244 +3856,248 @@ class _empReviewDetailsState extends State { Widget card = getTrueObjects.length > 0 ? Card( - elevation: 0, - color: Colors.white, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) ? 9 : 7, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 13, - ), - ), - Row( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, bottom: 15, left: 25, right: 25) + : EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop(context) ? 9 : 7, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Text( - Responsive.isDesktop(context) - ? gmcPolicyName - : gmcPolicyType, + '', textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: - Responsive.isDesktop(context) - ? 20 - : 14, + Responsive.isDesktop(context) + ? 18 + : 13, + ), + ), + Row( + children: [ + Text( + Responsive.isDesktop(context) + ? gmcPolicyName + : gmcPolicyType, + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 20 + : 14, + fontWeight: FontWeight.w600, + ), + ), + if (item['eCardDownload'] != null) + GestureDetector( + onTap: () async { + _launchURL( + item['eCardDownload']); + }, + child: MouseRegion( + cursor: + SystemMouseCursors.click, + child: Icon( + Icons.file_download, + color: Color(0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: Responsive.isDesktop(context) ? 3 : 5, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + gmcFloaterTextHeading ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 13, + ), + ), + Text( + '₹ ${gmcSumInsured != null ? gmcSumInsured : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 20 + : 14, fontWeight: FontWeight.w600, ), ), - if (item['eCardDownload'] != null) - GestureDetector( - onTap: () async { - _launchURL( - item['eCardDownload']); - }, - child: MouseRegion( - cursor: - SystemMouseCursors.click, - child: Icon( - Icons.file_download, - color: Color(0xFFE26728), - size: 25, - ), - ), - ), ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, bottom: 0, left: 15, right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: gmcMappedFamilyFloaters + .where((item) => item['is_value_exist'] == true) + .map((item) { + Map data = item['data']; + String formattedDate = formatDate(data['dob']); + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color(0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop(context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 18 : 14, + color: Color(0xFF232526), ), - ], - ))), - Expanded( - flex: Responsive.isDesktop(context) ? 3 : 5, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - gmcFloaterTextHeading ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 13, - ), - ), - Text( - '₹ ${gmcSumInsured != null ? gmcSumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 20 - : 14, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: gmcMappedFamilyFloaters - .where((item) => item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - String formattedDate = formatDate(data['dob']); - return Row( + ), + ), + ], + ); + }).toList(), + ), + ), + if (Responsive.isDesktop(context) && + gmcIsValueValid && + gmcIsPremiumSummery == '1') + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon(Icons.arrow_right, - color: Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 18 : 14, - color: Color(0xFF232526), - ), - ), - ), + flex: 5, + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + 'Additional Premium', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 20, + fontWeight: FontWeight.w500, + ), + ), + Text( + (gmcSiPremiumValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 2, + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + 'GST', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 20, + fontWeight: FontWeight.w500, + ), + ), + Text( + (gmcGstValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 20, + fontWeight: FontWeight.w500, + ), + ), + Text( + (gmcTotalableValue ?? '').toString(), + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 18, + ), + ), + ], + ))), ], - ); - }).toList(), - ), - ), - if (Responsive.isDesktop(context) && gmcIsValueValid && gmcIsPremiumSummery == '1') - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'Additional Premium', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 20, - fontWeight: FontWeight.w500, - ), - ), - Text( - (gmcSiPremiumValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 2, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'GST', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 20, - fontWeight: FontWeight.w500, - ), - ), - Text( - (gmcGstValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 20, - fontWeight: FontWeight.w500, - ), - ), - Text( - (gmcTotalableValue ?? '').toString(), - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - ], - ), - if (!Responsive.isDesktop(context) && gmcIsValueValid && gmcIsPremiumSummery == '1') - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + ), + if (!Responsive.isDesktop(context) && + gmcIsValueValid && + gmcIsPremiumSummery == '1') + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -3816,9 +4107,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( 'Additional Premium', @@ -3836,9 +4127,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerRight, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( (gmcSiPremiumValue ?? '') @@ -3861,9 +4152,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( 'GST', @@ -3881,9 +4172,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerRight, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( (gmcGstValue ?? '').toString(), @@ -3905,9 +4196,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( 'Total Payable', @@ -3925,9 +4216,9 @@ class _empReviewDetailsState extends State { alignment: Alignment.centerRight, child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.center, + CrossAxisAlignment.center, children: [ Text( (gmcTotalableValue ?? '') @@ -3942,9 +4233,9 @@ class _empReviewDetailsState extends State { ], ), ])) - ], - ), - )) + ], + ), + )) : SizedBox(height: 0); cards.add(card); @@ -3957,7 +4248,7 @@ class _empReviewDetailsState extends State { double total = policies .where((policy) => policy is Map) .map((policy) => - (policy["si_gst_value"] ?? 0) + (policy["si_premium_value"] ?? 0)) + (policy["si_gst_value"] ?? 0) + (policy["si_premium_value"] ?? 0)) .fold(0.0, (sum, value) => sum + value); print('Calculated gpaTotalAmt: $total'); // Debug print @@ -3968,8 +4259,8 @@ class _empReviewDetailsState extends State { double total = policies .where((policy) => policy is Map) .map((policy) => - (policy["family_floaters_of_dependent_and_gst_value"] ?? 0) + - (policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0)) + (policy["family_floaters_of_dependent_and_gst_value"] ?? 0) + + (policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0)) .fold(0.0, (sum, value) => sum + value); print('Calculated gmcTotalAmt: $total'); // Debug print @@ -3985,66 +4276,66 @@ class _empReviewDetailsState extends State { print('gpaTotalAmt $gpaTotalAmt'); return (policies as List) .where((policy) => policy is Map) // Ensure each item is a Map + dynamic>) // Ensure each item is a Map .map((policy) { - var siGstValue = policy["si_gst_value"] ?? 0; - var siPremiumValue = policy["si_premium_value"] ?? 0; - dynamic si_is_premium_summery = policy['is_premium_summery']; + var siGstValue = policy["si_gst_value"] ?? 0; + var siPremiumValue = policy["si_premium_value"] ?? 0; + dynamic si_is_premium_summery = policy['is_premium_summery']; - if (siGstValue == 0 || siPremiumValue == 0) - return null; // Skip invalid policies + if (siGstValue == 0 || siPremiumValue == 0) + return null; // Skip invalid policies - return TableRow( - children: [ - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop(context) - ? (policy["Policy_Name"] ?? 'Default Policy Name') - : policy['type'], - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + return TableRow( + children: [ + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + Responsive.isDesktop(context) + ? (policy["Policy_Name"] ?? 'Default Policy Name') + : policy['type'], + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${policy["si_premium_value"]}/Year', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${policy["si_premium_value"]}/Year', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${policy["si_gst_value"]}/-', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${policy["si_gst_value"]}/-', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${(policy["si_premium_value"] ?? 0) + (policy["si_gst_value"] ?? 0)}/-', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${(policy["si_premium_value"] ?? 0) + (policy["si_gst_value"] ?? 0)}/-', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - ], - ); - }) + ], + ); + }) .whereType() // Filter out null values .toList(); } @@ -4060,68 +4351,68 @@ class _empReviewDetailsState extends State { print('gmcTotalAmt $gmcTotalAmt'); return (policies as List) .where((policy) => policy is Map) // Ensure each item is a Map + dynamic>) // Ensure each item is a Map .map((policy) { - var siGstValue = - policy["family_floaters_of_dependent_and_gst_value"] ?? 0; - var siPremiumValue = - policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0; + var siGstValue = + policy["family_floaters_of_dependent_and_gst_value"] ?? 0; + var siPremiumValue = + policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0; - if (siGstValue == 0 || siPremiumValue == 0) - return null; // Skip invalid policies + if (siGstValue == 0 || siPremiumValue == 0) + return null; // Skip invalid policies - return TableRow( - children: [ - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop(context) - ? (policy["Policy_Name"] ?? 'Default Policy Name') - : policy['type'], - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + return TableRow( + children: [ + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + Responsive.isDesktop(context) + ? (policy["Policy_Name"] ?? 'Default Policy Name') + : policy['type'], + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${policy["family_floaters_of_dependent_and_si_premium_value"]}/Year', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${policy["family_floaters_of_dependent_and_si_premium_value"]}/Year', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${policy["family_floaters_of_dependent_and_gst_value"]}/-', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${policy["family_floaters_of_dependent_and_gst_value"]}/-', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - '₹${(policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0) + (policy["family_floaters_of_dependent_and_gst_value"] ?? 0)}/-', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 14 : 12), + TableCell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Text( + '₹${(policy["family_floaters_of_dependent_and_si_premium_value"] ?? 0) + (policy["family_floaters_of_dependent_and_gst_value"] ?? 0)}/-', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) ? 14 : 12), + ), + ), ), - ), - ), - ], - ); - }) + ], + ); + }) .whereType() // Filter out null values .toList(); } -} \ No newline at end of file +} diff --git a/lib/pages/login.dart b/lib/pages/login.dart index cf8a2c1..2b04f5a 100755 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -674,7 +674,20 @@ class _loginState extends State { 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 { InputBorder .none, ), + validator: (value) { + if (value == + null || + value + .isEmpty) { + return 'Required'; + } + + return null; + }, + inputFormatters: [ + FilteringTextInputFormatter + .allow(RegExp( + r'[0-9+]')), + LengthLimitingTextInputFormatter( + 3), + ], ), ), Text( diff --git a/lib/pages/postEnrollment/claimprocess.dart b/lib/pages/postEnrollment/claimprocess.dart index e9e4589..f7f50f8 100755 --- a/lib/pages/postEnrollment/claimprocess.dart +++ b/lib/pages/postEnrollment/claimprocess.dart @@ -17,7 +17,6 @@ import '../service/SessionManager.dart'; import '../service/TokenService.dart'; import '../service/popup_helper.dart'; - class claimprocess extends StatefulWidget { const claimprocess({Key? key}) : super(key: key); @@ -64,8 +63,8 @@ class _claimprocessState extends State { // Decode the JWT token received from the API response Map? decodedToken = Jwt.parseJwt(token); print(decodedToken); - empCodeString = session.empCodeString; - print(empCodeString); // Check if emp_code is correct + empCodeString = session.empCodeString; + print(empCodeString); // Check if emp_code is correct empPrimaryId = session.empPrimaryId; client_id = session.client_id; print(client_id); @@ -73,11 +72,9 @@ class _claimprocessState extends State { } } - - Future getCashlessAndReimbursement() async { final response = await apiService.getCashlessAndReimbursementToApi(); - print('check 1'); + print('check 1 getCashlessAndReimbursement'); if (response['status'] == 'success') { print(response['data']); setState(() { @@ -129,131 +126,155 @@ class _claimprocessState extends State { context.go('/claims'); }, 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, - vertical: MediaQuery.of(context).size.height * 0.03, - ) - : EdgeInsets.all(10), - color: Colors.white, - child: Column( - children: [ - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, + 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, + vertical: MediaQuery.of(context).size.height * 0.03, + ) + : EdgeInsets.all(10), + color: Colors.white, + child: Column( + children: [ + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - flex: 12, - child: InkWell( - onTap: () { - context.go('/claims'); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (!Responsive.isDesktop(context)) - Icon( - Icons.chevron_left, - color: Color(0xFF000000), - size: 30, - ), - SizedBox( - width: Responsive.isDesktop(context) - ? 0 - : 5), - Column( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: InkWell( + onTap: () { + context.go('/claims'); + }, + child: Row( mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, + MainAxisAlignment.start, children: [ - Text( - 'Health Insurance Claims Process', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w600, - color: Color(0xFF000000), - ), + // if (!Responsive.isDesktop(context)) + Icon( + Icons.chevron_left, + color: Color(0xFF000000), + size: 30, + ), + SizedBox( + width: Responsive.isDesktop(context) + ? 0 + : 5), + Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Health Insurance Claims Process', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ), + ], ), ], ), - ], + ), ), - ), + ], ), ], ), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color(0xFFF6FAFF), - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(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), + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(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: GestureDetector( - onTap: () { - setState(() { - isActive = true; - }); - }, - 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) + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + flex: 6, + child: GestureDetector( + onTap: () { + setState(() { + isActive = true; + }); + }, + 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) ? 80 : 40, - vertical: - Responsive.isDesktop( - context) + vertical: Responsive + .isDesktop( + context) ? 12 : 7, + ), + ), + child: Text( + cashLessSectionName ?? + '', + textAlign: + TextAlign.center, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + fontWeight: + FontWeight.w500, + color: + Color(0xFF593AFF), + ), + ), ), - ), - child: Text( + ) + : Text( cashLessSectionName ?? '', textAlign: TextAlign.center, style: GoogleFonts.poppins( @@ -263,59 +284,66 @@ class _claimprocessState extends State { ? 18 : 14, fontWeight: - FontWeight.w500, - color: Color(0xFF593AFF), + FontWeight.w400, + color: Color(0xFF636363), ), ), - ), - ) - : Text( - cashLessSectionName ?? '', - textAlign: TextAlign.center, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - fontWeight: FontWeight.w400, - color: Color(0xFF636363), - ), - ), - ), - ), - Expanded( - flex: 6, - child: GestureDetector( - onTap: () { - setState(() { - isActive = false; - }); - }, - 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) + ), + ), + Expanded( + flex: 6, + child: GestureDetector( + onTap: () { + setState(() { + isActive = false; + }); + }, + 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) ? 80 : 40, - vertical: - Responsive.isDesktop( - context) + vertical: Responsive + .isDesktop( + context) ? 12 : 7, + ), + ), + child: Text( + reimbursementSectionName ?? + '', + textAlign: + TextAlign.center, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + fontWeight: + FontWeight.w500, + color: + Color(0xFF593AFF), + ), + ), ), - ), - child: Text( + ) + : Text( reimbursementSectionName ?? '', textAlign: TextAlign.center, @@ -326,480 +354,500 @@ class _claimprocessState extends State { ? 18 : 14, fontWeight: - FontWeight.w500, - color: Color(0xFF593AFF), + FontWeight.w400, + color: Color(0xFF636363), ), ), - ), - ) - : Text( - reimbursementSectionName ?? '', - textAlign: TextAlign.center, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - fontWeight: FontWeight.w400, - color: Color(0xFF636363), - ), - ), - ), + ), + ), + ], ), ], ), - ], + ), ), - ), + ], ), - ], - ), + ), + SizedBox(height: 15), + if (isActive) + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (cashLessClaimsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + cashLessHeading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + cashLessContent.length * + itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: + cashLessContent.length, + itemBuilder: (context, index) { + String key = cashLessContent + .keys + .elementAt(index); + String value = + cashLessContent[key]!; + return Padding( + padding: const EdgeInsets + .symmetric( + vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], + ), + ), + if (cashLessClaimsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Notes', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 70; // Adjust item height based on content + double listViewHeight = + cashLessNotes.length * + itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: cashLessNotes.length, + itemBuilder: (context, index) { + String key = cashLessNotes + .keys + .elementAt(index); + String value = + cashLessNotes[key]!; + return Padding( + padding: const EdgeInsets + .symmetric( + vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], + ), + ), + ]), + ) + else + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (reimbursementClaimsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + reimbursementHeading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + reimbursementContent.length * + itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: + reimbursementContent.length, + itemBuilder: (context, index) { + String key = + reimbursementContent.keys + .elementAt(index); + String value = + reimbursementContent[ + key]!; + return Padding( + padding: const EdgeInsets + .symmetric( + vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], + ), + ), + if (reimbursementClaimsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Notes', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 70; // Adjust item height based on content + double listViewHeight = + reimbursementNotes.length * + itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: + reimbursementNotes.length, + itemBuilder: (context, index) { + String key = + reimbursementNotes.keys + .elementAt(index); + String value = + reimbursementNotes[key]!; + return Padding( + padding: const EdgeInsets + .symmetric( + vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight + .w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], + ), + ), + ]), + ), + SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), + ], ), - SizedBox(height: 15), - if (isActive) - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (cashLessClaimsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - cashLessHeading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - cashLessContent.length * itemHeight; - double maxHeight = - constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: cashLessContent.length, - itemBuilder: (context, index) { - String key = cashLessContent.keys - .elementAt(index); - String value = - cashLessContent[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - if (cashLessClaimsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Notes', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 70; // Adjust item height based on content - double listViewHeight = - cashLessNotes.length * itemHeight; - double maxHeight = - constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: cashLessNotes.length, - itemBuilder: (context, index) { - String key = cashLessNotes.keys - .elementAt(index); - String value = - cashLessNotes[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - ]), - ) - else - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (reimbursementClaimsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - reimbursementHeading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - reimbursementContent.length * - itemHeight; - double maxHeight = - constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: - reimbursementContent.length, - itemBuilder: (context, index) { - String key = reimbursementContent - .keys - .elementAt(index); - String value = - reimbursementContent[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - if (reimbursementClaimsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Notes', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 70; // Adjust item height based on content - double listViewHeight = - reimbursementNotes.length * - itemHeight; - double maxHeight = - constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: - reimbursementNotes.length, - itemBuilder: (context, index) { - String key = reimbursementNotes - .keys - .elementAt(index); - String value = - reimbursementNotes[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - ]), - ), - SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), - ], + ), ), - ), + if (Responsive.isDesktop(context)) + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, + child: CustomFooter(), + ), + ), + ], ), - if (Responsive.isDesktop(context)) - Align( - alignment: Alignment.bottomCenter, - child: Container( - width: double.infinity, - 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) { - 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", - ], - ), - ) - ); + // 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) { + 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", + ], + ), + )); } } diff --git a/lib/pages/postEnrollment/claims.dart b/lib/pages/postEnrollment/claims.dart index 3dced34..21ee7df 100755 --- a/lib/pages/postEnrollment/claims.dart +++ b/lib/pages/postEnrollment/claims.dart @@ -93,7 +93,7 @@ class _claimsState extends State { 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 { 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 { 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 generateYourPlanList(List data) { diff --git a/lib/pages/postEnrollment/generalexclusionsdeductibles.dart b/lib/pages/postEnrollment/generalexclusionsdeductibles.dart index 74a3e32..8b05d12 100755 --- a/lib/pages/postEnrollment/generalexclusionsdeductibles.dart +++ b/lib/pages/postEnrollment/generalexclusionsdeductibles.dart @@ -67,7 +67,6 @@ class _generalExclusionsDeductiblesState final session = SessionManager(); - @override void initState() { super.initState(); @@ -96,8 +95,6 @@ class _generalExclusionsDeductiblesState } } - - Future getCashlessAndReimbursement() async { final response = await apiService.getCashlessAndReimbursementToApi(); print('check 1'); @@ -169,649 +166,680 @@ class _generalExclusionsDeductiblesState 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, - vertical: MediaQuery.of(context).size.height * 0.03, - ) - : EdgeInsets.all(10), - color: Colors.white, - child: Column( - children: [ - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, + 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, + vertical: MediaQuery.of(context).size.height * 0.03, + ) + : EdgeInsets.all(10), + color: Colors.white, + child: Column( + children: [ + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - flex: 12, - child: InkWell( - onTap: () { - context.pop(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (!Responsive.isDesktop(context)) - Icon( - Icons.chevron_left, - color: Color(0xFF000000), - size: 30, - ), - SizedBox( - width: Responsive.isDesktop(context) - ? 0 - : 5), - Column( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: InkWell( + onTap: () { + context.pop(); + }, + child: Row( mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, + MainAxisAlignment.start, children: [ - Text( - 'General Exclusions & Deductibles', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w600, - color: Color(0xFF000000), - ), + // if (!Responsive.isDesktop(context)) + Icon( + Icons.chevron_left, + color: Color(0xFF000000), + size: 30, + ), + SizedBox( + width: Responsive.isDesktop(context) + ? 0 + : 5), + Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'General Exclusions & Deductibles', + textAlign: TextAlign.start, + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xFF000000), + ), + ), + ], ), ], ), + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + type3SectionName ?? '', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), ], ), ), - ), - ], + if (generalExclusionsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 50; // Adjust item height based on content + double listViewHeight = + type3Content.length * itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: type3Content.length, + itemBuilder: (context, index) { + String key = type3Content.keys + .elementAt(index); + String value = + type3Content[key]!; + return Padding( + padding: const EdgeInsets + .symmetric(vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], + ), + ), + ]), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), ), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type3SectionName ?? '', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 18 : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + type4SectionName ?? '', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + ], + ), + ), + if (generalExclusionsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + type4Heading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + ), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + type4Content.length * itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: type4Content.length, + itemBuilder: (context, index) { + String key = type4Content.keys + .elementAt(index); + String value = + type4Content[key]!; + return Padding( + padding: const EdgeInsets + .symmetric(vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], ), ), - ], - ), - ), - if (generalExclusionsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 50; // Adjust item height based on content - double listViewHeight = - type3Content.length * itemHeight; - double maxHeight = constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: type3Content.length, - itemBuilder: (context, index) { - String key = type3Content.keys - .elementAt(index); - String value = type3Content[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, + ]), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (generalExclusionsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + type5Heading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), ), - ); - }, - ), - ], - ), - ), - ]), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type4SectionName ?? '', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 18 : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + type5Content.length * itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: type5Content.length, + itemBuilder: (context, index) { + String key = type5Content.keys + .elementAt(index); + String value = + type5Content[key]!; + return Padding( + padding: const EdgeInsets + .symmetric(vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], ), ), - ], - ), - ), - if (generalExclusionsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type4Heading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - type4Content.length * itemHeight; - double maxHeight = constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: type4Content.length, - itemBuilder: (context, index) { - String key = type4Content.keys - .elementAt(index); - String value = type4Content[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, + ]), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (generalExclusionsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + type6Heading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), ), - ); - }, - ), - ], - ), - ), - ]), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (generalExclusionsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type5Heading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - type5Content.length * itemHeight; - double maxHeight = constraints.maxHeight; + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + type6Content.length * itemHeight; + double maxHeight = + constraints.maxHeight; - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: type5Content.length, - itemBuilder: (context, index) { - String key = type5Content.keys - .elementAt(index); - String value = type5Content[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: type6Content.length, + itemBuilder: (context, index) { + String key = type6Content.keys + .elementAt(index); + String value = + type6Content[key]!; + return Padding( + padding: const EdgeInsets + .symmetric(vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFFE26728), + ), + ), ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), ), - ), + ], ), - ], - ), - ); - }, + ); + }, + ), + ); + }, + ), + ], + ), + ), + ]), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (generalExclusionsDetails != null) + Padding( + padding: + EdgeInsets.only(bottom: 20, left: 15), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + type7Heading ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 18 + : 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), ), - ); - }, + ), + SizedBox(height: 10), + LayoutBuilder( + builder: (context, constraints) { + double itemHeight = + 40; // Adjust item height based on content + double listViewHeight = + type7Content.length * itemHeight; + double maxHeight = + constraints.maxHeight; + + if (listViewHeight > maxHeight) { + listViewHeight = maxHeight; + } + + return Container( + height: listViewHeight, + child: ListView.builder( + itemCount: type7Content.length, + itemBuilder: (context, index) { + String key = type7Content.keys + .elementAt(index); + String value = + type7Content[key]!; + return Padding( + padding: const EdgeInsets + .symmetric(vertical: 8.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + const EdgeInsets + .only( + left: 20.0), + child: Text( + "• ", + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFFE26728), + ), + ), + ), + Expanded( + child: Text( + value, + style: GoogleFonts + .poppins( + fontSize: 16, + fontWeight: + FontWeight.w400, + color: Color( + 0xFF000000), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ), + ], ), - ], - ), - ), - ]), + ), + ]), + ), + SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), + ], ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (generalExclusionsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type6Heading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - type6Content.length * itemHeight; - double maxHeight = constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: type6Content.length, - itemBuilder: (context, index) { - String key = type6Content.keys - .elementAt(index); - String value = type6Content[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - ]), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric(vertical: 15, horizontal: 25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (generalExclusionsDetails != null) - Padding( - padding: EdgeInsets.only(bottom: 20, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - type7Heading ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 18 - : 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - ), - ), - SizedBox(height: 10), - LayoutBuilder( - builder: (context, constraints) { - double itemHeight = - 40; // Adjust item height based on content - double listViewHeight = - type7Content.length * itemHeight; - double maxHeight = constraints.maxHeight; - - if (listViewHeight > maxHeight) { - listViewHeight = maxHeight; - } - - return Container( - height: listViewHeight, - child: ListView.builder( - itemCount: type7Content.length, - itemBuilder: (context, index) { - String key = type7Content.keys - .elementAt(index); - String value = type7Content[key]!; - return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 8.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsets.only( - left: 20.0), - child: Text( - "• ", - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFFE26728), - ), - ), - ), - Expanded( - child: Text( - value, - style: - GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w400, - color: - Color(0xFF000000), - ), - ), - ), - ], - ), - ); - }, - ), - ); - }, - ), - ], - ), - ), - ]), - ), - SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), - ], + ), ), - ), + if (Responsive.isDesktop(context)) + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, + child: CustomFooter(), + ), + ), + ], ), - if (Responsive.isDesktop(context)) - Align( - alignment: Alignment.bottomCenter, - child: Container( - width: double.infinity, - 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) { - 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", - ], - ), - ) - ); + // 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) { + 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", + ], + ), + )); } } diff --git a/lib/pages/postEnrollment/help.dart b/lib/pages/postEnrollment/help.dart index 417039a..1ba3281 100755 --- a/lib/pages/postEnrollment/help.dart +++ b/lib/pages/postEnrollment/help.dart @@ -159,20 +159,20 @@ class _helpState extends State { // print('check 1'); // if (response['status'] == 'success') { // print(response); - setState(() { - // accountManagerDetails = response['AccountManagerDetails']; - final accountManager = dataManager.accountManagerDetails; - accountManagerDetails = accountManager; - print('accountManagerDetails'); - print(accountManagerDetails); - accountManagerEmail = accountManagerDetails['email']; - print(accountManagerEmail); - accountManagerMobileNo = accountManagerDetails['mobile']; - print(accountManagerMobileNo); - }); - // setState(() { - // isLoading = false; - // }); + setState(() { + // accountManagerDetails = response['AccountManagerDetails']; + final accountManager = dataManager.accountManagerDetails; + accountManagerDetails = accountManager; + print('accountManagerDetails'); + print(accountManagerDetails); + accountManagerEmail = accountManagerDetails['email']; + print(accountManagerEmail); + accountManagerMobileNo = accountManagerDetails['mobile']; + print(accountManagerMobileNo); + }); + // setState(() { + // isLoading = false; + // }); // } else { // setState(() { // isLoading = false; @@ -207,7 +207,7 @@ class _helpState extends State { .where((item) => item['status_value'] == 'Closed') .toList(); reversedClaimsClosedList = - List>.from(trackClaimsClosedList); + List>.from(trackClaimsClosedList); trackClaimsClosedList = reversedClaimsClosedList.reversed.toList(); }); // } else if (response['success'] == true && @@ -309,766 +309,775 @@ class _helpState extends State { 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( + backgroundColor: Colors.white, + appBar: CustomAppBar(), + body: Stack(children: [ + SingleChildScrollView( + child: Container( padding: Responsive.isDesktop(context) - ? EdgeInsets.only(top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: InkWell( - onTap: () { - context.pop(); - // Navigator.pushNamed(context, 'home'); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon( - Icons - .chevron_left, // Replace with your desired icon - color: Color(0xFF000000), - size: 30, - ), - ], - ), - ), - ), - ], - ), - Row( + ? 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( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, bottom: 15, left: 25, right: 25) + : EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0), + child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: InkWell( + onTap: () { + context.push('/claims'); + // Navigator.pushNamed(context, 'home'); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ - SvgPicture.string( - SvgService.getSvg('help'), - width: 150, - height: 150, + Icon( + Icons + .chevron_left, // Replace with your desired icon + color: Color(0xFF000000), + size: 30, ), ], - ))), - ], - ), - // Add more rows as needed - ], - ), - ), - SizedBox(height: 15), - if (accountManagerDetails != null) - Container( - decoration: BoxDecoration( - color: Colors.white, // Set background color for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10) - : EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Nhance Account Manager Contact', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) ? 16 : 12, - fontWeight: FontWeight.w400, - color: Color(0xFF777777), ), ), - ], - ), + ), + ], ), - Padding( - padding: EdgeInsets.only(bottom: 10), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment - .center, // Center align the row - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - _openEmail(accountManagerEmail); - }, - child: SvgPicture.string( - SvgService.getSvg('email'), - width: 20, - height: 20, - ), - ), - SizedBox( - width: 10), // Space between icon and text - GestureDetector( - onTap: () { - _openEmail(accountManagerEmail); - }, - child: Text( - accountManagerEmail ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 16 - : 14, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SvgPicture.string( + SvgService.getSvg('help'), + width: 150, + height: 150, ), - ), + ], + ))), + ], + ), + // Add more rows as needed + ], + ), + ), + SizedBox(height: 15), + if (accountManagerDetails != null) + Container( + decoration: BoxDecoration( + color: Colors + .white, // Set background color for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 10, bottom: 10, left: 10, right: 10) + : EdgeInsets.only( + top: 5, bottom: 5, left: 10, right: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Nhance Account Manager Contact', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 16 : 12, + fontWeight: FontWeight.w400, + color: Color(0xFF777777), + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 10), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment + .center, // Center align the row + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + _openEmail(accountManagerEmail); + }, + child: SvgPicture.string( + SvgService.getSvg('email'), + width: 20, + height: 20, + ), + ), + SizedBox( + width: + 10), // Space between icon and text + GestureDetector( + onTap: () { + _openEmail(accountManagerEmail); + }, + child: Text( + accountManagerEmail ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + ), + ), + ), + ], + ), + SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment + .center, // Center align the row + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + _openDialPad(accountManagerMobileNo); + }, + child: SvgPicture.string( + SvgService.getSvg('smartphone'), + width: 20, + height: 20, + ), + ), + SizedBox( + width: + 10), // Space between icon and text + GestureDetector( + onTap: () { + _openDialPad(accountManagerMobileNo); + }, + child: Text( + accountManagerMobileNo ?? '', + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) + ? 16 + : 14, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + ), + ), + ), + ], ), ], ), - SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment - .center, // Center align the row - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - _openDialPad(accountManagerMobileNo); - }, - child: SvgPicture.string( - SvgService.getSvg('smartphone'), - width: 20, - height: 20, - ), - ), - SizedBox( - width: 10), // Space between icon and text - GestureDetector( - onTap: () { - _openDialPad(accountManagerMobileNo); - }, - child: Text( - accountManagerMobileNo ?? '', - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) - ? 16 - : 14, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), - ), - ), - ), - ], - ), - ], + ), + ) + ]), + ), + + Container( + width: Responsive.isDesktop(context) ? 500 : double.infinity, + height: 75, + // padding: Responsive.isDesktop(context) + // ? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30) + // : EdgeInsets.only(top: 5, bottom: 5,left: 10,right: 10), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.symmetric(vertical: 5, horizontal: 10), + child: Row( + children: [ + // Expanded( + // flex: 6, + // child: ElevatedButton( + // onPressed: () { + // var details = { + // 'claimsDetails': '', + // 'fromClaimPage': 1, + // }; + // Navigator.pushNamed(context, 'planclaimsform', + // arguments: details); + // }, + // style: ElevatedButton.styleFrom( + // backgroundColor: Color(0xFFE26728), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(5), + // ), + // ), + // child: Text( + // 'Raise Claims', + // style: GoogleFonts.poppins(color: Colors.white), + // ), + // ), + // ), + // SizedBox(width: 10), + Expanded( + flex: 4, + child: ElevatedButton( + onPressed: () { + context.go('/tickets'); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), + ), + ), + child: Text( + 'Raise a Query', + style: GoogleFonts.poppins(color: Colors.white), ), ), - ) - ]), - ), - - Container( - width: Responsive.isDesktop(context) ? 500 : double.infinity, - height: 75, - // padding: Responsive.isDesktop(context) - // ? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30) - // : EdgeInsets.only(top: 5, bottom: 5,left: 10,right: 10), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.symmetric(vertical: 5, horizontal: 10), - child: Row( - children: [ - // Expanded( - // flex: 6, - // child: ElevatedButton( - // onPressed: () { - // var details = { - // 'claimsDetails': '', - // 'fromClaimPage': 1, - // }; - // Navigator.pushNamed(context, 'planclaimsform', - // arguments: details); - // }, - // style: ElevatedButton.styleFrom( - // backgroundColor: Color(0xFFE26728), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(5), - // ), - // ), - // child: Text( - // 'Raise Claims', - // style: GoogleFonts.poppins(color: Colors.white), - // ), - // ), - // ), - // SizedBox(width: 10), - Expanded( - flex: 4, - child: ElevatedButton( - onPressed: () { - context.go('/tickets'); - }, - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), + ), + SizedBox(width: 10), + Expanded( + flex: 4, + child: ElevatedButton( + onPressed: () { + context.go('/raisedTicketHistory'); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), + ), + ), + child: Text( + 'Track Queries', + style: GoogleFonts.poppins(color: Colors.white), + ), ), ), - child: Text( - 'Raise a Query', - style: GoogleFonts.poppins(color: Colors.white), - ), - ), + ], ), - SizedBox(width: 10), - Expanded( - flex: 4, - child: ElevatedButton( - onPressed: () { - context.go('/raisedTicketHistory'); - }, - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - ), - ), - child: Text( - 'Track Queries', - style: GoogleFonts.poppins(color: Colors.white), - ), - ), - ), - ], + ), + + SizedBox(height: 20), + // SizedBox(height: 15), + // Container( + // decoration: BoxDecoration( + // color: Color(0xFFF6FAFF), + // borderRadius: BorderRadius.circular(5), + // ), + // padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + // child: Responsive.isDesktop(context) + // ? Row( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // children: [ + // Expanded( + // child: _buildTabButton( + // context: context, + // title: "All Claims", + // isActive: allClaimsActive == 0, + // onTap: () { + // setState(() { + // isActive = true; + // allClaimsActive = 0; + // closedTrackActive = 1; + // tickets = 1; + // ticketsActive = 1; + // }); + // }, + // ), + // ), + // Expanded( + // child: _buildTabButton( + // context: context, + // title: "Closed claims", + // isActive: closedTrackActive == 0, + // onTap: () { + // setState(() { + // isActive = false; + // allClaimsActive = 1; + // closedTrackActive = 0; + // tickets = 1; + // ticketsActive = 1; + // }); + // getTrackClaimsList(); + // }, + // ), + // ), + // Expanded( + // child: _buildTabButton( + // context: context, + // title: "Queries", + // isActive: tickets == 0, + // onTap: () { + // setState(() { + // isActive = false; + // allClaimsActive = 1; + // closedTrackActive = 1; + // tickets = 0; + // ticketsActive = 0; + // }); + // getTicketList(); + // // getTrackClaimsList(); + // }, + // ), + // ), + // ], + // ) + // : SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: Row( + // children: [ + // _buildTabButton( + // context: context, + // title: "All Claims", + // isActive: allClaimsActive == 0, + // onTap: () { + // setState(() { + // isActive = true; + // allClaimsActive = 0; + // closedTrackActive = 1; + // tickets = 1; + // ticketsActive = 1; + // }); + // }, + // ), + // SizedBox(width: 10), + // _buildTabButton( + // context: context, + // title: "Closed claims", + // isActive: closedTrackActive == 0, + // onTap: () { + // setState(() { + // isActive = false; + // allClaimsActive = 1; + // closedTrackActive = 0; + // tickets = 1; + // ticketsActive = 1; + // }); + // getTrackClaimsList(); + // }, + // ), + // SizedBox(width: 10), + // _buildTabButton( + // context: context, + // title: "Queries", + // isActive: tickets == 0, + // onTap: () { + // setState(() { + // isActive = false; + // ticketsActive = 0; + // allClaimsActive = 1; + // closedTrackActive = 1; + // tickets = 0; + // // isActive = false; + // // allClaimsActive = 1; + // // closedTrackActive = 1; + // // tickets = 0; + // }); + // // getTrackClaimsList(); + // getTicketList(); + // }, + // ), + // ], + // ), + // ), + // ), + // if (allClaimsActive == 0) + // if (trackClaimsList == null || trackClaimsList.isEmpty) + // 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: 10, bottom: 10, left: 10, right: 10) + // : EdgeInsets.only( + // top: 10, bottom: 10, left: 10, right: 10), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // flex: 11, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SvgPicture.string( + // SvgService.getSvg('claims'), + // width: 60, + // height: 60, + // ), + // SizedBox( + // width: + // 10), // Adjust space between icon and text + // Container( + // alignment: Alignment.centerLeft, + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Text( + // 'No service request yet!', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 18 + // : 16, + // fontWeight: FontWeight.w600, + // color: Color(0xFF000000), + // ), + // ), + // Container( + // constraints: BoxConstraints( + // maxWidth: Responsive.isDesktop( + // context) + // ? 800 + // : 250), // Adjust the maximum width as needed + // child: Text( + // 'Please raise a service request, if you have any concerns with your policy.', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 14 + // : 12, + // fontWeight: FontWeight.w400, + // color: Color(0xFF777777), + // ), + // softWrap: + // true, // Ensure text automatically wraps + // ), + // ), + // ], + // )) + // ], + // ), + // ), + // ], + // ), + // ), + // ]), + // ), + // if (trackClaimsList != null) + // if (allClaimsActive == 0) + // SingleChildScrollView( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: generateClaimsList( + // trackClaimsList), // Replace 'yourDataList' with your actual data list + // ), + // ), + // // SizedBox(height: 15), + // if (closedTrackActive == 0) + // if (trackClaimsClosedList == null || + // trackClaimsClosedList.isEmpty) + // 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: 10, bottom: 10, left: 10, right: 10) + // : EdgeInsets.only( + // top: 10, bottom: 10, left: 10, right: 10), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // flex: 11, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SvgPicture.string( + // SvgService.getSvg('tickets'), + // width: 60, + // height: 60, + // ), + // SizedBox( + // width: + // 10), // Adjust space between icon and text + // Container( + // alignment: Alignment.centerLeft, + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Text( + // 'No service request yet!', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 18 + // : 16, + // fontWeight: FontWeight.w600, + // color: Color(0xFF000000), + // ), + // ), + // Container( + // constraints: BoxConstraints( + // maxWidth: Responsive.isDesktop( + // context) + // ? 800 + // : 250), // Adjust the maximum width as needed + // child: Text( + // 'Please raise a service request, if you have any concerns with your policy.', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 14 + // : 12, + // fontWeight: FontWeight.w400, + // color: Color(0xFF777777), + // ), + // softWrap: + // true, // Ensure text automatically wraps + // ), + // ), + // ], + // )) + // ], + // ), + // ), + // ], + // ), + // ), + // ]), + // ), + // if (trackClaimsClosedList != null) + // if (closedTrackActive == 0) + // SingleChildScrollView( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: generateClaimsClosedList( + // trackClaimsClosedList), // Replace 'yourDataList' with your actual data list + // ), + // ), + // // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), + + // if (ticketsActive == 0) + // if (ticketList == null || ticketList.isEmpty) + // 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: 10, bottom: 10, left: 10, right: 10) + // : EdgeInsets.only( + // top: 10, bottom: 10, left: 10, right: 10), + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // flex: 11, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SvgPicture.string( + // SvgService.getSvg('tickets'), + // width: 60, + // height: 60, + // ), + // SizedBox( + // width: + // 10), // Adjust space between icon and text + // Container( + // alignment: Alignment.centerLeft, + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Text( + // 'No service request yet!', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 18 + // : 16, + // fontWeight: FontWeight.w600, + // color: Color(0xFF000000), + // ), + // ), + // Container( + // constraints: BoxConstraints( + // maxWidth: Responsive.isDesktop( + // context) + // ? 800 + // : 250), // Adjust the maximum width as needed + // child: Text( + // 'Please raise a service request, if you have any concerns with your policy.', + // textAlign: TextAlign.left, + // style: GoogleFonts.poppins( + // fontSize: + // Responsive.isDesktop(context) + // ? 14 + // : 12, + // fontWeight: FontWeight.w400, + // color: Color(0xFF777777), + // ), + // softWrap: + // true, // Ensure text automatically wraps + // ), + // ), + // ], + // )) + // ], + // ), + // ), + // ], + // ), + // ), + // ]), + // ), + // if (ticketList != null) + // // if (ticketsActive == 0) + // SingleChildScrollView( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: generateClaimsTicketList( + // ticketList), // Replace 'yourDataList' with your actual data list + // ), + // ), + // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), + + // generateClaimsTicketList + ]), + )), + 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: 20), - // SizedBox(height: 15), - // Container( - // decoration: BoxDecoration( - // color: Color(0xFFF6FAFF), - // borderRadius: BorderRadius.circular(5), - // ), - // padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), - // child: Responsive.isDesktop(context) - // ? Row( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - // children: [ - // Expanded( - // child: _buildTabButton( - // context: context, - // title: "All Claims", - // isActive: allClaimsActive == 0, - // onTap: () { - // setState(() { - // isActive = true; - // allClaimsActive = 0; - // closedTrackActive = 1; - // tickets = 1; - // ticketsActive = 1; - // }); - // }, - // ), - // ), - // Expanded( - // child: _buildTabButton( - // context: context, - // title: "Closed claims", - // isActive: closedTrackActive == 0, - // onTap: () { - // setState(() { - // isActive = false; - // allClaimsActive = 1; - // closedTrackActive = 0; - // tickets = 1; - // ticketsActive = 1; - // }); - // getTrackClaimsList(); - // }, - // ), - // ), - // Expanded( - // child: _buildTabButton( - // context: context, - // title: "Queries", - // isActive: tickets == 0, - // onTap: () { - // setState(() { - // isActive = false; - // allClaimsActive = 1; - // closedTrackActive = 1; - // tickets = 0; - // ticketsActive = 0; - // }); - // getTicketList(); - // // getTrackClaimsList(); - // }, - // ), - // ), - // ], - // ) - // : SingleChildScrollView( - // scrollDirection: Axis.horizontal, - // child: Row( - // children: [ - // _buildTabButton( - // context: context, - // title: "All Claims", - // isActive: allClaimsActive == 0, - // onTap: () { - // setState(() { - // isActive = true; - // allClaimsActive = 0; - // closedTrackActive = 1; - // tickets = 1; - // ticketsActive = 1; - // }); - // }, - // ), - // SizedBox(width: 10), - // _buildTabButton( - // context: context, - // title: "Closed claims", - // isActive: closedTrackActive == 0, - // onTap: () { - // setState(() { - // isActive = false; - // allClaimsActive = 1; - // closedTrackActive = 0; - // tickets = 1; - // ticketsActive = 1; - // }); - // getTrackClaimsList(); - // }, - // ), - // SizedBox(width: 10), - // _buildTabButton( - // context: context, - // title: "Queries", - // isActive: tickets == 0, - // onTap: () { - // setState(() { - // isActive = false; - // ticketsActive = 0; - // allClaimsActive = 1; - // closedTrackActive = 1; - // tickets = 0; - // // isActive = false; - // // allClaimsActive = 1; - // // closedTrackActive = 1; - // // tickets = 0; - // }); - // // getTrackClaimsList(); - // getTicketList(); - // }, - // ), - // ], - // ), - // ), - // ), - // if (allClaimsActive == 0) - // if (trackClaimsList == null || trackClaimsList.isEmpty) - // 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: 10, bottom: 10, left: 10, right: 10) - // : EdgeInsets.only( - // top: 10, bottom: 10, left: 10, right: 10), - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Expanded( - // flex: 11, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SvgPicture.string( - // SvgService.getSvg('claims'), - // width: 60, - // height: 60, - // ), - // SizedBox( - // width: - // 10), // Adjust space between icon and text - // Container( - // alignment: Alignment.centerLeft, - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // 'No service request yet!', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 18 - // : 16, - // fontWeight: FontWeight.w600, - // color: Color(0xFF000000), - // ), - // ), - // Container( - // constraints: BoxConstraints( - // maxWidth: Responsive.isDesktop( - // context) - // ? 800 - // : 250), // Adjust the maximum width as needed - // child: Text( - // 'Please raise a service request, if you have any concerns with your policy.', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 14 - // : 12, - // fontWeight: FontWeight.w400, - // color: Color(0xFF777777), - // ), - // softWrap: - // true, // Ensure text automatically wraps - // ), - // ), - // ], - // )) - // ], - // ), - // ), - // ], - // ), - // ), - // ]), - // ), - // if (trackClaimsList != null) - // if (allClaimsActive == 0) - // SingleChildScrollView( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.stretch, - // children: generateClaimsList( - // trackClaimsList), // Replace 'yourDataList' with your actual data list - // ), - // ), - // // SizedBox(height: 15), - // if (closedTrackActive == 0) - // if (trackClaimsClosedList == null || - // trackClaimsClosedList.isEmpty) - // 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: 10, bottom: 10, left: 10, right: 10) - // : EdgeInsets.only( - // top: 10, bottom: 10, left: 10, right: 10), - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Expanded( - // flex: 11, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SvgPicture.string( - // SvgService.getSvg('tickets'), - // width: 60, - // height: 60, - // ), - // SizedBox( - // width: - // 10), // Adjust space between icon and text - // Container( - // alignment: Alignment.centerLeft, - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // 'No service request yet!', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 18 - // : 16, - // fontWeight: FontWeight.w600, - // color: Color(0xFF000000), - // ), - // ), - // Container( - // constraints: BoxConstraints( - // maxWidth: Responsive.isDesktop( - // context) - // ? 800 - // : 250), // Adjust the maximum width as needed - // child: Text( - // 'Please raise a service request, if you have any concerns with your policy.', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 14 - // : 12, - // fontWeight: FontWeight.w400, - // color: Color(0xFF777777), - // ), - // softWrap: - // true, // Ensure text automatically wraps - // ), - // ), - // ], - // )) - // ], - // ), - // ), - // ], - // ), - // ), - // ]), - // ), - // if (trackClaimsClosedList != null) - // if (closedTrackActive == 0) - // SingleChildScrollView( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.stretch, - // children: generateClaimsClosedList( - // trackClaimsClosedList), // Replace 'yourDataList' with your actual data list - // ), - // ), - // // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), - - - - // if (ticketsActive == 0) - // if (ticketList == null || ticketList.isEmpty) - // 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: 10, bottom: 10, left: 10, right: 10) - // : EdgeInsets.only( - // top: 10, bottom: 10, left: 10, right: 10), - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Expanded( - // flex: 11, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SvgPicture.string( - // SvgService.getSvg('tickets'), - // width: 60, - // height: 60, - // ), - // SizedBox( - // width: - // 10), // Adjust space between icon and text - // Container( - // alignment: Alignment.centerLeft, - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // 'No service request yet!', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 18 - // : 16, - // fontWeight: FontWeight.w600, - // color: Color(0xFF000000), - // ), - // ), - // Container( - // constraints: BoxConstraints( - // maxWidth: Responsive.isDesktop( - // context) - // ? 800 - // : 250), // Adjust the maximum width as needed - // child: Text( - // 'Please raise a service request, if you have any concerns with your policy.', - // textAlign: TextAlign.left, - // style: GoogleFonts.poppins( - // fontSize: - // Responsive.isDesktop(context) - // ? 14 - // : 12, - // fontWeight: FontWeight.w400, - // color: Color(0xFF777777), - // ), - // softWrap: - // true, // Ensure text automatically wraps - // ), - // ), - // ], - // )) - // ], - // ), - // ), - // ], - // ), - // ), - // ]), - // ), - // if (ticketList != null) - // // if (ticketsActive == 0) - // SingleChildScrollView( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.stretch, - // children: generateClaimsTicketList( - // ticketList), // Replace 'yourDataList' with your actual data list - // ), - // ), - // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), - - // generateClaimsTicketList ]), - )), - 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) { - 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: 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) { + 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: 3, // Initial index of the bottom navigation bar + ), + )); } List generateClaimsList(List data) { @@ -1561,7 +1570,6 @@ class _helpState extends State { context.go('/tickettracklist', extra: item['thz_id']); - // Navigator.pushNamed( // context, // 'claimtracklist', diff --git a/lib/pages/postEnrollment/home.dart b/lib/pages/postEnrollment/home.dart index d3e5cfc..a16f248 100755 --- a/lib/pages/postEnrollment/home.dart +++ b/lib/pages/postEnrollment/home.dart @@ -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 { bool _dialogShown = false; + late StreamSubscription _popStateListener; bool isLoadingGif = false; late ApiService apiService; int _currentIndex = 0; @@ -60,7 +62,7 @@ class _HomeState extends State { 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 { _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 { final preToken = TokenService.getPreToken(); print('preToken'); print(preToken); + WidgetsBinding.instance.addPostFrameCallback((_) { + checkbackbutton(); + }); setState(() { isTokenAvailable = preToken != null; }); @@ -314,7 +314,7 @@ class _HomeState extends State { '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 { 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 { ), 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 { ); } + 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 { )); 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 { '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 { 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 { ), 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 { '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 { ElevatedButton( onPressed: isTokenAvailable ? () { - context.go('/empDetails'); - } + context.go('/empDetails'); + } : null, child: Text('View Details'), ), @@ -565,84 +584,84 @@ class _HomeState extends State { 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 { '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 { 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 { }, 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 { }, 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 { onTap: () { context.go( '/policies', - extra: item, // 👈 pass arguments here + extra: item, // 👈 pass arguments here ); }, child: MouseRegion( @@ -1079,7 +1113,7 @@ class _HomeState extends State { 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 { ), 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 { child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Row( children: [ @@ -1112,17 +1146,17 @@ class _HomeState extends State { 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 { 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 { 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 { flex: 5, child: Column( crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.end, children: [ Text( formatToCroresLakhsAndThousands( @@ -1191,10 +1225,10 @@ class _HomeState extends State { 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 { 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 { 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 { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/postEnrollment/planclaimsform.dart b/lib/pages/postEnrollment/planclaimsform.dart index 313a39c..1b99293 100755 --- a/lib/pages/postEnrollment/planclaimsform.dart +++ b/lib/pages/postEnrollment/planclaimsform.dart @@ -1503,4 +1503,4 @@ SizedBox(height: 15), }, ); } -} +} \ No newline at end of file diff --git a/lib/pages/postEnrollment/policies.dart b/lib/pages/postEnrollment/policies.dart index 14cf846..fb271de 100755 --- a/lib/pages/postEnrollment/policies.dart +++ b/lib/pages/postEnrollment/policies.dart @@ -1214,4 +1214,4 @@ class _policiesState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/postEnrollment/profile.dart b/lib/pages/postEnrollment/profile.dart index 7f0eb07..ecb2ba8 100755 --- a/lib/pages/postEnrollment/profile.dart +++ b/lib/pages/postEnrollment/profile.dart @@ -779,44 +779,17 @@ class _profileState extends State { ), 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 { ), )); } + + 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)), + ), + ], + ), + ), + ); + } } diff --git a/lib/pages/postEnrollment/tickets.dart b/lib/pages/postEnrollment/tickets.dart index 2da9a61..447ed35 100644 --- a/lib/pages/postEnrollment/tickets.dart +++ b/lib/pages/postEnrollment/tickets.dart @@ -109,7 +109,6 @@ class _ticketsState extends State { } } - Future getActiveAndInactivePolicyDetails() async { if (client_id == null || empCodeString == null) { return; @@ -213,8 +212,7 @@ class _ticketsState extends State { print('Check One'); Map 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 { 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, diff --git a/lib/pages/verify.dart b/lib/pages/verify.dart index 2e2faa7..cd1af5c 100755 --- a/lib/pages/verify.dart +++ b/lib/pages/verify.dart @@ -1282,4 +1282,4 @@ // print('Title: ${message.notification?.title}'); // print('Body: ${message.notification?.body}'); // print('Data: ${message.data}'); -// } \ No newline at end of file +// }