diff --git a/assets/Template_File.xlsx b/assets/Template_File.xlsx index c8c892b..ac4600c 100644 Binary files a/assets/Template_File.xlsx and b/assets/Template_File.xlsx differ diff --git a/lib/main.dart b/lib/main.dart index 016710e..28a4a42 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -29,16 +29,13 @@ import 'models/environment.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // Initialize Firebase only if it's not already initialized - if (Firebase.apps.isEmpty) { - await Firebase.initializeApp( - options: const FirebaseOptions( - apiKey: 'AIzaSyC4yHbCX4mQu0jO81pJrDwxKLQlTQWofrc', - appId: '1:1084115316849:android:963ff492c3d23ab06c6bd0', - messagingSenderId: '1084115316849', - projectId: 'nhance-ee8d1')); - await dotenv.load(fileName: Environment.fileName); - } + await Firebase.initializeApp( + options: const FirebaseOptions( + apiKey: 'AIzaSyC4yHbCX4mQu0jO81pJrDwxKLQlTQWofrc', + appId: '1:1084115316849:android:963ff492c3d23ab06c6bd0', + messagingSenderId: '1084115316849', + projectId: 'nhance-ee8d1')); + await dotenv.load(fileName: Environment.fileName); // Load environment variables await dotenv.load(fileName: Environment.fileName); diff --git a/lib/pages/enrollment/addons.dart b/lib/pages/enrollment/addons.dart index a3e9a4c..aba1029 100644 --- a/lib/pages/enrollment/addons.dart +++ b/lib/pages/enrollment/addons.dart @@ -29,6 +29,7 @@ class _addOnsDetailsState extends State { late ApiService apiService; bool isLoading = true; bool isChecked = false; + bool disclaimeStatus = false; bool _addOnsDependentSwitcher = false; // Declare the _isSwitched variable here bool _topUpSiSwitcher = false; @@ -130,6 +131,9 @@ class _addOnsDetailsState extends State { dynamic empRefId; dynamic empClientBranchId; dynamic selfEmpStatus; + List> allDisclaimer = + []; // Declare this to store all disclaimers + late List checkboxValues; @override void initState() { @@ -144,6 +148,7 @@ class _addOnsDetailsState extends State { isLoading = false; }); }); + checkboxValues = List.filled(allDisclaimer.length, false); } @override @@ -242,6 +247,48 @@ class _addOnsDetailsState extends State { if (response['status'] == 'success') { setState(() { gpaPolicies = response['data']; + for (var item in gpaPolicies) { + // Extract disclaimer value from each object + dynamic disclaimer = item['disclaimer']; + + if (disclaimer != null && disclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (disclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': disclaimer, + 'checked': false, + }); + } else if (disclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + disclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + } }); } else { setState(() { @@ -269,6 +316,47 @@ class _addOnsDetailsState extends State { if (response['status'] == 'success') { // setState(() { gmcPolicies = response['data']; + for (var item in gmcPolicies) { + // Extract disclaimer value from each object + dynamic disclaimer = item['disclaimer']; + + if (disclaimer != null && disclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (disclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': disclaimer, + 'checked': false, + }); + } else if (disclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + disclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer.any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + } // }); // Assuming data is a List } else { @@ -1135,12 +1223,15 @@ class _addOnsDetailsState extends State { isChecked = false; }); ToastHelper.showSuccessToast(context, 'Saved Successfully...'); + _showSuccessDialog(); } else { setState(() { isLoading = false; }); // Handle other status codes - ToastHelper.showErrorToast(context, 'failed to save'); + ToastHelper.showErrorToast(context, 'Failed to Save'); + _showErrorDialog(); + print('Request failed with status: ${response['code']}'); } } catch (e) { setState(() { @@ -1198,6 +1289,89 @@ class _addOnsDetailsState extends State { await prefs.setString('dependentData', jsonEncode(dependentData)); } + void _showSuccessDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + backgroundColor: Colors.white, + title: Text( + 'Success', + style: GoogleFonts.poppins( + color: Colors.green, + ), + ), + content: Text('Enrollment Completed'), + actions: [ + TextButton( + child: Text( + 'OK', + style: GoogleFonts.poppins( + color: Color(0xFFE26728), + ), + ), + onPressed: () { + Navigator.popAndPushNamed(context, 'home'); + }, + ), + ], + ); + }, + ); + } + + void _showErrorDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text( + 'Error', + style: GoogleFonts.poppins( + color: Colors.red, + ), + ), + content: Text('Something went wrong. Enrollemnt not completed'), + actions: [ + TextButton( + child: Text( + 'OK', + style: GoogleFonts.poppins( + color: Color(0xFFE26728), + ), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + + bool isSubmitEnabled() { + // // Convert to integers and handle null values by defaulting to 0 + // bool enrollmentConditionsMet = + // (int.tryParse(topUpOpenForEnrollment ?? '0') != 0) && + // (int.tryParse(topUpParentOpenForEnrollment ?? '0') != 0) && + // (int.tryParse(addOnsDependentOpenForEnrollment ?? '0') != 0); + // + // print('enrollmentConditionsMet: $enrollmentConditionsMet'); + // print('gmcEnrollmentStatus: $gmcEnrollmentStatus'); + + // return isChecked && + // enrollmentConditionsMet && + // gmcEnrollmentStatus && + // (activeSiData == 1 ? topUpSiIsChecked : true) && + // (activeSiParentData == 1 ? topUpParentIsChecked : true) && + // (activeDependentData == 1 ? addOnsDependentIsChecked : true); + disclaimeStatus = allDisclaimer.every((item) => item['checked'] == true); + + // Combine the `disclaimeStatus` and `isChecked` conditions + return isChecked && disclaimeStatus; + } + @override Widget build(BuildContext context) { if (gpaDataIsEmpty == 0 && gmcDataIsEmpty == 0) { @@ -1607,7 +1781,7 @@ class _addOnsDetailsState extends State { color: Color(0xFF181818)), ), Text( - 'Increase your medical cover for your family or add parents or parent in laws by paying additional premium', + 'Medical coverage for your parents or in-laws by paying an additional premium', textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: @@ -1624,6 +1798,594 @@ class _addOnsDetailsState extends State { ), ), SizedBox(height: 15), + if (addOnsDependentMappedFamilyFloatersDependent != + null) + Container( + decoration: BoxDecoration( + color: Color( + 0xFFDDF3FF), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(25) + : EdgeInsets.all(10), + child: Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 6 + : 8, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + Responsive.isDesktop( + context) + ? addOnsDependentPolicyName + : addOnsDependentPolicyType, + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + Text( + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + ), + ), + ], + ))), + if (Responsive.isDesktop(context) && + _addOnsDependentSwitcher) + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + addOnsSelectedDependent = + value; + }); + addOnsDependentCalculation( + value); + // calculationForDependentSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + addOnsSelectedDependent, + items: (addOnsDependentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + Expanded( + flex: 3, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Switch( + value: + _addOnsDependentSwitcher, + onChanged: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)) + ? null + : (value) { + setState(() { + _addOnsDependentSwitcher = + value; + // Add your logic here based on the toggle state + }); + }, + activeColor: Colors + .green, // Color when the switch is ON + inactiveTrackColor: Colors + .grey, // Color of the switch track when OFF + ), + ], + ))), + ], + ), + if (_addOnsDependentSwitcher == true) + SizedBox(height: 10), + if (!Responsive.isDesktop(context) && + _addOnsDependentSwitcher == true) + Row( + children: [ + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + addOnsSelectedDependent = + value; + }); + addOnsDependentCalculation( + value); + // calculationForDependentSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + addOnsSelectedDependent, + items: (addOnsDependentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + ], + ), + SizedBox(height: 20), + if (_addOnsDependentSwitcher == true) + Column( + children: familyFloaterContainers, + ), + if (_addOnsDependentSwitcher) + SizedBox(height: 20), + if (Responsive.isDesktop(context) && + _addOnsDependentSwitcher) + 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( + addOnDependentPremiumValue != + null + ? '₹ $addOnDependentPremiumValue/Year' + : 'N/A', + 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( + addOnsDependentPremiumGst != + null + ? '₹ $addOnsDependentPremiumGst/-' + : 'N/A', + 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( + addOnsDependentTotalAmt != + null + ? '₹ $addOnsDependentTotalAmt/-' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + ], + ), + if (!Responsive.isDesktop(context) && + _addOnsDependentSwitcher == true) + 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: + 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: + CrossAxisAlignment + .center, + children: [ + Text( + addOnDependentPremiumValue != + null + ? '₹ $addOnDependentPremiumValue/Year' + : 'N/A', + 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: + CrossAxisAlignment + .center, + children: [ + Text( + addOnsDependentPremiumGst != + null + ? '₹ $addOnsDependentPremiumGst/-' + : 'N/A', + 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: + CrossAxisAlignment + .center, + children: [ + Text( + addOnsDependentTotalAmt != + null + ? '₹ $addOnsDependentTotalAmt/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + ])) + ], + )), + SizedBox(height: 15), if (topUpMappedFamilyFloatersSi != null) Container( decoration: BoxDecoration( @@ -2898,594 +3660,6 @@ class _addOnsDetailsState extends State { ], ), ), - SizedBox(height: 15), - if (addOnsDependentMappedFamilyFloatersDependent != - null) - Container( - decoration: BoxDecoration( - color: Color( - 0xFFDDF3FF), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(25) - : EdgeInsets.all(10), - child: Column( - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop( - context) - ? 6 - : 8, - child: Container( - alignment: - Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .start, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Text( - Responsive.isDesktop( - context) - ? addOnsDependentPolicyName - : addOnsDependentPolicyType, - textAlign: - TextAlign.left, - style: GoogleFonts - .poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - Text( - '', - textAlign: - TextAlign.left, - style: GoogleFonts - .poppins( - fontSize: Responsive - .isDesktop( - context) - ? 18 - : 14, - ), - ), - ], - ))), - if (Responsive.isDesktop(context) && - _addOnsDependentSwitcher) - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: - Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: - (value) { - setState(() { - addOnsSelectedDependent = - value; - }); - addOnsDependentCalculation( - value); - // calculationForDependentSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets.symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - addOnsSelectedDependent, - items: (addOnsDependentSlabRates ?? - []) - .map>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn[ - 'si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - Expanded( - flex: 3, - child: Container( - alignment: - Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment - .end, - children: [ - Switch( - value: - _addOnsDependentSwitcher, - onChanged: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)) - ? null - : (value) { - setState(() { - _addOnsDependentSwitcher = - value; - // Add your logic here based on the toggle state - }); - }, - activeColor: Colors - .green, // Color when the switch is ON - inactiveTrackColor: Colors - .grey, // Color of the switch track when OFF - ), - ], - ))), - ], - ), - if (_addOnsDependentSwitcher == true) - SizedBox(height: 10), - if (!Responsive.isDesktop(context) && - _addOnsDependentSwitcher == true) - Row( - children: [ - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: - Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: - (value) { - setState(() { - addOnsSelectedDependent = - value; - }); - addOnsDependentCalculation( - value); - // calculationForDependentSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets.symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - addOnsSelectedDependent, - items: (addOnsDependentSlabRates ?? - []) - .map>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn[ - 'si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - ], - ), - SizedBox(height: 20), - if (_addOnsDependentSwitcher == true) - Column( - children: familyFloaterContainers, - ), - if (_addOnsDependentSwitcher) - SizedBox(height: 20), - if (Responsive.isDesktop(context) && - _addOnsDependentSwitcher) - 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( - addOnDependentPremiumValue != - null - ? '₹ $addOnDependentPremiumValue/Year' - : 'N/A', - 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( - addOnsDependentPremiumGst != - null - ? '₹ $addOnsDependentPremiumGst/-' - : 'N/A', - 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( - addOnsDependentTotalAmt != - null - ? '₹ $addOnsDependentTotalAmt/-' - : 'N/A', - textAlign: - TextAlign.start, - style: GoogleFonts - .poppins( - fontSize: 18, - ), - ), - ], - ))), - ], - ), - if (!Responsive.isDesktop(context) && - _addOnsDependentSwitcher == true) - 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: - 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: - CrossAxisAlignment - .center, - children: [ - Text( - addOnDependentPremiumValue != - null - ? '₹ $addOnDependentPremiumValue/Year' - : 'N/A', - 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: - CrossAxisAlignment - .center, - children: [ - Text( - addOnsDependentPremiumGst != - null - ? '₹ $addOnsDependentPremiumGst/-' - : 'N/A', - 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: - CrossAxisAlignment - .center, - children: [ - Text( - addOnsDependentTotalAmt != - null - ? '₹ $addOnsDependentTotalAmt/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: - 16, - ), - ), - ], - ))), - ], - ), - ])) - ], - )), ], ), )), @@ -3559,6 +3733,79 @@ class _addOnsDetailsState extends State { ], ), ), + SizedBox( + height: + Responsive.isDesktop(context) ? 15 : 0), + Container( + // padding: EdgeInsets.all(8.0), + 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 Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: + Alignment.centerLeft, + child: 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: Color( + 0xFFE26728), // Custom color + ), + ), + ), + Expanded( + flex: 11, + child: Container( + alignment: + Alignment.centerLeft, + child: Text( + disclaimer, + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ), + ), + ], + ); + }).toList(), + ), + ), SizedBox( height: Responsive.isDesktop(context) ? 15 : 0), @@ -3601,8 +3848,9 @@ class _addOnsDetailsState 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/enrollment/empReview.dart b/lib/pages/enrollment/empReview.dart index bc52643..e342f9e 100644 --- a/lib/pages/enrollment/empReview.dart +++ b/lib/pages/enrollment/empReview.dart @@ -28,10 +28,12 @@ class _empReviewDetailsState extends State { late ApiService apiService; bool isLoading = true; bool isChecked = false; // Declare the _isSwitched variable here + bool disclaimeStatus = 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; @@ -50,6 +52,7 @@ class _empReviewDetailsState extends State { dynamic gpaSelfDetails; dynamic gpaECardDownload; dynamic gmcECardDownload; + dynamic gmcDisclaimer; dynamic gmcClintPolicyId = 0; dynamic gmcMappedFamilyFloaters = []; dynamic gmcSelfName; @@ -137,6 +140,9 @@ class _empReviewDetailsState extends State { dynamic topUpParentOpenForEnrollment; dynamic addOnsDependentOpenForEnrollment; bool gmcEnrollmentStatus = false; + List> allDisclaimer = + []; // Declare this to store all disclaimers + late List checkboxValues; @override void initState() { @@ -148,6 +154,7 @@ class _empReviewDetailsState extends State { isLoading = false; }); }); + checkboxValues = List.filled(allDisclaimer.length, false); } @override @@ -322,6 +329,48 @@ class _empReviewDetailsState extends State { setState(() { gpaPolicies = response['data']; print('gpaPolicies'); + for (var item in gpaPolicies) { + // Extract disclaimer value from each object + dynamic disclaimer = item['disclaimer']; + + if (disclaimer != null && disclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (disclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': disclaimer, + 'checked': false, + }); + } else if (disclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + disclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + } }); } else { setState(() { @@ -350,6 +399,48 @@ class _empReviewDetailsState extends State { setState(() { gmcPolicies = response['data']; print('gmcPolicies'); + for (var item in gmcPolicies) { + // Extract disclaimer value from each object + dynamic disclaimer = item['disclaimer']; + + if (disclaimer != null && disclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (disclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': disclaimer, + 'checked': false, + }); + } else if (disclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + disclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + } }); // Assuming data is a List print(gmcPolicies); @@ -417,6 +508,45 @@ class _empReviewDetailsState extends State { topUpDisclaimer = await topUpSiPolicies['gmc_si_topup']['disclaimer']; + + if (topUpDisclaimer != null && topUpDisclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (topUpDisclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': topUpDisclaimer, + 'checked': false, + }); + } else if (topUpDisclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + topUpDisclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + // allDisclaimer = allDisclaimer.toSet().toList(); // }); } else { print('No data found in the response'); @@ -514,6 +644,45 @@ class _empReviewDetailsState extends State { topUpParentDisclaimer = await topUpSiParentPolicies['gmc_si_parent_topup'] ['disclaimer']; + + if (topUpParentDisclaimer != null && + topUpParentDisclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (topUpParentDisclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': topUpParentDisclaimer, + 'checked': false, + }); + } else if (topUpParentDisclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + topUpParentDisclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } } else { print('No data found in the response'); } @@ -587,6 +756,45 @@ class _empReviewDetailsState extends State { await addOnsDependentPolicies['gmc_dependent_addon'] ['disclaimer']; + if (addOnsDependentDisclaimer != null && + addOnsDependentDisclaimer.isNotEmpty) { + // Temporary list to hold new entries + List> newEntries = []; + + if (addOnsDependentDisclaimer is String) { + // Wrap string in a map with id and checked + newEntries.add({ + 'id': allDisclaimer.length + 1, // Unique ID based on length + 'text': addOnsDependentDisclaimer, + 'checked': false, + }); + } else if (addOnsDependentDisclaimer is List) { + // Convert each string in the list to a map with id and checked + newEntries.addAll( + List>.from( + addOnsDependentDisclaimer.map((text) => { + 'id': allDisclaimer.length + newEntries.length + 1, + 'text': text, + 'checked': false, + }), + ), + ); + } else { + print('Unexpected type for disclaimer'); + } + + // Add new entries to the main list, ensuring no duplicate texts + newEntries.forEach((entry) { + if (!allDisclaimer + .any((item) => item['text'] == entry['text'])) { + allDisclaimer.add(entry); + } + }); + + // Update the state + setState(() {}); + } + addOnsDependentOpenForEnrollment = await addOnsDependentPolicies['gmc_dependent_addon'] ['OpenForEnrollment']; @@ -795,28 +1003,25 @@ class _empReviewDetailsState extends State { } bool isSubmitEnabled() { - print( - 'topUpOpenForEnrollment: $topUpOpenForEnrollment (type: ${topUpOpenForEnrollment?.runtimeType})'); - print( - 'topUpParentOpenForEnrollment: $topUpParentOpenForEnrollment (type: ${topUpParentOpenForEnrollment?.runtimeType})'); - print( - 'addOnsDependentOpenForEnrollment: $addOnsDependentOpenForEnrollment (type: ${addOnsDependentOpenForEnrollment?.runtimeType})'); + // // Convert to integers and handle null values by defaulting to 0 + // bool enrollmentConditionsMet = + // (int.tryParse(topUpOpenForEnrollment ?? '0') != 0) && + // (int.tryParse(topUpParentOpenForEnrollment ?? '0') != 0) && + // (int.tryParse(addOnsDependentOpenForEnrollment ?? '0') != 0); + // + // print('enrollmentConditionsMet: $enrollmentConditionsMet'); + // print('gmcEnrollmentStatus: $gmcEnrollmentStatus'); - // Convert to integers and handle null values by defaulting to 0 - bool enrollmentConditionsMet = - (int.tryParse(topUpOpenForEnrollment ?? '0') != 0) && - (int.tryParse(topUpParentOpenForEnrollment ?? '0') != 0) && - (int.tryParse(addOnsDependentOpenForEnrollment ?? '0') != 0); + // return isChecked && + // enrollmentConditionsMet && + // gmcEnrollmentStatus && + // (activeSiData == 1 ? topUpSiIsChecked : true) && + // (activeSiParentData == 1 ? topUpParentIsChecked : true) && + // (activeDependentData == 1 ? addOnsDependentIsChecked : true); + disclaimeStatus = allDisclaimer.every((item) => item['checked'] == true); - print('enrollmentConditionsMet: $enrollmentConditionsMet'); - print('gmcEnrollmentStatus: $gmcEnrollmentStatus'); - - return isChecked && - enrollmentConditionsMet && - gmcEnrollmentStatus && - (activeSiData == 1 ? topUpSiIsChecked : true) && - (activeSiParentData == 1 ? topUpParentIsChecked : true) && - (activeDependentData == 1 ? addOnsDependentIsChecked : true); + // Combine the `disclaimeStatus` and `isChecked` conditions + return isChecked && disclaimeStatus; } bool isEnrollmentOpen(List? policyList) { @@ -2212,7 +2417,7 @@ class _empReviewDetailsState extends State { Expanded( flex: 11, child: Container( - alignment: Alignment.centerRight, + alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: MainAxisAlignment.end, @@ -2239,168 +2444,53 @@ 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( + SizedBox(height: 10), + Container( + // padding: EdgeInsets.all(8.0), + 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 Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Checkbox( value: - addOnsDependentIsChecked, + isChecked, // Bind to the checked value onChanged: (bool? value) { setState(() { - addOnsDependentIsChecked = - value!; + // Update the checked status + allDisclaimer.firstWhere( + (item) => + item['id'] == id, + )['checked'] = value!; + print(allDisclaimer); }); }, - activeColor: - Color(0xFFE26728), + activeColor: Color( + 0xFFE26728), // Custom color ), - ], - ))), - Expanded( - flex: 11, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - addOnsDependentDisclaimer ?? - '', + ), + ), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerLeft, + child: Text( + disclaimer, textAlign: Responsive.isDesktop( context) @@ -2415,11 +2505,13 @@ class _empReviewDetailsState extends State { color: Color(0xFF292929), ), ), - ], - ))), - ], - ), + ), + ), + ], + ); + }).toList(), ), + ), SizedBox( height: Responsive.isDesktop(context) ? 15 : 0), Container( @@ -2585,6 +2677,11 @@ class _empReviewDetailsState extends State { String? gpaPolicyType = item['type']; String? gpaECardDownload = item['eCardDownload']; String? gpaSumInsured; + print('GPA Disclaimer $allDisclaimer'); + setState(() { + checkboxValues = List.generate(allDisclaimer.length, (_) => false); + }); + List gpaMappedFamilyFloaters = []; if (item['mapped_family_floaters'] != null) { @@ -2777,6 +2874,8 @@ class _empReviewDetailsState extends State { gmcECardDownload = item['eCardDownload']; // gmcSumInsured = item['Policy_Terms']['sum_insured']; gmcMappedFamilyFloaters = item['mapped_family_floaters']; + // allDisclaimer = allDisclaimer.toSet().toList(); + print('GPA Disclaimer $allDisclaimer'); dynamic getTrueObjects = gmcMappedFamilyFloaters .where((element) => element['is_value_exist'] == true) .toList(); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index fc6e2af..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,13 +6,9 @@ #include "generated_plugin_registrant.h" -#include #include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) smart_auth_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "SmartAuthPlugin"); - smart_auth_plugin_register_with_registrar(smart_auth_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 4ebc56f..f16b4c3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - smart_auth url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index a93dc44..a20809d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,8 +12,7 @@ import google_sign_in_ios import local_auth_darwin import path_provider_foundation import shared_preferences_foundation -import smart_auth -import sqflite +import sqflite_darwin import url_launcher_macos import video_player_avfoundation @@ -25,7 +24,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) - SmartAuthPlugin.register(with: registry.registrar(forPlugin: "SmartAuthPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index 547a9f7..dc3ce2c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 animated_bottom_navigation_bar: ^1.3.3 - pinput: ^4.0.0 + pinput: ^5.0.0 http: ^1.2.1 shared_preferences: ^2.2.3 flutter_dotenv: ^5.1.0 @@ -65,7 +65,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 + flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/web/index.html b/web/index.html index 22954af..7026918 100644 --- a/web/index.html +++ b/web/index.html @@ -59,14 +59,13 @@ // Import the functions you need from the SDKs you need import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.4/firebase-app.js"; - // Your web app's Firebase configuration const firebaseConfig = { - apiKey: "AIzaSyDg6lonV9STSIwJ4x261tcTGALEhX98LqY", - authDomain: "nhance-app-4fedb.firebaseapp.com", - projectId: "nhance-app-4fedb", - storageBucket: "nhance-app-4fedb.appspot.com", - messagingSenderId: "508866094093", - appId: "1:508866094093:web:82f8ad47ccb63688366144" + apiKey: "AIzaSyCnxkfRZW6EkON2laovunzYRXgHvHEPo0E", + authDomain: "nhance-ee8d1.firebaseapp.com", + projectId: "nhance-ee8d1", + storageBucket: "nhance-ee8d1.firebasestorage.app", + messagingSenderId: "1084115316849", + appId: "1:1084115316849:web:8fc3b1c886349ae86c6bd0" }; // Initialize Firebase diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 6a819e1..b710715 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -9,7 +9,6 @@ #include #include #include -#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { @@ -19,8 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); LocalAuthPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("LocalAuthPlugin")); - SmartAuthPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SmartAuthPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index f6d7660..ab79ac5 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -6,7 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST firebase_auth firebase_core local_auth_windows - smart_auth url_launcher_windows )