disclaimer change added

This commit is contained in:
venbaittech 2024-12-11 09:55:09 +05:30
parent 218225722a
commit cd0318232a
10 changed files with 787 additions and 598 deletions

View File

@ -15,12 +15,12 @@ if (localPropertiesFile.exists()) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) { if (flutterVersionCode == null) {
flutterVersionCode = '1' flutterVersionCode = '3'
} }
def flutterVersionName = localProperties.getProperty('flutter.versionName') def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) { if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0.2'
} }
def keystoreProperties = new Properties() def keystoreProperties = new Properties()

View File

@ -33,7 +33,12 @@ class Environment {
return dotenv.env['TICKET_API_URL'] ?? 'TICKET_API_URL not found!'; return dotenv.env['TICKET_API_URL'] ?? 'TICKET_API_URL not found!';
} }
//Live
static String get ticketToken { static String get ticketToken {
return 'uncp8FvG310bEyYdV9MmStlo7KDRZ65fLWTeXCI2JzwPrNHjBqQhUiAgxsaO'; return '3YTSia2mRoZ7A4zvBgkqbGPrCd6Ewp8IDOuyjXhVFsl1nxWNcQJ95MeUftKH';
} }
//Dev
// static String get ticketToken {
// return 'uncp8FvG310bEyYdV9MmStlo7KDRZ65fLWTeXCI2JzwPrNHjBqQhUiAgxsaO';
// }
} }

View File

