FIX_ERROR_MSG

This commit is contained in:
venbaittech 2025-07-10 09:40:57 +05:30
parent 4817d1ab7a
commit 53ec431f45
6 changed files with 159 additions and 107 deletions

BIN
assets/claimsData.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

View File

@ -34,6 +34,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
List<String> stepKeys = []; List<String> stepKeys = [];
late Map<String, dynamic> stepMap; late Map<String, dynamic> stepMap;
int _index = 4; int _index = 4;
bool isLoading = false;
@override @override
void initState() { void initState() {
@ -56,7 +57,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
Future<void> getClaimsHistoryDetails() async { Future<void> getClaimsHistoryDetails() async {
setState(() { setState(() {
// isLoading = true; isLoading = true;
}); });
try { try {
print('10'); print('10');
@ -68,7 +69,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
widget.ticket_id, widget.postToken); widget.ticket_id, widget.postToken);
if (response['status'] == 'success') { if (response['status'] == 'success') {
setState(() { setState(() {
// isLoading = false; isLoading = false;
}); });
setState(() { setState(() {
getClaimsHistoryList = [ getClaimsHistoryList = [
@ -84,7 +85,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
}); });
} else { } else {
setState(() { setState(() {
// isLoading = false; isLoading = false;
}); });
// ToastHelper.showWarningToast( // ToastHelper.showWarningToast(
@ -93,12 +94,12 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
} }
} catch (e) { } catch (e) {
setState(() { setState(() {
// isLoading = false; isLoading = false;
}); });
print('Exception occurred: $e'); print('Exception occurred: $e');
} finally { } finally {
setState(() { setState(() {
// _isLoading = false; isLoading = false;
}); });
} }
} }
@ -290,25 +291,63 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
// ); // );
// }), // }),
// ) // )
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(stepKeys.length, (index) {
String stepTitleKey = stepKeys[index];
Map<String, dynamic> stepData = stepMap[stepTitleKey];
print('stepTitleKey'); isLoading
print(stepTitleKey); ? Container(
print('stepData'); // color: Color(0x98FFFCE5), // Semi-transparent background
print(stepData); child: Center(
child: // Your GIF loader widget
Image.asset(
height: 60,
width: 60,
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
),
)
: Container(
child: getClaimsHistoryList.isNotEmpty
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(stepKeys.length, (index) {
String stepTitleKey = stepKeys[index];
Map<String, dynamic> stepData =
stepMap[stepTitleKey];
return _buildStep( print('stepTitleKey');
stepNumber: index + 1, print(stepTitleKey);
title: _getStepTitleFromApi(stepTitleKey, stepData), print('stepData');
content: _getStepContentFromApi(stepData), print(stepData);
isLast: index == stepKeys.length - 1,
); return _buildStep(
}), stepNumber: index + 1,
) title: _getStepTitleFromApi(
stepTitleKey, stepData),
content: _getStepContentFromApi(stepData),
isLast: index == stepKeys.length - 1,
);
}),
)
: Container(
height: MediaQuery.of(context).size.height * 0.4,
// color: Colors.red,
child: Center(
child: Column(
children: [
Image.asset(
'assets/claimsData.png', // Replace 'default_image.png' with your default image asset path
width: 200,
height: 200,
fit: BoxFit.cover,
),
Text(
'No Available Claims',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 15),
),
],
)),
),
)
], ],
), ),
), ),
@ -354,9 +393,9 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
// Dotted line below circle (except for last step) // Dotted line below circle (except for last step)
if (!isLast) if (!isLast)
Container( Container(
height: 120, // increase to extend line height: 70, // increase to extend line
width: 2, width: 2,
// margin: EdgeInsets.only(top: 4, bottom: 4), margin: EdgeInsets.only(top: 4, bottom: 4),
child: CustomPaint( child: CustomPaint(
painter: DottedLinePainter(), painter: DottedLinePainter(),
), ),

View File

@ -610,9 +610,23 @@ class _hrDashboardState extends State<hrDashboard>
], ],
), ),
) )
: const Center( : Container(
child: Text("No Data Available"), height: MediaQuery.of(context).size.height * 0.6,
// color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/claimsData.png', // Replace 'default_image.png' with your default image asset path
width: 300,
height: 300,
fit: BoxFit.cover,
),
const Text("No Data Available"),
],
),
), ),
SizedBox(height: 16), SizedBox(height: 16),
// Expanded TabBarView // Expanded TabBarView
Expanded( Expanded(

View File

@ -397,63 +397,65 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
ElevatedButton( if (widget.TokenType != "post")
onPressed: () { ElevatedButton(
Navigator.push( onPressed: () {
context, Navigator.push(
MaterialPageRoute( context,
builder: (context) => excelVerify( MaterialPageRoute(
ClientId: builder: (context) => excelVerify(
widget.ClientId, // <-- from map ClientId:
ClientPoliyId: widget.ClientPoliyId, widget.ClientId, // <-- from map
clientBranchId: widget.clientBranchId, ClientPoliyId: widget.ClientPoliyId,
Token: widget.Token, clientBranchId:
TokenType: widget.TokenType, widget.clientBranchId,
cardType: widget.cardType, Token: widget.Token,
cardPolicyNo: widget.cardPolicyNo, TokenType: widget.TokenType,
cardInsurer_name: cardType: widget.cardType,
widget.cardInsurer_name, cardPolicyNo: widget.cardPolicyNo,
cardPolicy_name: cardInsurer_name:
widget.cardPolicy_name, widget.cardInsurer_name,
cardPolicy_ExpDate: cardPolicy_name:
widget.cardPolicy_ExpDate, widget.cardPolicy_name,
cardPolicy_ExpDate:
widget.cardPolicy_ExpDate,
// Token: widget.Token, // Token: widget.Token,
// ClientId: widget.ClientId, // ClientId: widget.ClientId,
// ClientPolicyId : widget.ClientPoliyId, // ClientPolicyId : widget.ClientPoliyId,
// PolicyName: widget.cardPolicy_name, // PolicyName: widget.cardPolicy_name,
// PolicyNo: widget.cardPolicyNo, // PolicyNo: widget.cardPolicyNo,
// ClientBranchId: widget.HrId, // ClientBranchId: widget.HrId,
// PolicyType: widget.cardType, // PolicyType: widget.cardType,
),
),
);
// exportToCsv(filteredData);
},
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
padding: EdgeInsets.all(
10), // Internal padding
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10), // Border radius
side: BorderSide(
color: Colors
.transparent, // Optional border color
width: 1, // Border width
), ),
), ),
); elevation: 0,
// exportToCsv(filteredData); ),
}, child: Text(
style: ElevatedButton.styleFrom( 'Import',
backgroundColor: Color(0xFFE26728), style: GoogleFonts.poppins(
padding: fontSize: 12,
EdgeInsets.all(10), // Internal padding color: Color(0xFFFFFFFF),
shape: RoundedRectangleBorder( fontWeight: FontWeight.w500,
borderRadius: BorderRadius.circular( letterSpacing: 1),
10), // Border radius
side: BorderSide(
color: Colors
.transparent, // Optional border color
width: 1, // Border width
),
), ),
elevation: 0,
), ),
child: Text(
'Import',
style: GoogleFonts.poppins(
fontSize: 12,
color: Color(0xFFFFFFFF),
fontWeight: FontWeight.w500,
letterSpacing: 1),
),
),
SizedBox( SizedBox(
width: 10, width: 10,
), ),

