diff --git a/.env b/.env index 8ec620d..267d625 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -API_URL=https://app.nhanceindia.in/zenith/employeeRest/ -TICKET_API_URL=https://app.nhanceindia.in/helpdesk/api -BASE_HREF=/employee/ -ENV=production \ No newline at end of file +API_URL=https://venbait.in/nhance/dev/employeeRest/ +TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api +BASE_HREF=/nhance/employee/dev/ +ENV=development \ No newline at end of file diff --git a/.env.development b/.env.development index 63d6b02..267d625 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ API_URL=https://venbait.in/nhance/dev/employeeRest/ TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api BASE_HREF=/nhance/employee/dev/ -ENV=development +ENV=development \ No newline at end of file diff --git a/.env.production b/.env.production index 8ec620d..dc81ca7 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ API_URL=https://app.nhanceindia.in/zenith/employeeRest/ TICKET_API_URL=https://app.nhanceindia.in/helpdesk/api -BASE_HREF=/employee/ +BASE_HREF=/app/ ENV=production \ No newline at end of file diff --git a/.env.uat b/.env.uat index 73eb6ac..5ea1d81 100644 --- a/.env.uat +++ b/.env.uat @@ -1,4 +1,4 @@ API_URL=https://dev.venbait.in/nhance/uat/employeeRest/ TICKET_API_URL=https://dev.venbait.in/nhance/helpdesk/uat/api BASE_HREF=/nhance/employee/uat/ -ENV=uat +ENV=uat \ No newline at end of file diff --git a/assets/nhance_client_logo.png b/assets/nhance_client_logo.png index f316a3f..631af6a 100644 Binary files a/assets/nhance_client_logo.png and b/assets/nhance_client_logo.png differ diff --git a/assets/nhance_client_logo12.png b/assets/nhance_client_logo12.png new file mode 100644 index 0000000..f316a3f Binary files /dev/null and b/assets/nhance_client_logo12.png differ diff --git a/lib/customAppBar/customAppBar.dart b/lib/customAppBar/customAppBar.dart index bb80d9c..a64f439 100644 --- a/lib/customAppBar/customAppBar.dart +++ b/lib/customAppBar/customAppBar.dart @@ -52,8 +52,8 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { Container( margin: EdgeInsets.only( top: 10, bottom: 10, left: 10, right: 10), - width: Responsive.isDesktop(context) ? 230 : 170, - height: Responsive.isDesktop(context) ? 230 : 170, + width: Responsive.isDesktop(context) ? 150 : 130, + height: Responsive.isDesktop(context) ? 150 : 130, child: Image.asset( 'assets/nhance_client_logo.png', fit: BoxFit.contain, // Adjust the fit as needed diff --git a/lib/customAppBar/customFooter.dart b/lib/customAppBar/customFooter.dart index db7f7b2..9895961 100644 --- a/lib/customAppBar/customFooter.dart +++ b/lib/customAppBar/customFooter.dart @@ -10,7 +10,7 @@ class CustomFooter extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - 'Copyright@ 2024 Nhance - Jubiliant', + 'Copyright@ 2024 Nhance', style: TextStyle( fontSize: 14, color: Colors.grey[600], // Text color diff --git a/lib/customAppBar/enrollmentAppBar.dart b/lib/customAppBar/enrollmentAppBar.dart index 995bdf4..65095c0 100644 --- a/lib/customAppBar/enrollmentAppBar.dart +++ b/lib/customAppBar/enrollmentAppBar.dart @@ -88,8 +88,8 @@ class _CustomAppBarState extends State { children: [ Container( margin: EdgeInsets.only(top: 10, bottom: 10), - width: 230, - height: 230, + width: Responsive.isDesktop(context) ? 150 : 130, + height: Responsive.isDesktop(context) ? 150 : 130, child: Image.asset( 'assets/nhance_client_logo.png', fit: BoxFit.contain, @@ -116,10 +116,48 @@ class _CustomAppBarState extends State { // Navigator.pushNamed(context, 'oldPolicy'); }, ), + if (empStatus != 'enrolled') + NavBarItem( + text: "Logout", + onTap: () async { + logout(context); + }, + ), + ], + ), + ), + if (empStatus == 'enrolled') + Expanded( + flex: Responsive.isDesktop(context) ? 9 : 3, + child: AdaptiveNavBar( + screenWidth: sw, + backgroundColor: const Color(0xFFFFFBDE), + leading: + Container(), // Set an empty container as we have the logo separately + title: Text(''), + navBarItems: [ NavBarItem( - text: "Logout", - onTap: () async { - logout(context); + text: "Home", + onTap: () { + Navigator.pushNamed(context, 'home'); + }, + ), + NavBarItem( + text: "Claim", + onTap: () { + Navigator.pushNamed(context, 'claims'); + }, + ), + NavBarItem( + text: "Help", + onTap: () { + Navigator.pushNamed(context, 'help'); + }, + ), + NavBarItem( + text: "Profile", + onTap: () { + Navigator.pushNamed(context, 'profile'); }, ), ], diff --git a/lib/main.dart b/lib/main.dart index fed373d..ac3d72a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,6 @@ import 'package:nhance_app_pwa/pages/postEnrollment/profile.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/termsofuse.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/wellness.dart'; import 'package:nhance_app_pwa/pages/session/SetPinBiometric.dart'; -import 'package:nhance_app_pwa/pages/session/authenticationService.dart'; import 'package:nhance_app_pwa/pages/session/changePin.dart'; import 'package:nhance_app_pwa/pages/session/settingUpPinAndBiometric.dart'; @@ -29,60 +28,85 @@ import 'models/environment.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - await Firebase.initializeApp( - options: const FirebaseOptions( - apiKey: 'AIzaSyAZdKJco4fe0e1HP1A249BVZzA3WMYb_3g', - appId: '1:508866094093:android:9969e766daa5b770366144', - messagingSenderId: '508866094093', - projectId: 'nhance-app-4fedb')); - await dotenv.load(fileName: Environment.fileName); - final AuthService _authService = AuthService(); - runApp(MaterialApp( - initialRoute: 'login', - debugShowCheckedModeBanner: false, - // home: FutureBuilder( - // future: _authService.getPin(), - // builder: (context, snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // return CircularProgressIndicator(); - // } - // if (snapshot.hasData && snapshot.data != null) { - // // If PIN is saved, authenticate with PIN or biometric - // return PinOrBiometricPage(); - // } - // // Otherwise, show login page - // return login(); - // }, - // ), - routes: { - 'login': (context) => login(), - 'verify': (context) => MyVerify( - verificationId: '', - mobileNumber: '', - resendToken: null, - onResendCode: (String, int) {}, - ), - 'pinSettingPage': (context) => pinSettingPage(), - 'pinPage': (context) => pinPage(), - 'changePin': (context) => changePin(), - 'home': (context) => MyApp(), - 'policies': (context) => policies(), - 'claims': (context) => claims(), - 'help': (context) => help(), - 'claimprocess': (context) => claimprocess(), - 'profile': (context) => profile(), - 'wellness': (context) => wellness(), - 'planclaimsform': (context) => planclaimsform(), - 'claimtracklist': (context) => claimtracklist(), - 'privacypolicy': (context) => privacypolicy(), - 'termsofuse': (context) => termsofuse(), - 'chatbot': (context) => chatbot(), - 'generalExclusionsDeductibles': (context) => - generalExclusionsDeductibles(), - 'empDetails': (context) => empDetails(), - 'addOnsDetails': (context) => addOnsDetails(), - 'empReviewDetails': (context) => empReviewDetails(), - }, - )); + // Initialize Firebase only if it's not already initialized + if (Firebase.apps.isEmpty) { + await Firebase.initializeApp( + options: const FirebaseOptions( + apiKey: 'AIzaSyAZdKJco4fe0e1HP1A249BVZzA3WMYb_3g', + appId: '1:508866094093:android:9969e766daa5b770366144', + messagingSenderId: '508866094093', + projectId: 'nhance-app-4fedb')); + await dotenv.load(fileName: Environment.fileName); + } + + // Load environment variables + await dotenv.load(fileName: Environment.fileName); + + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + initialRoute: 'login', + debugShowCheckedModeBanner: false, + routes: { + 'splash': (context) => SplashScreen(), + 'login': (context) => login(), + 'verify': (context) => MyVerify( + verificationId: '', + mobileNumber: '', + resendToken: null, + onResendCode: (String, int) {}, + ), + 'pinSettingPage': (context) => pinSettingPage(), + 'pinPage': (context) => pinPage(), + 'changePin': (context) => changePin(), + 'home': (context) => Home(), + 'policies': (context) => policies(), + 'claims': (context) => claims(), + 'help': (context) => help(), + 'claimprocess': (context) => claimprocess(), + 'profile': (context) => profile(), + 'wellness': (context) => wellness(), + 'planclaimsform': (context) => planclaimsform(), + 'claimtracklist': (context) => claimtracklist(), + 'privacypolicy': (context) => privacypolicy(), + 'termsofuse': (context) => termsofuse(), + 'chatbot': (context) => chatbot(), + 'generalExclusionsDeductibles': (context) => + generalExclusionsDeductibles(), + 'empDetails': (context) => empDetails(), + 'addOnsDetails': (context) => addOnsDetails(), + 'empReviewDetails': (context) => empReviewDetails(), + // Add more routes here... + }, + ); + } +} + +// Lightweight splash screen to show during app startup +class SplashScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + // Simulate a brief delay before redirecting to the login screen + Future.delayed(Duration(seconds: 2), () { + Navigator.pushReplacementNamed(context, 'login'); + }); + + return Scaffold( + body: 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 + ), + ), + ); + } } diff --git a/lib/pages/enrollment/addons.dart b/lib/pages/enrollment/addons.dart index 861b5f4..ea1d8b1 100644 --- a/lib/pages/enrollment/addons.dart +++ b/lib/pages/enrollment/addons.dart @@ -112,6 +112,7 @@ class _addOnsDetailsState extends State { dynamic addOnsDependentPremiumGst; dynamic topUpSiPremiumGst; dynamic addOnsDependentTotalAmt; + // dynamic topUpSiTotalAmt; dynamic topUpSiTotalAmt; late TextEditingController _relationShipController; late TextEditingController _dobController; @@ -349,18 +350,19 @@ class _addOnsDetailsState extends State { topUpSiValue != 0 ? topUpSiValue.toString() : null; if (topUpSiSelectedSI != null) { print('topUpSiSelectedSI'); - - _topUpSiSwitcher = true; setState(() { - topUpSiPremiumValue = topUpSiPolicies['gmc_si_topup'] - ['family_floaters_of_only_si_premium_value']; + _topUpSiSwitcher = true; + topUpSiPremiumValue = (topUpSiPolicies['gmc_si_topup'] + ['family_floaters_of_only_si_premium_value'] as double) + .toInt(); - topUpSiPremiumGst = topUpSiPolicies['gmc_si_topup'] - ['family_floaters_of_only_si_gst_value']; + topUpSiPremiumGst = (topUpSiPolicies['gmc_si_topup'] + ['family_floaters_of_only_si_gst_value'] as double) + .toInt(); - double topUpSum = topUpSiPremiumValue + topUpSiPremiumGst; + topUpSiTotalAmt = topUpSiPremiumValue + topUpSiPremiumGst; - topUpSiTotalAmt = double.parse(topUpSum.toStringAsFixed(2)); + // topUpSiTotalAmt = (topUpSum as double).toInt(); }); } // }); @@ -447,22 +449,21 @@ class _addOnsDetailsState extends State { topUpParentSiValue != 0 ? topUpParentSiValue.toString() : null; if (topUpParentSiSelectedSI != null) { print('topUpParentSiSelectedSI'); - - _topUpParentSiSwitcher = true; setState(() { + _topUpParentSiSwitcher = true; topUpParentSiPremiumValue = - topUpSiParentPolicies['gmc_si_parent_topup'] - ['family_floaters_of_only_si_premium_value']; + (topUpSiParentPolicies['gmc_si_parent_topup'] + ['family_floaters_of_only_si_premium_value'] + as double) + .toInt(); topUpParentSiPremiumGst = - topUpSiParentPolicies['gmc_si_parent_topup'] - ['family_floaters_of_only_si_gst_value']; - - double topUpParentsSum = - topUpParentSiPremiumValue + topUpParentSiPremiumGst; + (topUpSiParentPolicies['gmc_si_parent_topup'] + ['family_floaters_of_only_si_gst_value'] as double) + .toInt(); topUpParentSiTotalAmt = - double.parse(topUpParentsSum.toStringAsFixed(2)); + topUpParentSiPremiumValue + topUpParentSiPremiumGst; }); } // }); @@ -544,21 +545,23 @@ class _addOnsDetailsState extends State { ? addOnsdependentValue.toString() : null; if (addOnsSelectedDependent != null) { - _addOnsDependentSwitcher = true; setState(() { - addOnDependentPremiumValue = - addOnsDependentPolicies['gmc_dependent_addon'] - ['family_floaters_of_dependent_and_si_premium_value']; + _addOnsDependentSwitcher = true; + addOnDependentPremiumValue = (addOnsDependentPolicies[ + 'gmc_dependent_addon'][ + 'family_floaters_of_dependent_and_si_premium_value'] + as double) + .toInt(); + ; addOnsDependentPremiumGst = - addOnsDependentPolicies['gmc_dependent_addon'] - ['family_floaters_of_dependent_and_gst_value']; - - double addOnsSum = - addOnDependentPremiumValue + addOnsDependentPremiumGst; + (addOnsDependentPolicies['gmc_dependent_addon'] + ['family_floaters_of_dependent_and_gst_value'] + as double) + .toInt(); addOnsDependentTotalAmt = - double.parse(addOnsSum.toStringAsFixed(2)); + addOnDependentPremiumValue + addOnsDependentPremiumGst; }); addOnsDependentECardDownload = @@ -848,6 +851,7 @@ class _addOnsDetailsState extends State { 'employee_id': employee_id, 'client_id': client_id, 'emp_code': empCodeString, + 'client_branch_id': empClientBranchId, }; // Add the map to the list @@ -918,6 +922,7 @@ class _addOnsDetailsState extends State { 'employee_id': employee_id, 'client_id': client_id, 'emp_code': empCodeString, + 'client_branch_id': empClientBranchId, }; // Add the map to the list @@ -1053,11 +1058,15 @@ class _addOnsDetailsState extends State { } print('Sum of gst: $topUpGstSum'); setState(() { - topUpSiPremiumValue = topUpRataPremimumSum; + topUpSiPremiumValue = (topUpRataPremimumSum as double).toInt(); print(topUpSiPremiumValue); - topUpSiPremiumGst = topUpGstSum; + topUpSiPremiumGst = (topUpGstSum as double).toInt(); print(topUpSiPremiumGst); + topUpSiTotalAmt = topUpSiPremiumValue + topUpSiPremiumGst; + + // topUpSiTotalAmt = (topUpSum as double).toInt(); + print(topUpSiTotalAmt); }); sendAddonsGmcSiToAPI(); @@ -1120,9 +1129,10 @@ class _addOnsDetailsState extends State { } print('Sum of gst: $topUpGstSum'); setState(() { - topUpParentSiPremiumValue = topUpRataPremimumSum; + topUpParentSiPremiumValue = + (topUpRataPremimumSum as double).toInt(); print(topUpParentSiPremiumValue); - topUpParentSiPremiumGst = topUpGstSum; + topUpParentSiPremiumGst = (topUpGstSum as double).toInt(); print(topUpSiPremiumGst); topUpParentSiTotalAmt = topUpParentSiPremiumValue + topUpParentSiPremiumGst; @@ -1188,9 +1198,10 @@ class _addOnsDetailsState extends State { } print('Sum of gst: $addOnsGstSum'); setState(() { - addOnDependentPremiumValue = addOnsRataPremimumSum; + addOnDependentPremiumValue = + (addOnsRataPremimumSum as double).toInt(); print(addOnDependentPremiumValue); - addOnsDependentPremiumGst = addOnsGstSum; + addOnsDependentPremiumGst = (addOnsGstSum as double).toInt(); print(addOnsDependentPremiumGst); addOnsDependentTotalAmt = addOnDependentPremiumValue + addOnsDependentPremiumGst; @@ -1919,8 +1930,8 @@ class _addOnsDetailsState extends State { // Add your logic here based on the toggle state }); }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON + activeColor: Colors + .green, // Color when the switch is ON inactiveTrackColor: Colors .grey, // Color of the switch track when OFF ), @@ -2556,8 +2567,8 @@ class _addOnsDetailsState extends State { // Add your logic here based on the toggle state }); }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON + activeColor: Colors + .green, // Color when the switch is ON inactiveTrackColor: Colors .grey, // Color of the switch track when OFF ), @@ -3194,8 +3205,8 @@ class _addOnsDetailsState extends State { // Add your logic here based on the toggle state }); }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON + activeColor: Colors + .green, // Color when the switch is ON inactiveTrackColor: Colors .grey, // Color of the switch track when OFF ), diff --git a/lib/pages/enrollment/empDetails.dart b/lib/pages/enrollment/empDetails.dart index fd36324..4c4174f 100644 --- a/lib/pages/enrollment/empDetails.dart +++ b/lib/pages/enrollment/empDetails.dart @@ -134,6 +134,7 @@ class _empDetailsState extends State { empPrimaryId = prefs.getString('empPrimaryId'); gpaEmpName = prefs.getString('gpaEmpName'); client_id = prefs.getString('client_id'); + selfEmpStatus = prefs.getString('selfEmpStatus'); print('client_id : $client_id'); if (prefs.containsKey('clientLogo') && prefs.containsKey('clientName')) { @@ -434,10 +435,10 @@ class _empDetailsState extends State { } void saveFamilyMemberDetails(Map formData, - Map floatedData, action) async { + Map floatedData, action, gmcSumInsured) async { // Construct the array of objects print(formData); - print(floatedData); + print('floatedData $floatedData'); print(action); final SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -462,6 +463,7 @@ class _empDetailsState extends State { 'created_by': primaryId, 'is_createdby_hr': is_createdby_hr, 'unit': selfUnit, + 'basic_cover_si': gmcSumInsured, // Add the 'id' field only if action is 'Edit' if (action == 'Edit') 'id': floatedData['employee_id'], }); @@ -869,7 +871,7 @@ class _empDetailsState extends State { } } - void openForm(Map floaterData, action) { + void openForm(Map floaterData, action, gmcSumInsured) { print(action); print(floaterData); print(relationshipOptions); @@ -1145,7 +1147,10 @@ class _empDetailsState extends State { // Call the function to send form data to API saveFamilyMemberDetails( - formData, floaterData, action); + formData, + floaterData, + action, + gmcSumInsured); // Close the dialog Navigator.of(context).pop(); @@ -1971,7 +1976,8 @@ class _empDetailsState extends State { if (floaterData['relationship'] == 'Self') { openSelfForm('View'); } else { - openForm(floaterData, 'Edit'); + openForm( + floaterData, 'Edit', gmcSumInsured); } }, child: Text( @@ -2005,7 +2011,7 @@ class _empDetailsState extends State { // Handle the click event to open the form if (gmcOpenForEnrollment != 0) { if (gmcECardDownload == null) { - openForm(floaterData, 'Add'); + openForm(floaterData, 'Add', gmcSumInsured); } } }, diff --git a/lib/pages/enrollment/empReview.dart b/lib/pages/enrollment/empReview.dart index d3e79b5..9b252be 100644 --- a/lib/pages/enrollment/empReview.dart +++ b/lib/pages/enrollment/empReview.dart @@ -28,6 +28,10 @@ class _empReviewDetailsState extends State { late ApiService apiService; bool isLoading = true; bool isChecked = false; // Declare the _isSwitched variable here + bool topUpSiIsChecked = false; // Declare the _isSwitched variable here + bool topUpParentIsChecked = false; // Declare the _isSwitched variable here + bool addOnsDependentIsChecked = + false; // Declare the _isSwitched variable here dynamic _token; dynamic empCodeString; dynamic empPrimaryId; @@ -72,6 +76,7 @@ class _empReviewDetailsState extends State { dynamic addOnsDependentPolicyType; dynamic addOnsFloaterTextHeading; dynamic addOnsDependentECardDownload; + dynamic addOnsDependentDisclaimer; dynamic addOnsFamilyFloater; late DateTime? selectedDate; double totalPayableAmt = 0.0; @@ -86,21 +91,22 @@ class _empReviewDetailsState extends State { dynamic topUpPolicyName; dynamic topUpPolicyType; dynamic topUpTypeName; - double topUpSiPremiumValue = 0.0; - double topUpSiPremiumGst = 0.0; - double topUpSiTotalAmt = 0.0; - double topUpParentSiPremiumValue = 0.0; - double topUpParentSiPremiumGst = 0.0; - double topUpParentSiTotalAmt = 0.0; + dynamic topUpSiPremiumValue; + dynamic topUpSiPremiumGst; + dynamic topUpSiTotalAmt; + dynamic topUpParentSiPremiumValue; + dynamic topUpParentSiPremiumGst; + dynamic topUpParentSiTotalAmt; // int addOnDependentPremiumValue = 0; - double addOnDependentPremiumValue = 0.0; - double addOnsDependentPremiumGst = 0.0; - double addOnsDependentTotalAmt = 0.0; + dynamic addOnDependentPremiumValue; + dynamic addOnsDependentPremiumGst; + dynamic addOnsDependentTotalAmt; dynamic topUpSiValue; dynamic topUpSiSelectedSI; dynamic topUpSumInsured; dynamic topUpFloaterTextHeading; dynamic topUpECardDownload; + dynamic topUpDisclaimer; int showHideTopUpCard = 0; int showHideAddOnsCard = 0; int showHideTopUpParentCard = 0; @@ -117,6 +123,7 @@ class _empReviewDetailsState extends State { dynamic topUpParentSiSelectedSI; dynamic topUpParentTypeName; dynamic topUpParentFloterTextHeading; + dynamic topUpParentDisclaimer; int topUpParentOpenForEnrollment = 0; int activeSiData = 0; int activeSiParentData = 0; @@ -400,6 +407,9 @@ class _empReviewDetailsState extends State { topUpECardDownload = topUpSiPolicies['gmc_si_topup']['eCardDownload']; + + topUpDisclaimer = + await topUpSiPolicies['gmc_si_topup']['disclaimer']; // }); } else { print('No data found in the response'); @@ -489,6 +499,10 @@ class _empReviewDetailsState extends State { } else { showHideTopUpParentCard = 1; } + + topUpParentDisclaimer = + await topUpSiParentPolicies['gmc_si_parent_topup'] + ['disclaimer']; } else { print('No data found in the response'); } @@ -557,6 +571,10 @@ class _empReviewDetailsState extends State { addOnsDependentECardDownload = addOnsDependentPolicies['gmc_dependent_addon']['eCardDownload']; + + addOnsDependentDisclaimer = + await addOnsDependentPolicies['gmc_dependent_addon'] + ['disclaimer']; } else { print('No data found in the response'); } @@ -662,6 +680,9 @@ class _empReviewDetailsState extends State { setState(() { isLoading = false; isChecked = false; + topUpSiIsChecked = false; + topUpParentIsChecked = false; + addOnsDependentIsChecked = false; }); print('response.statusCode == 200'); ToastHelper.showSuccessToast(context, 'Saved Successfully...'); @@ -758,6 +779,13 @@ class _empReviewDetailsState extends State { } } + bool isSubmitEnabled() { + return isChecked && + (activeSiData == 1 ? topUpSiIsChecked : true) && + (activeSiParentData == 1 ? topUpParentIsChecked : true) && + (activeDependentData == 1 ? addOnsDependentIsChecked : true); + } + @override Widget build(BuildContext context) { if ((gpaMappedFamilyFloaters == [] && gpaMappedFamilyFloaters == null) && @@ -2158,6 +2186,187 @@ class _empReviewDetailsState extends State { ], ), ), + SizedBox(height: 15), + if (activeSiData == 1) + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Checkbox( + value: topUpSiIsChecked, + onChanged: (bool? value) { + setState(() { + topUpSiIsChecked = value!; + }); + }, + activeColor: + Color(0xFFE26728), + ), + ], + ))), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + topUpDisclaimer ?? '', + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + if (activeSiParentData == 1) + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Checkbox( + value: topUpParentIsChecked, + onChanged: (bool? value) { + setState(() { + topUpParentIsChecked = + value!; + }); + }, + activeColor: + Color(0xFFE26728), + ), + ], + ))), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + topUpParentDisclaimer ?? '', + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + if (activeDependentData == 1) + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Checkbox( + value: + addOnsDependentIsChecked, + onChanged: (bool? value) { + setState(() { + addOnsDependentIsChecked = + value!; + }); + }, + activeColor: + Color(0xFFE26728), + ), + ], + ))), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + addOnsDependentDisclaimer ?? + '', + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ], + ))), + ], + ), + ), SizedBox( height: Responsive.isDesktop(context) ? 15 : 0), Container( @@ -2206,8 +2415,9 @@ class _empReviewDetailsState extends State { height: 150, alignment: Alignment.centerRight, child: ElevatedButton( - onPressed: - isChecked ? sendAddOnAPI : null, + onPressed: isSubmitEnabled() + ? sendAddOnAPI + : null, child: Text( 'Submit', style: GoogleFonts.poppins( diff --git a/lib/pages/login.dart b/lib/pages/login.dart index 6800f53..b44bc4f 100644 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -405,6 +405,11 @@ class _loginState extends State { )), ], ), + // SizedBox( + // height: Responsive.isDesktop(context) + // ? _size.height * 0.1 + // : 10, + // ), SizedBox(height: 10), Container( margin: Responsive.isDesktop(context) @@ -570,117 +575,123 @@ class _loginState extends State { SizedBox( height: _size.width <= 1100 ? 0 : 0, ), - _size.width > 1100 - ? Container( - margin: EdgeInsets.symmetric( - horizontal: 150), - child: Column( - children: [ - SizedBox(height: 30), - 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"), - ], - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets - .symmetric( - vertical: - 12), - child: Column( - children: [ - Icon( - Icons - .edit, - color: Color( - 0xFFE26728)), - SizedBox( - height: - 10), - Text( - "Manage Claims"), - ], - ), - ), - ), - ], - ), - ), - ), - ], - ), - ) - : SizedBox( - height: Responsive.isDesktop( - context) - ? _size.height * 0.1 - : _size.height * 0.2, - ), + // _size.width > 1100 + // ? Container( + // margin: EdgeInsets.symmetric( + // horizontal: 150), + // child: Column( + // children: [ + // SizedBox(height: 30), + // 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"), + // ], + // ), + // ), + // ), + // Expanded( + // child: Container( + // padding: EdgeInsets + // .symmetric( + // vertical: + // 12), + // child: Column( + // children: [ + // Icon( + // Icons + // .edit, + // color: Color( + // 0xFFE26728)), + // SizedBox( + // height: + // 10), + // Text( + // "Manage Claims"), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ) + // : SizedBox( + // height: Responsive.isDesktop( + // context) + // ? _size.height * 0.1 + // : _size.height * 0.2, + // ), SizedBox( - height: _size.height * 0.1, + height: Responsive.isDesktop(context) + ? _size.height * 0.3 + : _size.height * 0.2, ), + + // SizedBox( + // height: _size.height * 0.1, + // ), Container( alignment: Alignment.bottomCenter, padding: diff --git a/lib/pages/postEnrollment/chatbot.dart b/lib/pages/postEnrollment/chatbot.dart index 743dd53..9802d8a 100644 --- a/lib/pages/postEnrollment/chatbot.dart +++ b/lib/pages/postEnrollment/chatbot.dart @@ -454,8 +454,8 @@ class _chatbotState extends State { Container( margin: EdgeInsets.only( top: 10, bottom: 10, left: 10, right: 10), - width: Responsive.isDesktop(context) ? 230 : 170, - height: Responsive.isDesktop(context) ? 230 : 170, + width: Responsive.isDesktop(context) ? 150 : 130, + height: Responsive.isDesktop(context) ? 150 : 130, child: Image.asset( 'assets/nhance_client_logo.png', fit: BoxFit.contain, // Adjust the fit as needed diff --git a/lib/pages/postEnrollment/home.dart b/lib/pages/postEnrollment/home.dart index 3f1e07f..8021e51 100644 --- a/lib/pages/postEnrollment/home.dart +++ b/lib/pages/postEnrollment/home.dart @@ -14,14 +14,14 @@ import '../../customAppBar/tabs.dart'; import '../../customAppBar/toastHelper.dart'; import 'chatbot.dart'; -class MyApp extends StatefulWidget { - const MyApp({Key? key}) : super(key: key); +class Home extends StatefulWidget { + const Home({Key? key}) : super(key: key); @override - State createState() => _MyAppState(); + State createState() => _HomeState(); } -class _MyAppState extends State { +class _HomeState extends State { bool isLoadingGif = false; late ApiService apiService; int _currentIndex = 0; diff --git a/lib/pages/verify.dart b/lib/pages/verify.dart index 283d760..a291f33 100644 --- a/lib/pages/verify.dart +++ b/lib/pages/verify.dart @@ -535,6 +535,11 @@ class _MyVerifyState extends State { ], ), SizedBox(height: 10), + // SizedBox( + // height: Responsive.isDesktop(context) + // ? _size.height * 0.1 + // : 10, + // ), Container( margin: Responsive.isDesktop(context) ? EdgeInsets.symmetric( @@ -676,121 +681,126 @@ class _MyVerifyState extends State { ), ), ), - _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, - ), + // _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: _size.height * 0.1, + height: Responsive.isDesktop(context) + ? _size.height * 0.3 + : _size.height * 0.2, ), + // SizedBox( + // height: _size.height * 0.1, + // ), Container( alignment: Alignment.bottomCenter, padding: diff --git a/pubspec.yaml b/pubspec.yaml index 431d197..547a9f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -84,6 +84,8 @@ flutter: - .env - .env.development - .env.production + - .env.test + - .env.uat # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 73164d4..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:nhance_app_pwa/main.dart'; -import 'package:nhance_app_pwa/pages/postEnrollment/home.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/web/index.html b/web/index.html index a2f1c79..22954af 100644 --- a/web/index.html +++ b/web/index.html @@ -17,7 +17,7 @@ - nhance_app_pwa + Nhance - - @@ -82,9 +77,6 @@ window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ - serviceWorker: { - serviceWorkerVersion: serviceWorkerVersion, - }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); @@ -100,7 +92,7 @@ if(loadingIndicator){ loadingIndicator.remove(); } - },5000); + }); };