@ -26,6 +26,13 @@ class addOnsDetails extends StatefulWidget {
} }
class _addOnsDetailsState extends State<addOnsDetails> { class _addOnsDetailsState extends State<addOnsDetails> {
List<String> typeOrder = [
'GPA',
'GMC',
'GMC - Parents',
'GMC - Topup',
'GMC - Topup(Parents)'
];
late ApiService apiService; late ApiService apiService;
bool isLoading = true; bool isLoading = true;
bool isChecked = false; bool isChecked = false;
@ -67,6 +74,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
dynamic gmcTypeName; dynamic gmcTypeName;
dynamic clientName; dynamic clientName;
dynamic clientLogo; dynamic clientLogo;
dynamic addon_subheading;
dynamic topUpECardDownload; dynamic topUpECardDownload;
dynamic topUpMappedFamilyFloatersSi; dynamic topUpMappedFamilyFloatersSi;
dynamic topUpMappedFamilyFloatersDependent; dynamic topUpMappedFamilyFloatersDependent;
@ -159,6 +167,14 @@ class _addOnsDetailsState extends State<addOnsDetails> {
super.dispose(); super.dispose();
} }
void _sortDisclaimerByTypeOrder() {
allDisclaimer.sort((a, b) {
int indexA = typeOrder.indexOf(a['type']);
int indexB = typeOrder.indexOf(b['type']);
return indexA.compareTo(indexB);
});
}
String formatDate(String inputDate) { String formatDate(String inputDate) {
// Parse the input date string // Parse the input date string
DateTime dateTime = DateFormat('dd-MM-yyyy').parse(inputDate); DateTime dateTime = DateFormat('dd-MM-yyyy').parse(inputDate);
@ -190,6 +206,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
if (prefs.containsKey('clientLogo') && prefs.containsKey('clientName')) { if (prefs.containsKey('clientLogo') && prefs.containsKey('clientName')) {
clientLogo = prefs.getString('clientLogo'); clientLogo = prefs.getString('clientLogo');
clientName = prefs.getString('clientName'); clientName = prefs.getString('clientName');
addon_subheading = prefs.getString('addon_subheading');
} else { } else {
getClientLogoAndDetails(); getClientLogoAndDetails();
} }
@ -249,8 +266,8 @@ class _addOnsDetailsState extends State<addOnsDetails> {
gpaPolicies = response['data']; gpaPolicies = response['data'];
for (var item in gpaPolicies) { for (var item in gpaPolicies) {
// Extract disclaimer value from each object // Extract disclaimer value from each object
if (item['OpenForEnrollment'] == '1') {
dynamic disclaimer = item['disclaimer']; dynamic disclaimer = item['disclaimer'];
if (disclaimer != null && disclaimer.isNotEmpty) { if (disclaimer != null && disclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
List<Map<String, dynamic>> newEntries = []; List<Map<String, dynamic>> newEntries = [];
@ -261,6 +278,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': disclaimer, 'text': disclaimer,
'checked': false, 'checked': false,
'type': item['type']
}); });
} else if (disclaimer is List) { } else if (disclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -270,6 +288,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': item['type']
}), }),
), ),
); );
@ -285,8 +304,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
} }
}); });
// Update the state // Sort disclaimers after adding
setState(() {}); _sortDisclaimerByTypeOrder();
}
} }
} }
}); });
@ -317,9 +337,8 @@ class _addOnsDetailsState extends State<addOnsDetails> {
// setState(() { // setState(() {
gmcPolicies = response['data']; gmcPolicies = response['data'];
for (var item in gmcPolicies) { for (var item in gmcPolicies) {
// Extract disclaimer value from each object if (item['OpenForEnrollment'] == '1') {
dynamic disclaimer = item['disclaimer']; dynamic disclaimer = item['disclaimer'];
if (disclaimer != null && disclaimer.isNotEmpty) { if (disclaimer != null && disclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
List<Map<String, dynamic>> newEntries = []; List<Map<String, dynamic>> newEntries = [];
@ -330,6 +349,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': disclaimer, 'text': disclaimer,
'checked': false, 'checked': false,
'type': item['type']
}); });
} else if (disclaimer is List) { } else if (disclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -339,6 +359,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': item['type']
}), }),
), ),
); );
@ -348,13 +369,14 @@ class _addOnsDetailsState extends State<addOnsDetails> {
// Add new entries to the main list, ensuring no duplicate texts // Add new entries to the main list, ensuring no duplicate texts
newEntries.forEach((entry) { newEntries.forEach((entry) {
if (!allDisclaimer.any((item) => item['text'] == entry['text'])) { if (!allDisclaimer
.any((item) => item['text'] == entry['text'])) {
allDisclaimer.add(entry); allDisclaimer.add(entry);
} }
}); });
// Sort disclaimers after adding
// Update the state _sortDisclaimerByTypeOrder();
setState(() {}); }
} }
} }
// }); // });
@ -578,26 +600,36 @@ class _addOnsDetailsState extends State<addOnsDetails> {
addOnsDependentMappedFamilyFloatersDependent = addOnsDependentMappedFamilyFloatersDependent =
addOnsDependentPolicies['gmc_dependent_addon'] addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_si_array']; ['family_floaters_of_dependent_and_si_array'];
});
String intOpenForEnrollment = String intOpenForEnrollment =
addOnsDependentPolicies['gmc_dependent_addon'] addOnsDependentPolicies['gmc_dependent_addon']
['OpenForEnrollment']; ['OpenForEnrollment'];
addOnsDependentOpenForEnrollment = int.parse(intOpenForEnrollment); addOnsDependentOpenForEnrollment =
int.parse(intOpenForEnrollment);
addOnsdependentValue = addOnsdependentValue =
await addOnsDependentPolicies['gmc_dependent_addon'] addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_si_value']; ['family_floaters_of_dependent_and_si_value'];
addOnsSelectedDependent = await addOnsdependentValue != 0 final checkValue = addOnsdependentValue +
? addOnsdependentValue.toString() addOnsDependentPolicies['gmc_dependent_addon']
: null; ['family_floaters_of_dependent_and_si_premium_value'];
print('checkValue $checkValue');
if (checkValue == 0) {
addOnsSelectedDependent = null;
_addOnsDependentSwitcher = false;
} else {
addOnsSelectedDependent = addOnsdependentValue.toString();
}
// addOnsSelectedDependent = await addOnsdependentValue != 0
// ? addOnsdependentValue.toString()
// : null;
if (addOnsSelectedDependent != null) { if (addOnsSelectedDependent != null) {
setState(() {
_addOnsDependentSwitcher = true; _addOnsDependentSwitcher = true;
}
addOnDependentPremiumValue = (addOnsDependentPolicies[ addOnDependentPremiumValue = (addOnsDependentPolicies[
'gmc_dependent_addon'][ 'gmc_dependent_addon']
'family_floaters_of_dependent_and_si_premium_value'] ['family_floaters_of_dependent_and_si_premium_value']
as double) as double)
.toInt(); .toInt();
; ;
@ -610,12 +642,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
addOnsDependentTotalAmt = addOnsDependentTotalAmt =
addOnDependentPremiumValue + addOnsDependentPremiumGst; addOnDependentPremiumValue + addOnsDependentPremiumGst;
});
addOnsDependentECardDownload = addOnsDependentECardDownload =
addOnsDependentPolicies['gmc_dependent_addon'] addOnsDependentPolicies['gmc_dependent_addon']
['eCardDownload']; ['eCardDownload'];
} });
} else { } else {
print('No data found in the response'); print('No data found in the response');
} }
@ -1768,7 +1799,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Add Ons', 'Add-On Coverage',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
@ -1781,7 +1812,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
color: Color(0xFF181818)), color: Color(0xFF181818)),
), ),
Text( Text(
'Medical coverage for your parents or in-laws by paying an additional premium', addon_subheading ?? '',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:

View File

@ -25,6 +25,13 @@ class empReviewDetails extends StatefulWidget {
} }
class _empReviewDetailsState extends State<empReviewDetails> { class _empReviewDetailsState extends State<empReviewDetails> {
List<String> typeOrder = [
'GPA',
'GMC',
'GMC - Parents',
'GMC - Topup',
'GMC - Topup(Parents)'
];
late ApiService apiService; late ApiService apiService;
bool isLoading = true; bool isLoading = true;
bool isChecked = false; // Declare the _isSwitched variable here bool isChecked = false; // Declare the _isSwitched variable here
@ -201,6 +208,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
getGpaEmpPolicyDetails(empPrimaryId); getGpaEmpPolicyDetails(empPrimaryId);
getGmcEmpPolicyDetails(empPrimaryId); getGmcEmpPolicyDetails(empPrimaryId);
primarySummary(); primarySummary();
_sortDisclaimerByTypeOrder();
} else { } else {
// Token is empty or null, handle accordingly (e.g., navigate to login screen) // Token is empty or null, handle accordingly (e.g., navigate to login screen)
ToastHelper.showErrorToast(context, 'Session Out'); ToastHelper.showErrorToast(context, 'Session Out');
@ -284,6 +292,14 @@ class _empReviewDetailsState extends State<empReviewDetails> {
print('Sum of Total Amounts: $totalPayableAmt'); print('Sum of Total Amounts: $totalPayableAmt');
} }
void _sortDisclaimerByTypeOrder() {
allDisclaimer.sort((a, b) {
int indexA = typeOrder.indexOf(a['type']);
int indexB = typeOrder.indexOf(b['type']);
return indexA.compareTo(indexB);
});
}
Future<void> getClientLogoAndDetails() async { Future<void> getClientLogoAndDetails() async {
try { try {
if (client_id == null || if (client_id == null ||
@ -331,8 +347,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
print('gpaPolicies'); print('gpaPolicies');
for (var item in gpaPolicies) { for (var item in gpaPolicies) {
// Extract disclaimer value from each object // Extract disclaimer value from each object
if (item['OpenForEnrollment'] == '1') {
dynamic disclaimer = item['disclaimer']; dynamic disclaimer = item['disclaimer'];
if (disclaimer != null && disclaimer.isNotEmpty) { if (disclaimer != null && disclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
List<Map<String, dynamic>> newEntries = []; List<Map<String, dynamic>> newEntries = [];
@ -343,6 +359,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': disclaimer, 'text': disclaimer,
'checked': false, 'checked': false,
'type': item['type']
}); });
} else if (disclaimer is List) { } else if (disclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -352,6 +369,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': item['type']
}), }),
), ),
); );
@ -367,8 +385,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
} }
}); });
// Update the state // Sort disclaimers after adding
setState(() {}); _sortDisclaimerByTypeOrder();
}
} }
} }
}); });
@ -400,9 +419,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
gmcPolicies = response['data']; gmcPolicies = response['data'];
print('gmcPolicies'); print('gmcPolicies');
for (var item in gmcPolicies) { for (var item in gmcPolicies) {
// Extract disclaimer value from each object if (item['OpenForEnrollment'] == '1') {
dynamic disclaimer = item['disclaimer']; dynamic disclaimer = item['disclaimer'];
if (disclaimer != null && disclaimer.isNotEmpty) { if (disclaimer != null && disclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
List<Map<String, dynamic>> newEntries = []; List<Map<String, dynamic>> newEntries = [];
@ -413,6 +431,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': disclaimer, 'text': disclaimer,
'checked': false, 'checked': false,
'type': item['type']
}); });
} else if (disclaimer is List) { } else if (disclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -422,6 +441,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': item['type']
}), }),
), ),
); );
@ -436,9 +456,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
allDisclaimer.add(entry); allDisclaimer.add(entry);
} }
}); });
// Sort disclaimers after adding
// Update the state _sortDisclaimerByTypeOrder();
setState(() {}); }
} }
} }
}); });
@ -509,6 +529,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
topUpDisclaimer = topUpDisclaimer =
await topUpSiPolicies['gmc_si_topup']['disclaimer']; await topUpSiPolicies['gmc_si_topup']['disclaimer'];
if (topUpOpenForEnrollment == '1' && activeSiData == 1) {
if (topUpDisclaimer != null && topUpDisclaimer.isNotEmpty) { if (topUpDisclaimer != null && topUpDisclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
List<Map<String, dynamic>> newEntries = []; List<Map<String, dynamic>> newEntries = [];
@ -519,6 +540,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': topUpDisclaimer, 'text': topUpDisclaimer,
'checked': false, 'checked': false,
'type': topUpTypeName
}); });
} else if (topUpDisclaimer is List) { } else if (topUpDisclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -528,6 +550,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': topUpTypeName
}), }),
), ),
); );
@ -543,9 +566,11 @@ class _empReviewDetailsState extends State<empReviewDetails> {
} }
}); });
// Update the state // Sort disclaimers after adding
setState(() {}); _sortDisclaimerByTypeOrder();
} }
}
// allDisclaimer = allDisclaimer.toSet().toList(); // allDisclaimer = allDisclaimer.toSet().toList();
// }); // });
} else { } else {
@ -645,6 +670,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
await topUpSiParentPolicies['gmc_si_parent_topup'] await topUpSiParentPolicies['gmc_si_parent_topup']
['disclaimer']; ['disclaimer'];
if (topUpParentOpenForEnrollment == '1' &&
activeSiParentData == 1) {
if (topUpParentDisclaimer != null && if (topUpParentDisclaimer != null &&
topUpParentDisclaimer.isNotEmpty) { topUpParentDisclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
@ -656,6 +683,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': topUpParentDisclaimer, 'text': topUpParentDisclaimer,
'checked': false, 'checked': false,
'type': topUpParentTypeName
}); });
} else if (topUpParentDisclaimer is List) { } else if (topUpParentDisclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -665,6 +693,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': topUpParentTypeName
}), }),
), ),
); );
@ -680,8 +709,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
} }
}); });
// Update the state // Sort disclaimers after adding
setState(() {}); _sortDisclaimerByTypeOrder();
}
} }
} else { } else {
print('No data found in the response'); print('No data found in the response');
@ -725,12 +755,22 @@ class _empReviewDetailsState extends State<empReviewDetails> {
['family_floaters_of_dependent_and_si_value']; ['family_floaters_of_dependent_and_si_value'];
print(addOnsDependentSumInsured); print(addOnsDependentSumInsured);
if (addOnsDependentSumInsured == 0) { final checkValue = addOnsDependentSumInsured +
addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_si_premium_value'];
print('checkValue $checkValue');
if (checkValue == 0) {
showHideAddOnsCard = 0; showHideAddOnsCard = 0;
} else { } else {
showHideAddOnsCard = 1; showHideAddOnsCard = 1;
} }
// if (addOnsDependentSumInsured == 0) {
// showHideAddOnsCard = 0;
// } else {
// showHideAddOnsCard = 1;
// }
addOnsDependentPolicyName = addOnsDependentPolicyName =
addOnsDependentPolicies['gmc_dependent_addon']['policy_name']; addOnsDependentPolicies['gmc_dependent_addon']['policy_name'];
print(addOnsDependentPolicyName); print(addOnsDependentPolicyName);
@ -756,6 +796,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
await addOnsDependentPolicies['gmc_dependent_addon'] await addOnsDependentPolicies['gmc_dependent_addon']
['disclaimer']; ['disclaimer'];
addOnsDependentOpenForEnrollment =
await addOnsDependentPolicies['gmc_dependent_addon']
['OpenForEnrollment'];
if (addOnsDependentOpenForEnrollment == '1' &&
activeDependentData == 1) {
if (addOnsDependentDisclaimer != null && if (addOnsDependentDisclaimer != null &&
addOnsDependentDisclaimer.isNotEmpty) { addOnsDependentDisclaimer.isNotEmpty) {
// Temporary list to hold new entries // Temporary list to hold new entries
@ -767,6 +813,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + 1, // Unique ID based on length 'id': allDisclaimer.length + 1, // Unique ID based on length
'text': addOnsDependentDisclaimer, 'text': addOnsDependentDisclaimer,
'checked': false, 'checked': false,
'type': addOnsDependentPolicyType
}); });
} else if (addOnsDependentDisclaimer is List) { } else if (addOnsDependentDisclaimer is List) {
// Convert each string in the list to a map with id and checked // Convert each string in the list to a map with id and checked
@ -776,6 +823,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'id': allDisclaimer.length + newEntries.length + 1, 'id': allDisclaimer.length + newEntries.length + 1,
'text': text, 'text': text,
'checked': false, 'checked': false,
'type': addOnsDependentPolicyType
}), }),
), ),
); );
@ -791,13 +839,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
} }
}); });
// Update the state // Sort disclaimers after adding
setState(() {}); _sortDisclaimerByTypeOrder();
}
} }
addOnsDependentOpenForEnrollment =
await addOnsDependentPolicies['gmc_dependent_addon']
['OpenForEnrollment'];
} else { } else {
print('No data found in the response'); print('No data found in the response');
} }
@ -1263,6 +1308,223 @@ class _empReviewDetailsState extends State<empReviewDetails> {
], ],
), ),
SizedBox(height: 16), 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<Widget>((item) {
Map<String, dynamic> 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) if (showHideTopUpCard == 1)
Card( Card(
elevation: 0, elevation: 0,
@ -1707,224 +1969,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
], ],
), ),
)), )),
SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), SizedBox(height: showHideTopUpParentCard == 1 ? 16 : 0),
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<Widget>((item) {
Map<String, dynamic> 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),
Card( Card(
elevation: 0, elevation: 0,
color: Colors.white, color: Colors.white,

View File

@ -3,7 +3,7 @@ import 'package:dash_chat_2/dash_chat_2.dart';
// String profileImage = // String profileImage =
// 'https://e7.pngegg.com/pngimages/811/700/png-clipart-chatbot-internet-bot-business-natural-language-processing-facebook-messenger-business-people-logo-thumbnail.png'; // 'https://e7.pngegg.com/pngimages/811/700/png-clipart-chatbot-internet-bot-business-natural-language-processing-facebook-messenger-business-people-logo-thumbnail.png';
String profileImage = String profileImage =
'https://dev.venbait.in/nhance/dev/public/assets/images/chatbot.png'; 'https://app.nhanceindia.in/zenith/public/assets/images/chatbot.png';
// We have all the possibilities for users // We have all the possibilities for users
ChatUser user = ChatUser(id: '0'); ChatUser user = ChatUser(id: '0');

View File

@ -137,8 +137,12 @@ class _helpState extends State<help> {
print('check 1'); print('check 1');
final response = final response =
await apiService.getTrackClaimsList(empMobileNo!, empCodeString!); await apiService.getTrackClaimsList(empMobileNo!, empCodeString!);
print('check 1'); print('check 2');
if (response['success'] == true) { setState(() {
isLoading = false;
});
if (response['success'] == true && response['data'] is List) {
setState(() { setState(() {
trackClaimsList = response['data'] trackClaimsList = response['data']
.where((item) => item['status_value'] != 'Closed') .where((item) => item['status_value'] != 'Closed')
@ -152,10 +156,15 @@ class _helpState extends State<help> {
reversedClaimsClosedList = reversedClaimsClosedList =
List<Map<String, dynamic>>.from(trackClaimsClosedList); List<Map<String, dynamic>>.from(trackClaimsClosedList);
trackClaimsClosedList = reversedClaimsClosedList.reversed.toList(); trackClaimsClosedList = reversedClaimsClosedList.reversed.toList();
isLoading = false;
}); });
print(trackClaimsList); } else if (response['success'] == true &&
response['data'] == "User Not Found") {
setState(() {
trackClaimsList = [];
trackClaimsClosedList = [];
});
} else { } else {
ToastHelper.showErrorToast(context, 'Something went wrong');
print('API request failed with status: ${response['status']}'); print('API request failed with status: ${response['status']}');
} }
} }
@ -418,94 +427,6 @@ class _helpState extends State<help> {
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
if (trackClaimsList == null)
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
),
),
],
))
],
),
),
],
),
),
])),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -669,6 +590,96 @@ class _helpState extends State<help> {
], ],
), ),
), ),
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('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 (trackClaimsList != null) if (trackClaimsList != null)
if (allClaimsActive == 0) if (allClaimsActive == 0)
SingleChildScrollView( SingleChildScrollView(
@ -679,6 +690,97 @@ class _helpState extends State<help> {
), ),
), ),
SizedBox(height: 15), 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 (trackClaimsClosedList != null)
if (closedTrackActive == 0) if (closedTrackActive == 0)
SingleChildScrollView( SingleChildScrollView(

View File

@ -114,6 +114,7 @@ class _HomeState extends State<Home> {
} else { } else {
setState(() { setState(() {
policyDataIsEmpty = 0; policyDataIsEmpty = 0;
isLoadingGif = false;
}); });
print('API request failed with status: ${response['status']}'); print('API request failed with status: ${response['status']}');
} }

View File

@ -100,20 +100,21 @@ class _planclaimsformState extends State<planclaimsform> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
print('didChangeDependencies');
super.didChangeDependencies(); super.didChangeDependencies();
dynamic arguments = ModalRoute.of(context)!.settings.arguments; dynamic arguments = ModalRoute.of(context)!.settings.arguments;
if (arguments != null && arguments is Map<String, dynamic>) { if (arguments != null && arguments is Map<String, dynamic>) {
argumentsData = arguments; argumentsData = arguments;
claimsDetails = argumentsData['claimsDetails']; claimsDetails = argumentsData['claimsDetails'];
print(claimsDetails); print('claimsDetails $claimsDetails');
if (argumentsData.containsKey('fromClaimPage')) { if (argumentsData.containsKey('fromClaimPage')) {
fromClaimsPage = argumentsData['fromClaimPage']; fromClaimsPage = argumentsData['fromClaimPage'];
print(fromClaimsPage); print('fromClaimsPage $fromClaimsPage');
} }
if (fromClaimsPage == 0) { if (fromClaimsPage == 0) {
claimsDepartmentId = claimsDetails['department_id']; claimsDepartmentId = claimsDetails['department_id'];
print(claimsDepartmentId); print('claimsDepartmentId $claimsDepartmentId');
// employeePolicyList = claimsDetails['EmployeePolicy']; // employeePolicyList = claimsDetails['EmployeePolicy'];
// print('employeePolicyList : $employeePolicyList'); // print('employeePolicyList : $employeePolicyList');
@ -381,9 +382,11 @@ class _planclaimsformState extends State<planclaimsform> {
setState(() { setState(() {
isLoading = true; isLoading = true;
}); });
print(employeePolicyList[0]['name']); // print('Check One');
print('Help $filteredPoliciesList'); // print(employeePolicyList[0]['name']);
// print('Help $filteredPoliciesList');
try { try {
print('Check One');
Map<String, dynamic> formData = { Map<String, dynamic> formData = {
'opener': 'user', 'opener': 'user',
'department_id': serviceId, 'department_id': serviceId,

View File

@ -306,6 +306,8 @@ class _MyVerifyState extends State<MyVerify> {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('clientLogo', clientDetails['client']['client_logo']); prefs.setString('clientLogo', clientDetails['client']['client_logo']);
prefs.setString('clientName', clientDetails['client']['client_name']); prefs.setString('clientName', clientDetails['client']['client_name']);
prefs.setString(
'addon_subheading', clientDetails['client']['addon_subheading']);
setState(() { setState(() {
// dynamic clientDetails = data['data']; // dynamic clientDetails = data['data'];
// print(clientDetails); // print(clientDetails);

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1 version: 1.0.0+3
environment: environment:
sdk: '>=3.3.3 <4.0.0' sdk: '>=3.3.3 <4.0.0'