View File

@ -349,14 +349,18 @@ class _ActivePolicieState extends State<ActivePolicies> {
fontSize: 12, fontSize: 12,
), ),
), ),
Text( policy['insurer_name'] != ''
"${policy['insurer_short_name']} - ${policy['policy_name']} " ?? ? Text(
'', // "${policy['insurer_short_name']} - ${policy['policy_name']} " ??
style: const TextStyle( // '',
fontSize: 11,
color: Colors.grey, policy['insurer_name'] ?? "",
), style: const TextStyle(
), fontSize: 11,
color: Colors.grey,
),
)
: SizedBox.shrink(),
], ],
), ),
], ],

View File

@ -92,10 +92,10 @@ class _PreEnrollmentState extends State<PreEnrollment> {
print("hr_id -$hr_id"); print("hr_id -$hr_id");
print("token -$token"); print("token -$token");
isLoading = true; // isLoading = true;
// setState(() { setState(() {
// _isLoading = true; isLoading = true;
// }); });
try { try {
if (clintBranchId == null || clintID == null) { if (clintBranchId == null || clintID == null) {
return; return;
@ -159,7 +159,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
), ),
// //
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
isLoading isLoading
? Container( ? Container(
@ -203,12 +203,12 @@ class _PreEnrollmentState extends State<PreEnrollment> {
: GridView.builder( : GridView.builder(
itemCount: getCardArrays.length, itemCount: getCardArrays.length,
gridDelegate: gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount( const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 4,
crossAxisSpacing: 20, crossAxisSpacing: 20,
mainAxisSpacing: 20, mainAxisSpacing: 20,
// childAspectRatio: 2, childAspectRatio: 2.6,
childAspectRatio: aspectRatio, // childAspectRatio: aspectRatio,
// childAspectRatio: 2.1, // childAspectRatio: 2.1,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -225,7 +225,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final devicePixelRatio = mediaQuery.devicePixelRatio; final devicePixelRatio = mediaQuery.devicePixelRatio;
final logicalWidth = 230 / devicePixelRatio; final logicalWidth = 230 / devicePixelRatio;
final logicalHeight = 115 / devicePixelRatio; final logicalHeight = 189 / devicePixelRatio;
print("logicalWidth - $logicalWidth"); print("logicalWidth - $logicalWidth");
print("logicalHeight - $logicalHeight"); print("logicalHeight - $logicalHeight");
@ -280,10 +280,10 @@ class _PreEnrollmentState extends State<PreEnrollment> {
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * 0.07, height: MediaQuery.of(context).size.height * 0.03,
// color: Colors.green.shade100, // color: Colors.green.shade100,
child: Row( child: Row(
children: [ children: [
@ -298,22 +298,15 @@ class _PreEnrollmentState extends State<PreEnrollment> {
fontSize: 12, fontSize: 12,
), ),
), ),
Text(
// "${policy['insurer_short_name']} - ${policy['policy_name']} " ??
// '',
policy['insurer_name'] ?? "",
style: const TextStyle(
fontSize: 11,
color: Colors.grey,
),
),
], ],
), ),
], ],
), ),
), ),
// Spacer(), // Spacer(),
SizedBox(
height: 5,
),
Container( Container(
// color: Colors.pink.shade50, // color: Colors.pink.shade50,
height: MediaQuery.of(context).size.height * 0.09, height: MediaQuery.of(context).size.height * 0.09,