CHANGE_ : Sum Insured Issue fix

This commit is contained in:
venbaittech 2024-10-08 16:32:00 +05:30
parent 82b039deab
commit 8b55122eed
19 changed files with 507 additions and 144 deletions

8
.env
View File

@ -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
API_URL=https://app.nhanceindia.in/zenith/employeeRest/
TICKET_API_URL=https://app.nhanceindia.in/helpdesk/api
BASE_HREF=/employee/
ENV=production

View File

@ -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

View File

@ -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/
API_URL=https://app.nhanceindia.in/zenith/employeeRest/
TICKET_API_URL=https://app.nhanceindia.in/helpdesk/api
BASE_HREF=/employee/
ENV=production

View File

@ -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

View File

@ -28,10 +28,6 @@
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

BIN
assets/wellness.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 KiB

View File

@ -58,6 +58,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
dynamic gmcSelfRelationship;
dynamic gmcSelfDetails;
dynamic gmcPolicyName;
dynamic gmcPolicyType;
dynamic gmcNotes;
dynamic gmcSumInsured;
dynamic gmcFloaterTextDescription;
@ -72,6 +73,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
dynamic topUpSlabRates;
dynamic topUpFamilyFloater;
dynamic topUpPolicyName;
dynamic topUpPolicyType;
dynamic topUpSiPremiumValue;
dynamic topUpSiValue;
dynamic topUpSiSelectedSI;
@ -82,6 +84,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
dynamic topUpParentClientPolicyId;
dynamic topUpParentSlabRates;
dynamic topUpParentPolicyName;
dynamic topUpParentPolicyType;
dynamic topUpParentFamilyFloater;
dynamic topUpParentMappedFamilyFloatersSi;
dynamic topUpParentECardDownload;
@ -99,6 +102,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
dynamic addOnsSelectedDependent;
dynamic addOnsdependentValue;
dynamic addOnsDependentPolicyName;
dynamic addOnsDependentPolicyType;
dynamic addOnsDependentECardDownload;
int addOnsDependentOpenForEnrollment = 0;
dynamic siValue;
@ -316,6 +320,8 @@ class _addOnsDetailsState extends State<addOnsDetails> {
topUpPolicyName =
await topUpSiPolicies['gmc_si_topup']['policy_name'];
topUpPolicyType = await topUpSiPolicies['gmc_si_topup']['type'];
topUpFamilyFloater = await topUpSiPolicies['gmc_si_topup']
['policy_terms']['family_floater'];
print('topUpFamilyFloater');
@ -352,7 +358,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
topUpSiPremiumGst = topUpSiPolicies['gmc_si_topup']
['family_floaters_of_only_si_gst_value'];
topUpSiTotalAmt = topUpSiPremiumValue + topUpSiPremiumGst;
double topUpSum = topUpSiPremiumValue + topUpSiPremiumGst;
topUpSiTotalAmt = double.parse(topUpSum.toStringAsFixed(2));
});
}
// });
@ -404,6 +412,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
await topUpSiParentPolicies['gmc_si_parent_topup']
['policy_name'];
topUpParentPolicyType =
await topUpSiParentPolicies['gmc_si_parent_topup']['type'];
topUpParentFamilyFloater =
await topUpSiParentPolicies['gmc_si_parent_topup']
['policy_terms']['family_floater'];
@ -447,8 +458,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
topUpSiParentPolicies['gmc_si_parent_topup']
['family_floaters_of_only_si_gst_value'];
topUpParentSiTotalAmt =
double topUpParentsSum =
topUpParentSiPremiumValue + topUpParentSiPremiumGst;
topUpParentSiTotalAmt =
double.parse(topUpParentsSum.toStringAsFixed(2));
});
}
// });
@ -500,6 +514,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
await addOnsDependentPolicies['gmc_dependent_addon']
['policy_name'];
addOnsDependentPolicyType =
await addOnsDependentPolicies['gmc_dependent_addon']['type'];
addOnsDependentFamilyFloater =
await addOnsDependentPolicies['gmc_dependent_addon']
['policy_terms']['family_floater'];
@ -514,6 +531,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
print(addOnsDependentMappedFamilyFloatersDependent);
});
String intOpenForEnrollment =
addOnsDependentPolicies['gmc_dependent_addon']
['OpenForEnrollment'];
addOnsDependentOpenForEnrollment = int.parse(intOpenForEnrollment);
addOnsdependentValue =
await addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_si_value'];
@ -532,8 +554,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_gst_value'];
addOnsDependentTotalAmt =
double addOnsSum =
addOnDependentPremiumValue + addOnsDependentPremiumGst;
addOnsDependentTotalAmt =
double.parse(addOnsSum.toStringAsFixed(2));
});
addOnsDependentECardDownload =
@ -541,12 +566,6 @@ class _addOnsDetailsState extends State<addOnsDetails> {
['eCardDownload'];
print('addOnsDependentECardDownload');
print(addOnsDependentECardDownload);
String intOpenForEnrollment =
addOnsDependentPolicies['gmc_dependent_addon']
['OpenForEnrollment'];
addOnsDependentOpenForEnrollment =
int.parse(intOpenForEnrollment);
}
} else {
print('No data found in the response');
@ -756,6 +775,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'employee_id': employee_id,
'client_id': client_id,
'emp_code': empCodeString,
'client_branch_id': empClientBranchId,
};
// Add the map to the list
@ -1396,7 +1416,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 18 : 16,
Responsive.isDesktop(context) ? 18 : 14,
),
),
],
@ -1767,7 +1787,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
.start,
children: [
Text(
topUpPolicyName ?? '',
Responsive.isDesktop(
context)
? topUpPolicyName
: topUpPolicyType,
textAlign:
TextAlign.left,
style:
@ -2029,7 +2052,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
.isDesktop(
context)
? 18
: 16,
: 14,
color: Color(
0xFF232526),
),
@ -2402,8 +2425,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
.start,
children: [
Text(
topUpParentPolicyName ??
'',
Responsive.isDesktop(
context)
? topUpParentPolicyName
: topUpParentPolicyType,
textAlign:
TextAlign.left,
style:
@ -2664,7 +2689,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
.isDesktop(
context)
? 18
: 16,
: 14,
color: Color(
0xFF232526),
),
@ -3037,8 +3062,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
.start,
children: [
Text(
addOnsDependentPolicyName ??
'',
Responsive.isDesktop(
context)
? addOnsDependentPolicyName
: addOnsDependentPolicyType,
textAlign:
TextAlign.left,
style: GoogleFonts
@ -4232,6 +4259,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
for (var item in data) {
setState(() {
gmcPolicyName = item['Policy_Name'];
gmcPolicyType = item['type'];
gmcFloaterTextHeading = item['floter_text_heading'];
gmcFloaterTextDescription = item['floter_text_description'];
gmcNotes = item['notes'];
@ -4286,7 +4314,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -4307,7 +4335,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
Row(
children: [
Text(
gmcPolicyName ?? '',
Responsive.isDesktop(context)
? gmcPolicyName
: gmcPolicyType,
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
@ -4338,7 +4368,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
],
))),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -4399,7 +4429,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
'${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 18 : 16,
Responsive.isDesktop(context) ? 18 : 14,
color: Color(0xFF232526),
),
),
@ -4428,6 +4458,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
print(item);
String? gpaPolicyName = item['Policy_Name'];
String? gpaPolicyType = item['type'];
String? gpaECardDownload = item['eCardDownload'];
String? gpaSumInsured;
List<dynamic> gpaMappedFamilyFloaters = [];
@ -4481,7 +4512,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
child: Text(
gpaSelfDetails ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) ? 18 : 16,
fontSize: Responsive.isDesktop(context) ? 18 : 14,
color: Color(0xFF232526),
),
),
@ -4515,7 +4546,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -4533,7 +4564,9 @@ class _addOnsDetailsState extends State<addOnsDetails> {
Row(
children: [
Text(
gpaPolicyName ?? 'NA',
Responsive.isDesktop(context)
? '$gpaPolicyName'
: '$gpaPolicyType',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
@ -4562,7 +4595,7 @@ class _addOnsDetailsState extends State<addOnsDetails> {
),
),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(

View File

@ -56,6 +56,7 @@ class _empDetailsState extends State<empDetails> {
dynamic gmcSelfRelationship;
dynamic gmcSelfDetails;
dynamic gmcPolicyName;
dynamic gmcPolicyType;
dynamic gmcNotes;
dynamic gmcGridMaster;
dynamic gmcSumInsured;
@ -1545,6 +1546,7 @@ class _empDetailsState extends State<empDetails> {
print(item);
String? gpaPolicyName = item['Policy_Name'];
String? gpaPolicyType = item['type'];
String? gpaECardDownload = item['eCardDownload'];
String? gpaSumInsured;
List<dynamic> gpaMappedFamilyFloaters = [];
@ -1694,7 +1696,7 @@ class _empDetailsState extends State<empDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -1711,16 +1713,33 @@ class _empDetailsState extends State<empDetails> {
),
Row(
children: [
Text(
gpaPolicyName ?? 'NA',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 20 : 14,
fontWeight: FontWeight.w600,
),
),
if (gpaECardDownload != null)
!Responsive.isDesktop(context)
? Tooltip(
message: gpaPolicyType ?? 'NA',
child: Text(
gpaPolicyType ?? 'NA',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context)
? 20
: 14,
fontWeight: FontWeight.w600,
),
),
)
: Text(
gpaPolicyName ?? 'NA',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context)
? 20
: 14,
fontWeight: FontWeight.w600,
),
),
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
_launchURL(item['eCardDownload']);
@ -1741,7 +1760,7 @@ class _empDetailsState extends State<empDetails> {
),
),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -1795,6 +1814,7 @@ class _empDetailsState extends State<empDetails> {
print(item);
setState(() {
gmcPolicyName = item['Policy_Name'];
gmcPolicyType = item['type'];
gmcFloaterTextHeading = item['floter_text_heading'];
gmcFloaterTextDescription = item['floter_text_description'];
gmcNotes = item['notes'];
@ -2083,7 +2103,7 @@ class _empDetailsState extends State<empDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -2102,7 +2122,9 @@ class _empDetailsState extends State<empDetails> {
Row(
children: [
Text(
gmcPolicyName ?? '',
Responsive.isDesktop(context)
? gmcPolicyName
: gmcPolicyType,
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
@ -2131,7 +2153,7 @@ class _empDetailsState extends State<empDetails> {
],
))),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(

View File

@ -53,6 +53,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
dynamic gmcSelfRelationship;
dynamic gmcSelfDetails;
dynamic gmcPolicyName;
dynamic gmcPolicyType;
dynamic gmcNotes;
dynamic gmcSumInsured;
dynamic gmcTypeName;
@ -68,11 +69,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
dynamic siValue;
dynamic addOnsDependentSumInsured;
dynamic addOnsDependentPolicyName;
dynamic addOnsDependentPolicyType;
dynamic addOnsFloaterTextHeading;
dynamic addOnsDependentECardDownload;
dynamic addOnsFamilyFloater;
late DateTime? selectedDate;
int totalPayableAmt = 0;
double totalPayableAmt = 0.0;
List<Map<String, String>> relationshipOptions = [];
List<Map<String, String>> selectedRelationships = [];
List<Map<String, dynamic>> formDataList = [];
@ -82,16 +84,18 @@ class _empReviewDetailsState extends State<empReviewDetails> {
dynamic topUpSlabRates;
dynamic topUpFamilyFloater;
dynamic topUpPolicyName;
dynamic topUpPolicyType;
dynamic topUpTypeName;
int topUpSiPremiumValue = 0;
int topUpSiPremiumGst = 0;
int topUpSiTotalAmt = 0;
int topUpParentSiPremiumValue = 0;
int topUpParentSiPremiumGst = 0;
int topUpParentSiTotalAmt = 0;
int addOnDependentPremiumValue = 0;
int addOnsDependentPremiumGst = 0;
int addOnsDependentTotalAmt = 0;
double topUpSiPremiumValue = 0.0;
double topUpSiPremiumGst = 0.0;
double topUpSiTotalAmt = 0.0;
double topUpParentSiPremiumValue = 0.0;
double topUpParentSiPremiumGst = 0.0;
double topUpParentSiTotalAmt = 0.0;
// int addOnDependentPremiumValue = 0;
double addOnDependentPremiumValue = 0.0;
double addOnsDependentPremiumGst = 0.0;
double addOnsDependentTotalAmt = 0.0;
dynamic topUpSiValue;
dynamic topUpSiSelectedSI;
dynamic topUpSumInsured;
@ -105,6 +109,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
dynamic topUpParentClientPolicyId;
dynamic topUpParentSlabRates;
dynamic topUpParentPolicyName;
dynamic topUpParentPolicyType;
dynamic topUpParentFamilyFloater;
dynamic topUpParentMappedFamilyFloatersSi;
dynamic topUpParentECardDownload;
@ -231,12 +236,16 @@ class _empReviewDetailsState extends State<empReviewDetails> {
// Access the first map in the list
Map<String, dynamic> firstDependentListData = dependentDataList.first;
// Get the value of topUpSiPremiumValue
print('150000000000');
addOnDependentPremiumValue =
firstDependentListData['addOnDependentPremiumValue'];
print(addOnDependentPremiumValue);
addOnsDependentPremiumGst =
firstDependentListData['addOnsDependentPremiumGst'];
print(addOnsDependentPremiumGst);
addOnsDependentTotalAmt =
firstDependentListData['addOnsDependentTotalAmt'];
print(addOnsDependentTotalAmt);
}
}
if (prefs.containsKey('siData') &&
@ -377,6 +386,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
topUpPolicyName =
await topUpSiPolicies['gmc_si_topup']['policy_name'];
topUpPolicyType = await topUpSiPolicies['gmc_si_topup']['type'];
topUpMappedFamilyFloatersSiArray = topUpSiPolicies['gmc_si_topup']
['family_floaters_of_only_si_array'];
print('topUpMappedFamilyFloatersSiArray');
@ -437,6 +448,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
await topUpSiParentPolicies['gmc_si_parent_topup']
['policy_name'];
topUpParentPolicyType =
await topUpSiParentPolicies['gmc_si_parent_topup']['type'];
topUpParentFamilyFloater =
await topUpSiParentPolicies['gmc_si_parent_topup']
['policy_terms']['family_floater'];
@ -527,6 +541,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
addOnsDependentPolicies['gmc_dependent_addon']['policy_name'];
print(addOnsDependentPolicyName);
addOnsDependentPolicyType =
addOnsDependentPolicies['gmc_dependent_addon']['type'];
print(addOnsDependentPolicyType);
addOnsDependentMappedFamilyFloatersArray =
await addOnsDependentPolicies['gmc_dependent_addon']
['family_floaters_of_dependent_and_si_array'];
@ -1024,7 +1042,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context)
? 9
: 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -1047,7 +1067,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Row(
children: [
Text(
topUpPolicyName ?? '',
Responsive.isDesktop(
context)
? topUpPolicyName
: topUpPolicyType,
textAlign: TextAlign.left,
style:
GoogleFonts.poppins(
@ -1084,7 +1107,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
],
))),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context)
? 3
: 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -1155,7 +1180,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontSize:
Responsive.isDesktop(context)
? 18
: 16,
: 14,
color: Color(0xFF232526),
),
),
@ -1234,7 +1259,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context)
? 9
: 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -1260,8 +1287,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
children: [
Flexible(
child: Text(
topUpParentPolicyName ??
'',
Responsive.isDesktop(
context)
? topUpParentPolicyName
: topUpParentPolicyType,
textAlign:
TextAlign.left,
style: GoogleFonts
@ -1305,7 +1334,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
],
))),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context)
? 3
: 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -1377,7 +1408,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontSize:
Responsive.isDesktop(context)
? 18
: 16,
: 14,
color: Color(0xFF232526),
),
),
@ -1458,7 +1489,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Expanded(
flex: Responsive.isDesktop(context)
? 9
: 8,
: 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -1481,8 +1512,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Row(
children: [
Text(
addOnsDependentPolicyName ??
'',
Responsive.isDesktop(
context)
? addOnsDependentPolicyName
: addOnsDependentPolicyType,
textAlign: TextAlign.left,
style:
GoogleFonts.poppins(
@ -1521,7 +1554,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Expanded(
flex: Responsive.isDesktop(context)
? 3
: 4,
: 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -1592,7 +1625,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontSize:
Responsive.isDesktop(context)
? 18
: 16,
: 14,
color: Color(0xFF232526),
),
),
@ -2286,6 +2319,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
print(item);
String? gpaPolicyName = item['Policy_Name'];
String? gpaPolicyType = item['type'];
String? gpaECardDownload = item['eCardDownload'];
String? gpaSumInsured;
List<dynamic> gpaMappedFamilyFloaters = [];
@ -2339,7 +2373,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
child: Text(
gpaSelfDetails ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) ? 18 : 16,
fontSize: Responsive.isDesktop(context) ? 18 : 14,
color: Color(0xFF232526),
),
),
@ -2373,7 +2407,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -2390,7 +2424,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Row(
children: [
Text(
gpaPolicyName ?? 'NA',
Responsive.isDesktop(context)
? '$gpaPolicyName'
: '$gpaPolicyType',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
@ -2419,7 +2455,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
),
),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -2471,6 +2507,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
for (var item in data) {
setState(() {
gmcPolicyName = item['Policy_Name'];
gmcPolicyType = item['type'];
gmcFloaterTextHeading = item['floter_text_heading'];
gmcFloaterTextDescription = item['floter_text_description'];
gmcNotes = item['notes'];
@ -2525,7 +2562,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 9,
flex: Responsive.isDesktop(context) ? 9 : 7,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
@ -2546,7 +2583,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Row(
children: [
Text(
gmcPolicyName ?? '',
Responsive.isDesktop(context)
? gmcPolicyName
: gmcPolicyType,
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
@ -2577,7 +2616,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
],
))),
Expanded(
flex: 3,
flex: Responsive.isDesktop(context) ? 3 : 5,
child: Container(
alignment: Alignment.centerRight,
child: Column(
@ -2638,7 +2677,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
'${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 18 : 16,
Responsive.isDesktop(context) ? 18 : 14,
color: Color(0xFF232526),
),
),

View File

@ -304,7 +304,7 @@ class _loginState extends State<login> {
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
height: 100,
)),
),
if (!Responsive.isMobile(context) &&

View File

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:dash_chat_2/dash_chat_2.dart';
import 'package:flutter/material.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart';
@ -5,6 +7,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../customAppBar/customAppBar.dart';
import '../../customAppBar/customAppBarChatbot.dart';
import '../../customAppBar/responsive.dart';
import 'data.dart';
class chatbot extends StatefulWidget {
@ -31,14 +34,101 @@ class _chatbotState extends State<chatbot> {
void initState() {
super.initState();
apiService = ApiService(context); // Initialize ApiService here
quickReplyOptions();
checkMessageBackup();
}
@override
void dispose() {
// saveChatMessages();
clearChatMessages(); // Save chat messages when closing
super.dispose();
}
Future<void> checkMessageBackup() async {
print('checkMessageBackup');
final SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.containsKey('chat_messages') &&
prefs.containsKey('chat_messages') != []) {
print('loadChatMessages');
loadChatMessages(); // Load stored messages
} else {
print('quickReplyOptions');
quickReplyOptions();
}
}
// Save chat messages to SharedPreferences
Future<void> saveChatMessages() async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
List<String> chatMessages =
messages.map((message) => jsonEncode(message.toJson())).toList();
await prefs.setStringList('chat_messages', chatMessages);
}
// Load chat messages from SharedPreferences
Future<void> loadChatMessages() async {
print('quickReplyOptions Function');
final SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.containsKey('chat_messages')) {
List<String>? chatMessages = prefs.getStringList('chat_messages');
print('chatMessages $chatMessages');
if (chatMessages != null) {
print('chatMessages');
setState(() {
messages = chatMessages
.map((message) => ChatMessage.fromJson(jsonDecode(message)))
.toList();
isOptionStatus = 1;
requestStatus = 'Start';
// final storedDataString = prefs.getString('messageBackDetails');
// print('Stored Data String: $storedDataString'); // Debugging step
// if (storedDataString != null) {
// try {
// // dynamic chatApiData = response['data'];
// dynamic chatApiData =
// jsonDecode(storedDataString); // Decode the JSON string
// print('Decoded Data: $chatApiData'); // Debugging step
// isOptionStatus = 1;
// requestStatus = 'Start';
// // Proceed with your logic if the string is valid JSON
// returnMessage = chatApiData['text'];
// isOptionStatus = chatApiData['is_option'];
// requestStatus = chatApiData['request_for'];
// navigation = chatApiData['navigation'];
// navigation_type = chatApiData['navigation_type'];
// empCode = prefs.getString('empCode');
// empClientBranchId = prefs.getString('empClientBranchId');
// client_id = prefs.getString('client_id');
//
// if (chatApiData.containsKey('mobile_no')) {
// mobileNo = chatApiData['mobile_no'];
// }
// if (chatApiData.containsKey('policy_id')) {
// policyID = chatApiData['policy_id'];
// }
// print(
// '$returnMessage,$isOptionStatus,$requestStatus,$navigation,$navigation_type,$empCode,$empClientBranchId,$client_id,$mobileNo,$policyID');
// } catch (e) {
// print('Error decoding JSON: $e'); // Handle JSON parsing errors
// }
// } else {
// print('No data found in SharedPreferences');
// }
});
}
}
}
// Clear chat messages
Future<void> clearChatMessages() async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove('chat_messages');
setState(() {
messages.clear();
});
}
void quickReplyOptions() async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
empCode = prefs.getString('empCode');
@ -125,6 +215,8 @@ class _chatbotState extends State<chatbot> {
}
Future<void> processMessage(String messageText) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove('messageBackDetails');
print('Processing message: $messageText');
// Add a placeholder loading message with an animated loader
@ -170,6 +262,8 @@ class _chatbotState extends State<chatbot> {
chatBotDataApi =
chatBotDataApi.map((key, value) => MapEntry(key, value.toString()));
print('chatBotDataApi $chatBotDataApi');
// Simulate API call with a delay of 2 seconds
await Future.delayed(Duration(seconds: 2));
// final response = await apiService.getBotDetails(requestStatus,
@ -190,6 +284,9 @@ class _chatbotState extends State<chatbot> {
if (response['status'] == 'success') {
dynamic chatApiData = response['data'];
print('chatApiData : $chatApiData');
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('messageBackDetails', jsonEncode(chatApiData));
dynamic optionsData = chatApiData['options'];
returnMessage = chatApiData['text'];
isOptionStatus = chatApiData['is_option'];
@ -215,15 +312,22 @@ class _chatbotState extends State<chatbot> {
returnMessage == 'open_sales_form' ||
returnMessage == 'open_gmc_form' ||
returnMessage == 'open_gpa_form') {
saveChatMessages();
var details = {'claimsDetails': '', 'fromClaimPage': 1};
Navigator.pushNamed(context, 'planclaimsform',
arguments: details);
}
} else if (navigation_type == 'view') {
print(returnMessage);
saveChatMessages();
Navigator.pushNamed(context, 'help');
} else if (navigation_type == 'dialpad') {
print(returnMessage);
saveChatMessages();
_openDialPad(returnMessage);
} else if (navigation_type == 'mail') {
print(returnMessage);
saveChatMessages();
_openEmail(returnMessage);
}
} else {
@ -319,7 +423,73 @@ class _chatbotState extends State<chatbot> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBarChatbot(),
appBar: PreferredSize(
preferredSize: const Size.fromHeight(kToolbarHeight),
child: ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(32.0),
bottomRight: Radius.circular(32.0),
),
child: AppBar(
backgroundColor: const Color(0xFFFFFBDE),
elevation: 0, // Set background color for AppBar
toolbarHeight: kToolbarHeight,
titleSpacing: 0.0,
automaticallyImplyLeading: false,
title: Padding(
padding: Responsive.isDesktop(context)
? EdgeInsets.symmetric(horizontal: 16.0)
: EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
// Logo Column
Expanded(
flex: Responsive.isDesktop(context) ? 3 : 9,
child: Row(
mainAxisAlignment: Responsive.isDesktop(context)
? MainAxisAlignment.spaceEvenly
: MainAxisAlignment
.start, // Adjust the alignment as needed
children: [
Container(
margin: EdgeInsets.only(
top: 10, bottom: 10, left: 10, right: 10),
width: Responsive.isDesktop(context) ? 230 : 170,
height: Responsive.isDesktop(context) ? 230 : 170,
child: Image.asset(
'assets/nhance_client_logo.png',
fit: BoxFit.contain, // Adjust the fit as needed
),
),
],
),
),
// AdaptiveNavBar Column
Expanded(
flex: Responsive.isDesktop(context) ? 11 : 1,
child: GestureDetector(
onTap: () async {
final SharedPreferences prefs =
await SharedPreferences.getInstance();
await prefs.remove('messageBackDetails');
clearChatMessages();
Navigator.pop(context);
},
child: Icon(
Icons
.close_outlined, // Replace with your desired icon
size: 24.0, // Adjust the icon size
color: Colors.black, // Adjust the icon color
),
),
),
],
),
),
),
) // CustomAppBar implementation here
),
body: DashChat(
currentUser: user,
onSend: (ChatMessage m) {

View File

@ -22,6 +22,7 @@ class claims extends StatefulWidget {
}
class _claimsState extends State<claims> {
bool isLoading = false;
late ApiService apiService;
int _currentIndex = 0;
bool isActive = true;
@ -106,12 +107,16 @@ class _claimsState extends State<claims> {
if (client_id == null || empCodeString == null) {
return;
}
setState(() {
isLoading = true;
});
print('check 1');
final response = await apiService.getActiveAndInactivePolicyDetails(
client_id!, empCodeString!, status, client_branch_id);
print('check 1');
if (response['status'] == 'success') {
setState(() {
isLoading = false;
policyList = response['data'];
});
print(policyList);
@ -492,7 +497,7 @@ class _claimsState extends State<claims> {
.isDesktop(
context)
? 15
: 7),
: 5),
// primary: Color(0xFF000000),
),
child: Text(
@ -502,7 +507,7 @@ class _claimsState extends State<claims> {
.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight:
FontWeight.w500,
color: Color(
@ -517,7 +522,7 @@ class _claimsState extends State<claims> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -557,7 +562,7 @@ class _claimsState extends State<claims> {
.isDesktop(
context)
? 15
: 7),
: 5),
// primary: Color(0xFF000000),
),
child: Text(
@ -568,7 +573,7 @@ class _claimsState extends State<claims> {
.isDesktop(
context)
? 18
: 14,
: 13,
color:
Color(0xFF000000),
fontWeight:
@ -584,7 +589,7 @@ class _claimsState extends State<claims> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -616,9 +621,20 @@ class _claimsState extends State<claims> {
trackClaimsList), // Replace 'yourDataList' with your actual data list
),
),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
]),
)),
if (isLoading)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,

View File

@ -23,6 +23,7 @@ class claimtracklist extends StatefulWidget {
class _claimtracklistformState extends State<claimtracklist> {
late ApiService apiService;
dynamic _token;
bool isLoading = false;
dynamic empCodeString;
dynamic empPrimaryId;
dynamic client_id;
@ -129,6 +130,9 @@ class _claimtracklistformState extends State<claimtracklist> {
}
void sendClaimsMessage(Map<String, dynamic> formData) async {
setState(() {
isLoading = true;
});
try {
formData = formData.map((key, value) => MapEntry(key, value.toString()));
@ -138,6 +142,9 @@ class _claimtracklistformState extends State<claimtracklist> {
messageController.clear();
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
messageController.clear();
setState(() {
isLoading = false;
});
Navigator.pushNamed(context, 'claims', arguments: 0);
print('Form data sent successfully.');
} else {
@ -496,6 +503,17 @@ class _claimtracklistformState extends State<claimtracklist> {
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
]),
)),
if (isLoading)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,

View File

@ -23,6 +23,7 @@ class help extends StatefulWidget {
}
class _helpState extends State<help> {
bool isLoading = false;
late ApiService apiService;
int _currentIndex = 0;
bool isActive = true;
@ -130,6 +131,9 @@ class _helpState extends State<help> {
if (client_id == null || empCodeString == null) {
return;
}
setState(() {
isLoading = true;
});
print('check 1');
final response =
await apiService.getTrackClaimsList(empMobileNo!, empCodeString!);
@ -148,6 +152,7 @@ class _helpState extends State<help> {
reversedClaimsClosedList =
List<Map<String, dynamic>>.from(trackClaimsClosedList);
trackClaimsClosedList = reversedClaimsClosedList.reversed.toList();
isLoading = false;
});
print(trackClaimsList);
} else {
@ -558,7 +563,7 @@ class _helpState extends State<help> {
.isDesktop(
context)
? 15
: 7),
: 5),
// primary: Color(0xFF000000),
),
child: Text(
@ -568,7 +573,7 @@ class _helpState extends State<help> {
.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight:
FontWeight.w500,
color: Color(
@ -583,7 +588,7 @@ class _helpState extends State<help> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -623,7 +628,7 @@ class _helpState extends State<help> {
.isDesktop(
context)
? 15
: 7),
: 5),
// primary: Color(0xFF000000),
),
child: Text(
@ -634,7 +639,7 @@ class _helpState extends State<help> {
.isDesktop(
context)
? 18
: 14,
: 13,
color:
Color(0xFF000000),
fontWeight:
@ -650,7 +655,7 @@ class _helpState extends State<help> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -683,9 +688,20 @@ class _helpState extends State<help> {
trackClaimsClosedList), // Replace 'yourDataList' with your actual data list
),
),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
]),
)),
if (isLoading)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,

View File

@ -22,6 +22,7 @@ class MyApp extends StatefulWidget {
}
class _MyAppState extends State<MyApp> {
bool isLoadingGif = false;
late ApiService apiService;
int _currentIndex = 0;
bool isActive = true;
@ -91,12 +92,16 @@ class _MyAppState extends State<MyApp> {
if (client_id == null || empCodeString == null) {
return;
}
setState(() {
isLoadingGif = true;
});
print('check 1');
final response = await apiService.getActiveAndInactivePolicyDetails(
client_id!, empCodeString!, status, client_branch_id);
print('check 1');
if (response['status'] == 'success') {
setState(() {
isLoadingGif = false;
policyList = response['data'];
print('policyList $policyList');
emp_name = response['emp_name'];
@ -200,16 +205,16 @@ class _MyAppState extends State<MyApp> {
),
],
),
Text(
'Lorem ipsum dolor sit amet',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 12 : 14,
fontWeight: FontWeight.w400,
color: Color(0xFF7A7A7A),
),
),
// Text(
// 'Lorem ipsum dolor sit amet',
// textAlign: TextAlign.left,
// style: GoogleFonts.poppins(
// fontSize:
// Responsive.isDesktop(context) ? 12 : 14,
// fontWeight: FontWeight.w400,
// color: Color(0xFF7A7A7A),
// ),
// ),
],
))),
],
@ -253,7 +258,7 @@ class _MyAppState extends State<MyApp> {
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 18 : 14,
Responsive.isDesktop(context) ? 18 : 12,
fontWeight: FontWeight.w500,
color: Color(0xFF404040),
),
@ -408,16 +413,16 @@ class _MyAppState extends State<MyApp> {
),
],
),
Text(
'Lorem ipsum dolor sit amet',
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 12 : 14,
fontWeight: FontWeight.w400,
color: Color(0xFF7A7A7A),
),
),
// Text(
// 'Lorem ipsum dolor sit amet',
// textAlign: TextAlign.left,
// style: GoogleFonts.poppins(
// fontSize:
// Responsive.isDesktop(context) ? 12 : 14,
// fontWeight: FontWeight.w400,
// color: Color(0xFF7A7A7A),
// ),
// ),
],
))),
],
@ -482,7 +487,7 @@ class _MyAppState extends State<MyApp> {
.isDesktop(
context)
? 12
: 7,
: 5,
),
),
child: Text(
@ -493,7 +498,7 @@ class _MyAppState extends State<MyApp> {
.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight:
FontWeight.w500,
color:
@ -510,7 +515,7 @@ class _MyAppState extends State<MyApp> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -551,7 +556,7 @@ class _MyAppState extends State<MyApp> {
.isDesktop(
context)
? 12
: 7,
: 5,
),
),
child: Text(
@ -562,7 +567,7 @@ class _MyAppState extends State<MyApp> {
.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight:
FontWeight.w500,
color:
@ -579,7 +584,7 @@ class _MyAppState extends State<MyApp> {
Responsive.isDesktop(
context)
? 18
: 14,
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
),
@ -601,9 +606,20 @@ class _MyAppState extends State<MyApp> {
...generateCards(policyList),
],
),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
]),
)),
if (isLoadingGif)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,
@ -671,11 +687,10 @@ class _MyAppState extends State<MyApp> {
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: Responsive.isDesktop(context) ? 2 : 1,
crossAxisSpacing: 20.0,
mainAxisSpacing: 20.0,
childAspectRatio: Responsive.isDesktop(context) ? 3.2 : 3.5,
),
crossAxisCount: Responsive.isDesktop(context) ? 2 : 1,
crossAxisSpacing: 20.0,
mainAxisSpacing: 20.0,
childAspectRatio: Responsive.isDesktop(context) ? 3.2 : 2.8),
itemCount: data.length,
itemBuilder: (BuildContext context, int index) {
var item = data[index];
@ -729,7 +744,7 @@ class _MyAppState extends State<MyApp> {
Row(
children: [
Expanded(
flex: 8,
flex: 7,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
@ -751,7 +766,7 @@ class _MyAppState extends State<MyApp> {
),
),
Expanded(
flex: 4,
flex: 5,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.end,
@ -778,7 +793,7 @@ class _MyAppState extends State<MyApp> {
Row(
children: [
Expanded(
flex: 8,
flex: 6,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
@ -800,7 +815,7 @@ class _MyAppState extends State<MyApp> {
),
),
Expanded(
flex: 3,
flex: 5,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.end,

View File

@ -20,6 +20,7 @@ class planclaimsform extends StatefulWidget {
class _planclaimsformState extends State<planclaimsform> {
late ApiService apiService;
bool isLoading = false;
dynamic _token;
dynamic empCodeString;
dynamic empPrimaryId;
@ -227,6 +228,9 @@ class _planclaimsformState extends State<planclaimsform> {
}
Future<void> fetchDepartmentList() async {
setState(() {
isLoading = true;
});
try {
final response = await apiService.fetchDepartmentList();
if (response['departments'] != null) {
@ -239,6 +243,7 @@ class _planclaimsformState extends State<planclaimsform> {
'private': department['private'],
};
}).toList();
isLoading = false;
});
if (fromClaimsPage == 0) {
setInitialServiceId(departmentList);
@ -373,6 +378,9 @@ class _planclaimsformState extends State<planclaimsform> {
}
Future<void> sendFormDataToApi() async {
setState(() {
isLoading = true;
});
print(employeePolicyList[0]['name']);
print('Help $filteredPoliciesList');
try {
@ -444,6 +452,9 @@ class _planclaimsformState extends State<planclaimsform> {
ToastHelper.showSuccessToast(context, response['message']);
serviceId = null;
departmentList.clear();
setState(() {
isLoading = false;
});
Navigator.pushNamed(context, 'claims');
print('Form data submitted successfully');
} else {
@ -875,6 +886,17 @@ class _planclaimsformState extends State<planclaimsform> {
SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
]),
)),
if (isLoading)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,

View File

@ -934,7 +934,7 @@ class _policiesState extends State<policies> {
),
),
])),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
],
),
),

View File

@ -24,6 +24,7 @@ class profile extends StatefulWidget {
}
class _profileState extends State<profile> {
bool isLoading = false;
late ApiService apiService;
final AuthService _authService = AuthService();
int _currentIndex = 0;
@ -108,6 +109,9 @@ class _profileState extends State<profile> {
if (client_id == null || empCodeString == null) {
return;
}
setState(() {
isLoading = true;
});
print('check 1');
final response = await apiService.getSelfEmployeeProfileDetails(
client_id!, empCodeString!, client_branch_id!);
@ -130,6 +134,7 @@ class _profileState extends State<profile> {
selfFamilyFloaterKey = selfDetails['family_floater_key'];
// print(clientDetails);
selfEmpStatus = selfDetails['emp_status'];
isLoading = false;
});
final SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('selfEmpStatus', selfEmpStatus);
@ -642,6 +647,17 @@ class _profileState extends State<profile> {
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
]),
)),
if (isLoading)
Container(
color: Color(0x98FFFCE5), // Semi-transparent background
child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
),
if (Responsive.isDesktop(context))
Align(
alignment: Alignment.bottomCenter,

View File

@ -93,10 +93,10 @@ class _wellnessState extends State<wellness> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.string(
SvgService.getSvg('help'),
width: 200,
height: 200,
Image.asset(
'assets/wellness.png', // Path to your image in assets folder
width: 250,
height: 250,
),
],
))),