merge
This commit is contained in:
commit
b7b17c928d
@ -58,10 +58,10 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
print('10');
|
print('10');
|
||||||
final ticketID = widget.ticket_id;
|
final ticketID = widget.ticket_id;
|
||||||
if(ticketID != '' || ticketID != null){
|
if (ticketID != '' || ticketID != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final response = await apiService.getClaimsHistoryToApi(
|
final response = await apiService.getClaimsHistoryToApi(
|
||||||
widget.ticket_id, widget.postToken);
|
widget.ticket_id, widget.postToken);
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
@ -69,7 +69,8 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
|
|||||||
// isLoading = false;
|
// isLoading = false;
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
getClaimsHistoryList = List<Map<String, dynamic>>.from(response['data']);
|
getClaimsHistoryList =
|
||||||
|
List<Map<String, dynamic>>.from(response['data']);
|
||||||
// originalData = getCDPolicies;
|
// originalData = getCDPolicies;
|
||||||
// filteredData = List.from(originalData);
|
// filteredData = List.from(originalData);
|
||||||
// print('filteredData');
|
// print('filteredData');
|
||||||
@ -367,7 +368,6 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String _getStepTitle(int index) {
|
String _getStepTitle(int index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -416,9 +416,9 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget _buildKeyValue(String title, String value) {
|
Widget _buildKeyValue(String title, String value) {
|
||||||
final displayValue = (value == null || value.trim().isEmpty) ? 'N/A' : value;
|
final displayValue =
|
||||||
|
(value == null || value.trim().isEmpty) ? 'N/A' : value;
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -466,4 +466,3 @@ class DottedLinePainter extends CustomPainter {
|
|||||||
@override
|
@override
|
||||||
bool shouldRepaint(CustomPainter oldDelegate) => false;
|
bool shouldRepaint(CustomPainter oldDelegate) => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,19 @@ class excelVerify extends StatefulWidget {
|
|||||||
final String cardInsurer_name;
|
final String cardInsurer_name;
|
||||||
final String cardPolicy_name;
|
final String cardPolicy_name;
|
||||||
final String cardPolicy_ExpDate;
|
final String cardPolicy_ExpDate;
|
||||||
const excelVerify({Key? key, required this.ClientId, required this.ClientPoliyId, required this.clientBranchId, required this.Token, required this.TokenType, required this.cardType, required this.cardPolicyNo, required this.cardInsurer_name, required this.cardPolicy_name, required this.cardPolicy_ExpDate}) : super(key: key);
|
const excelVerify(
|
||||||
|
{Key? key,
|
||||||
|
required this.ClientId,
|
||||||
|
required this.ClientPoliyId,
|
||||||
|
required this.clientBranchId,
|
||||||
|
required this.Token,
|
||||||
|
required this.TokenType,
|
||||||
|
required this.cardType,
|
||||||
|
required this.cardPolicyNo,
|
||||||
|
required this.cardInsurer_name,
|
||||||
|
required this.cardPolicy_name,
|
||||||
|
required this.cardPolicy_ExpDate})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<excelVerify> createState() => _excelVerifyState();
|
State<excelVerify> createState() => _excelVerifyState();
|
||||||
@ -608,9 +620,11 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
// invalidRelationships = 0;
|
// invalidRelationships = 0;
|
||||||
// dobAgeCheckCount = 0;
|
// dobAgeCheckCount = 0;
|
||||||
// nonExcelFilteredData = [];
|
// nonExcelFilteredData = [];
|
||||||
Navigator.pushNamed(
|
// Navigator.pushNamed(
|
||||||
context, 'hrPolicyDetails',
|
// context, 'hrPolicyDetails',
|
||||||
arguments: argumentsData);
|
// arguments: argumentsData);
|
||||||
|
|
||||||
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Close',
|
'Close',
|
||||||
|
|||||||
@ -310,7 +310,7 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
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;
|
||||||
// });
|
// });
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'customAppBar/customFooter.dart';
|
import 'customAppBar/customFooter.dart';
|
||||||
|
|
||||||
class hrPolicyDetails extends StatefulWidget {
|
class hrPolicyDetails extends StatefulWidget {
|
||||||
@ -106,14 +107,14 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
print('10');
|
print('10');
|
||||||
|
|
||||||
final response = widget.TokenType == "post"
|
final response = widget.TokenType == "post"
|
||||||
? await apiService.getEmployeeAndDependenceToApi(
|
? await apiService.getEmployeeAndDependenceToApi(widget.ClientId,
|
||||||
widget.ClientId, widget.ClientPoliyId, widget.clientBranchId, widget.Token)
|
widget.ClientPoliyId, widget.clientBranchId, widget.Token)
|
||||||
: await apiService.getEmployeeAndDependenceToApiPre(
|
: await apiService.getEmployeeAndDependenceToApiPre(widget.ClientId,
|
||||||
widget.ClientId, widget.ClientPoliyId, widget.clientBranchId, widget.Token);
|
widget.ClientPoliyId, widget.clientBranchId, widget.Token);
|
||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
getCDPolicies = List<Map<String, dynamic>>.from(response['data']);
|
getCDPolicies = List<Map<String, dynamic>>.from(response['data']);
|
||||||
@ -124,7 +125,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// ToastHelper.showWarningToast(
|
// ToastHelper.showWarningToast(
|
||||||
@ -133,7 +134,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
print('Exception occurred: $e');
|
print('Exception occurred: $e');
|
||||||
} finally {
|
} finally {
|
||||||
@ -143,6 +144,18 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _launchURL(String url) async {
|
||||||
|
final Uri uri = Uri.parse(url); // Parse the URL properly
|
||||||
|
print('_launchURL $uri');
|
||||||
|
if (uri != null) {
|
||||||
|
print('If $uri');
|
||||||
|
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||||
|
} else {
|
||||||
|
print('else $uri');
|
||||||
|
throw 'Could not launch $url';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void search(String query) {
|
void search(String query) {
|
||||||
print(query);
|
print(query);
|
||||||
// Check if the query is empty
|
// Check if the query is empty
|
||||||
@ -257,229 +270,263 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
// TODO: implement build
|
// TODO: implement build
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(),
|
appBar: CustomAppBar(),
|
||||||
body: Container(
|
backgroundColor: Color(0xFFEFF3F6),
|
||||||
color: Color(0xFFEFF3F6),
|
body: Stack(children: [
|
||||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
|
// color: Color(0xFFEFF3F6),
|
||||||
child: Column(
|
|
||||||
children: [
|
// padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
|
||||||
Container(
|
SingleChildScrollView(
|
||||||
child: Row(
|
scrollDirection: Axis.vertical,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
child: Container(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.only(top: 30, bottom: 200, left: 50, right: 50),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
// color: Colors.greenAccent.shade100,
|
child: Row(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Container(
|
||||||
IconButton(
|
// color: Colors.greenAccent.shade100,
|
||||||
padding: EdgeInsets.zero, // Removes default padding
|
child: Column(
|
||||||
constraints: BoxConstraints(),
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
onPressed: () {
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Navigator.pop(context);
|
children: [
|
||||||
},
|
IconButton(
|
||||||
icon: Icon(
|
padding:
|
||||||
Icons.arrow_back_ios,
|
EdgeInsets.zero, // Removes default padding
|
||||||
color: Colors.grey,
|
constraints: BoxConstraints(),
|
||||||
size: 17,
|
onPressed: () {
|
||||||
)),
|
Navigator.pop(context);
|
||||||
// IconButton(
|
},
|
||||||
// padding: EdgeInsets.zero, // Removes default padding
|
icon: Icon(
|
||||||
// constraints: BoxConstraints(),
|
Icons.arrow_back_ios,
|
||||||
// onPressed: () {},
|
color: Colors.grey,
|
||||||
// icon: Icon(
|
size: 17,
|
||||||
// Icons.arrow_back_ios,
|
)),
|
||||||
// color: Colors.grey,
|
// IconButton(
|
||||||
// // size: 12,
|
// padding: EdgeInsets.zero, // Removes default padding
|
||||||
// )),
|
// constraints: BoxConstraints(),
|
||||||
],
|
// onPressed: () {},
|
||||||
),
|
// icon: Icon(
|
||||||
),
|
// Icons.arrow_back_ios,
|
||||||
Container(
|
// color: Colors.grey,
|
||||||
// color: Colors.redAccent.shade100,
|
// // size: 12,
|
||||||
child: Column(
|
// )),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"${widget.cardType} - ${widget.cardPolicyNo} " ?? '',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
"${widget.cardInsurer_name} - ${widget.cardPolicy_name} (${widget.cardPolicy_ExpDate}) " ??
|
Container(
|
||||||
'',
|
// color: Colors.redAccent.shade100,
|
||||||
style: GoogleFonts.poppins(
|
child: Column(
|
||||||
color: Colors.grey,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
fontSize: 12,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
fontWeight: FontWeight.w400,
|
children: [
|
||||||
),
|
Text(
|
||||||
),
|
"${widget.cardType} - ${widget.cardPolicyNo} " ??
|
||||||
],
|
'',
|
||||||
),
|
style: GoogleFonts.poppins(
|
||||||
),
|
color: Colors.black,
|
||||||
],
|
fontSize: 14,
|
||||||
)),
|
fontWeight: FontWeight.w500,
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(10), // 👈 set your desired radius
|
|
||||||
),
|
|
||||||
// height: 400,
|
|
||||||
// margin: const EdgeInsets.only(left: 40.0, right: 40.0),
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 4,
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Container(
|
|
||||||
width: 400,
|
|
||||||
height: 37,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Color(0xFFF0F0F0),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: 'Search',
|
|
||||||
prefixIcon: Icon(Icons.search, size: 18),
|
|
||||||
contentPadding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 12, vertical: 8),
|
|
||||||
border: InputBorder
|
|
||||||
.none, // No border since Container handles it
|
|
||||||
),
|
|
||||||
controller: searchController,
|
|
||||||
onChanged: search,
|
|
||||||
style: TextStyle(fontSize: 14),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Text(
|
||||||
|
"${widget.cardInsurer_name} - ${widget.cardPolicy_name} (${widget.cardPolicy_ExpDate}) " ??
|
||||||
|
'',
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(width: 12),
|
),
|
||||||
Expanded(
|
],
|
||||||
flex: 2,
|
)),
|
||||||
child: Row(
|
SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
height: 20,
|
||||||
children: [
|
),
|
||||||
ElevatedButton(
|
Container(
|
||||||
onPressed: () {
|
decoration: BoxDecoration(
|
||||||
Navigator.push(
|
color: Colors.white,
|
||||||
context,
|
borderRadius:
|
||||||
MaterialPageRoute(
|
BorderRadius.circular(10), // 👈 set your desired radius
|
||||||
builder: (context) =>
|
),
|
||||||
excelVerify(
|
// height: 400,
|
||||||
ClientId: widget.ClientId, // <-- from map
|
// margin: const EdgeInsets.only(left: 40.0, right: 40.0),
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Container(
|
||||||
|
width: 400,
|
||||||
|
height: 37,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF0F0F0),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'Search',
|
||||||
|
prefixIcon: Icon(Icons.search, size: 18),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 12, vertical: 8),
|
||||||
|
border: InputBorder
|
||||||
|
.none, // No border since Container handles it
|
||||||
|
),
|
||||||
|
controller: searchController,
|
||||||
|
onChanged: search,
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => excelVerify(
|
||||||
|
ClientId:
|
||||||
|
widget.ClientId, // <-- from map
|
||||||
ClientPoliyId: widget.ClientPoliyId,
|
ClientPoliyId: widget.ClientPoliyId,
|
||||||
clientBranchId: widget.clientBranchId,
|
clientBranchId: widget.clientBranchId,
|
||||||
Token: widget.Token,
|
Token: widget.Token,
|
||||||
TokenType: widget.TokenType,
|
TokenType: widget.TokenType,
|
||||||
cardType: widget.cardType,
|
cardType: widget.cardType,
|
||||||
cardPolicyNo: widget.cardPolicyNo,
|
cardPolicyNo: widget.cardPolicyNo,
|
||||||
cardInsurer_name: widget.cardInsurer_name,
|
cardInsurer_name:
|
||||||
cardPolicy_name: widget.cardPolicy_name,
|
widget.cardInsurer_name,
|
||||||
cardPolicy_ExpDate: widget.cardPolicy_ExpDate,
|
cardPolicy_name:
|
||||||
|
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,
|
||||||
),
|
),
|
||||||
);
|
child: Text(
|
||||||
// exportToCsv(filteredData);
|
'Import',
|
||||||
},
|
style: GoogleFonts.poppins(
|
||||||
style: ElevatedButton.styleFrom(
|
fontSize: 12,
|
||||||
backgroundColor: Color(0xFFE26728),
|
color: Color(0xFFFFFFFF),
|
||||||
padding: EdgeInsets.all(10), // Internal padding
|
fontWeight: FontWeight.w500,
|
||||||
shape: RoundedRectangleBorder(
|
letterSpacing: 1),
|
||||||
borderRadius: BorderRadius.circular(
|
|
||||||
10), // Border radius
|
|
||||||
side: BorderSide(
|
|
||||||
color: Colors
|
|
||||||
.transparent, // Optional border color
|
|
||||||
width: 1, // Border width
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
elevation: 0,
|
SizedBox(
|
||||||
),
|
width: 10,
|
||||||
child: Text(
|
),
|
||||||
'Import',
|
ElevatedButton(
|
||||||
style: GoogleFonts.poppins(
|
onPressed: () {
|
||||||
fontSize: 12,
|
exportToCsv(filteredData);
|
||||||
color: Color(0xFFFFFFFF),
|
},
|
||||||
fontWeight: FontWeight.w500,
|
style: ElevatedButton.styleFrom(
|
||||||
letterSpacing: 1),
|
backgroundColor: Color(0xFFE26728),
|
||||||
),
|
padding:
|
||||||
),
|
EdgeInsets.all(10), // Internal padding
|
||||||
SizedBox(
|
shape: RoundedRectangleBorder(
|
||||||
width: 10,
|
borderRadius: BorderRadius.circular(
|
||||||
),
|
10), // Border radius
|
||||||
ElevatedButton(
|
side: BorderSide(
|
||||||
onPressed: () {
|
color: Colors
|
||||||
exportToCsv(filteredData);
|
.transparent, // Optional border color
|
||||||
},
|
width: 1, // Border width
|
||||||
style: ElevatedButton.styleFrom(
|
),
|
||||||
backgroundColor: Color(0xFFE26728),
|
),
|
||||||
padding: EdgeInsets.all(10), // Internal padding
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(
|
child: Text(
|
||||||
10), // Border radius
|
'Export',
|
||||||
side: BorderSide(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors
|
fontSize: 12,
|
||||||
.transparent, // Optional border color
|
color: Color(0xFFFFFFFF),
|
||||||
width: 1, // Border width
|
fontWeight: FontWeight.w500,
|
||||||
|
letterSpacing: 1),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
elevation: 0,
|
],
|
||||||
),
|
),
|
||||||
child: Text(
|
),
|
||||||
'Export',
|
],
|
||||||
style: GoogleFonts.poppins(
|
),
|
||||||
fontSize: 12,
|
SizedBox(height: 20),
|
||||||
color: Color(0xFFFFFFFF),
|
Row(
|
||||||
fontWeight: FontWeight.w500,
|
children: [
|
||||||
letterSpacing: 1),
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
child: _buildCDDataTable(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
),
|
||||||
Row(
|
],
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
child: _buildCDDataTable(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
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
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity, // Make the footer full width
|
||||||
|
child: CustomFooter(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,24 +796,28 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
if (item['ecard_download_link'] != null)
|
||||||
onTap: () {},
|
GestureDetector(
|
||||||
child: Container(
|
onTap: () {
|
||||||
height: 35,
|
_launchURL(item['ecard_download_link']);
|
||||||
width: 35,
|
},
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Color(0xFFE6F5F6),
|
height: 35,
|
||||||
borderRadius: BorderRadius.circular(8),
|
width: 35,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: Padding(
|
color: Color(0xFFE6F5F6),
|
||||||
padding: EdgeInsets.all(6), // You can adjust this value
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Image.asset(
|
),
|
||||||
'assets/credit_card.png',
|
child: Padding(
|
||||||
fit: BoxFit.contain,
|
padding: EdgeInsets.all(
|
||||||
|
6), // You can adjust this value
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/credit_card.png',
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
@ -780,15 +831,14 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(6), // You can adjust this value
|
padding: EdgeInsets.all(
|
||||||
|
6), // You can adjust this value
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/claim.png',
|
'assets/claim.png',
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -30,6 +30,7 @@ class _ActivePolicieState extends State<ActivePolicies> {
|
|||||||
dynamic getCardArrays = [];
|
dynamic getCardArrays = [];
|
||||||
int selectedIndex = 1;
|
int selectedIndex = 1;
|
||||||
int stausVal = 1;
|
int stausVal = 1;
|
||||||
|
bool isLoading = false;
|
||||||
|
|
||||||
// List<Map<String, dynamic>> getCardArrays = [
|
// List<Map<String, dynamic>> getCardArrays = [
|
||||||
// {
|
// {
|
||||||
@ -108,7 +109,7 @@ class _ActivePolicieState extends State<ActivePolicies> {
|
|||||||
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;
|
||||||
// });
|
// });
|
||||||
@ -124,7 +125,7 @@ class _ActivePolicieState extends State<ActivePolicies> {
|
|||||||
// clintID!, clintBranchId!, hr_id, token);
|
// clintID!, clintBranchId!, hr_id, token);
|
||||||
print('IN1');
|
print('IN1');
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
setState(() {
|
setState(() {
|
||||||
print('response');
|
print('response');
|
||||||
print(response['data']);
|
print(response['data']);
|
||||||
@ -141,6 +142,7 @@ class _ActivePolicieState extends State<ActivePolicies> {
|
|||||||
print('IN2');
|
print('IN2');
|
||||||
print("getCardArrays9 - $getCardArrays");
|
print("getCardArrays9 - $getCardArrays");
|
||||||
} else {
|
} else {
|
||||||
|
isLoading = false;
|
||||||
print('API request failed with status');
|
print('API request failed with status');
|
||||||
setState(() {
|
setState(() {
|
||||||
getCardArrays = [];
|
getCardArrays = [];
|
||||||
@ -211,47 +213,59 @@ class _ActivePolicieState extends State<ActivePolicies> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
Column(
|
isLoading
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
? Expanded(
|
||||||
children: [
|
// color: Color(0x98FFFCE5), // Semi-transparent background
|
||||||
Container(
|
child: Center(
|
||||||
// color: Colors.redAccent.shade100,
|
child: // Your GIF loader widget
|
||||||
// color: Colors.white,
|
Image.asset(
|
||||||
// color: Colors.white,
|
height: 60,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
width: 60,
|
||||||
height: MediaQuery.of(context).size.height * 0.4,
|
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||||
// height: 400,
|
),
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// color: Colors.redAccent.shade100,
|
||||||
|
// color: Colors.white,
|
||||||
|
// color: Colors.white,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.4,
|
||||||
|
// height: 400,
|
||||||
|
|
||||||
child: getCardArrays.isEmpty
|
child: getCardArrays.isEmpty
|
||||||
? Center(
|
? Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'No data found',
|
'No data found',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey.shade600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: GridView.builder(
|
: GridView.builder(
|
||||||
itemCount: getCardArrays.length,
|
itemCount: getCardArrays.length,
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate:
|
||||||
crossAxisCount: 4,
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisSpacing: 20,
|
crossAxisCount: 4,
|
||||||
mainAxisSpacing: 20,
|
crossAxisSpacing: 20,
|
||||||
// childAspectRatio: 2,
|
mainAxisSpacing: 20,
|
||||||
childAspectRatio: aspectRatio,
|
// childAspectRatio: 2,
|
||||||
// childAspectRatio: 2.1,
|
childAspectRatio: aspectRatio,
|
||||||
),
|
// childAspectRatio: 2.1,
|
||||||
itemBuilder: (context, index) {
|
),
|
||||||
return buildPolicyCard(getCardArrays[index]);
|
itemBuilder: (context, index) {
|
||||||
},
|
return buildPolicyCard(getCardArrays[index]);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
List<dynamic> get _paginatedData {
|
List<dynamic> get _paginatedData {
|
||||||
final startIndex = (_currentPage - 1) * _rowsPerPage;
|
final startIndex = (_currentPage - 1) * _rowsPerPage;
|
||||||
final endIndex =
|
final endIndex =
|
||||||
(_currentPage * _rowsPerPage).clamp(0, filteredData.length);
|
(_currentPage * _rowsPerPage).clamp(0, filteredData.length);
|
||||||
return filteredData.sublist(startIndex, endIndex);
|
return filteredData.sublist(startIndex, endIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
Future<void> getCDPoliciesDetails() async {
|
Future<void> getCDPoliciesDetails() async {
|
||||||
print('9');
|
print('9');
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
print('10');
|
print('10');
|
||||||
@ -93,7 +93,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
widget.empClientId, widget.empHrId, widget.postToken);
|
widget.empClientId, widget.empHrId, widget.postToken);
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
getCDPolicies = List<Map<String, dynamic>>.from(response['data']);
|
getCDPolicies = List<Map<String, dynamic>>.from(response['data']);
|
||||||
@ -104,7 +104,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// ToastHelper.showWarningToast(
|
// ToastHelper.showWarningToast(
|
||||||
@ -113,12 +113,12 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
}
|
}
|
||||||
} 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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -268,22 +268,34 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
Row(
|
isLoading
|
||||||
children: [
|
? Expanded(
|
||||||
Expanded(
|
// color: Color(0x98FFFCE5), // semi-transparent overlay
|
||||||
child: SingleChildScrollView(
|
child: Center(
|
||||||
child: _buildCDDataTable(context),
|
child: Image.asset(
|
||||||
),
|
'assets/nhance-loader.gif',
|
||||||
)
|
height: 60,
|
||||||
],
|
width: 60,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: _buildCDDataTable(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCDDataTable(BuildContext context) {
|
Widget _buildCDDataTable(BuildContext context) {
|
||||||
|
// Loader overlay
|
||||||
|
|
||||||
if (filteredData.isEmpty) {
|
if (filteredData.isEmpty) {
|
||||||
return const SizedBox(
|
return const SizedBox(
|
||||||
height: 50,
|
height: 50,
|
||||||
@ -291,18 +303,17 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loader overlay
|
// return ListView.builder(
|
||||||
if (isLoading)
|
// itemCount: _paginatedData.length + 2, // +1 for header, +1 for pagination
|
||||||
return Container(
|
// itemBuilder: (context, index) {
|
||||||
color: Color(0x98FFFCE5), // semi-transparent overlay
|
// if (index == 0) return _buildHeader();
|
||||||
child: Center(
|
// if (index == _paginatedData.length + 1)
|
||||||
child: Image.asset(
|
// return _buildPagination(context);
|
||||||
'assets/nhance-loader.gif',
|
//
|
||||||
height: 60,
|
// final item = _paginatedData[index - 1];
|
||||||
width: 60,
|
// return _buildDataRow(item);
|
||||||
),
|
// },
|
||||||
),
|
// );
|
||||||
);
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -413,84 +424,183 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Row(
|
Widget _buildDataRow(Map<String, dynamic> item) {
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
|
||||||
|
margin: const EdgeInsets.only(top: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFE0F7F9),
|
||||||
|
border: const Border(
|
||||||
|
bottom: BorderSide(color: Color(0xFFD7E9EB), width: 1),
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(item['insurer_name'] ?? '-', style: _dataBold),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(item['cd_master_account_no'] ?? '-', style: _dataBold),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Text("₹${item['balance'] ?? '0'}", style: _dataBold),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Center(
|
||||||
|
child: IconButton(
|
||||||
|
icon: const Icon(Icons.remove_red_eye_outlined),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => cdTransactionDetails(
|
||||||
|
insurerName: item['insurer_name'],
|
||||||
|
cdMasterAccountNo: item['cd_master_account_no'],
|
||||||
|
insurerId: item['insurer_id'],
|
||||||
|
cd_ac_pk: item['cd_ac_pk'],
|
||||||
|
empClientId: widget.empClientId,
|
||||||
|
postToken: widget.postToken),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildHeader() {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFF00A6A6),
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||||
|
child: const Row(
|
||||||
|
children: [
|
||||||
|
Expanded(flex: 4, child: Text('Insurer Name', style: _headerStyle)),
|
||||||
|
Expanded(
|
||||||
|
flex: 4, child: Text('CD Account number', style: _headerStyle)),
|
||||||
|
Expanded(
|
||||||
|
flex: 4, child: Text('Current Balance', style: _headerStyle)),
|
||||||
|
Expanded(flex: 4, child: Text('Actions', style: _headerStyle)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static final _dataBold = GoogleFonts.poppins(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Color(0xFF000000),
|
||||||
|
);
|
||||||
|
|
||||||
|
static final _dataSub = GoogleFonts.poppins(
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: Color(0xFF585757),
|
||||||
|
);
|
||||||
|
|
||||||
|
static const _headerStyle = TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
);
|
||||||
|
|
||||||
|
Widget _buildPagination(BuildContext context) {
|
||||||
|
return Row(mainAxisAlignment: MainAxisAlignment.end, children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
DropdownButton<int>(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
value: _rowsPerPage,
|
||||||
child: Row(
|
items: [5, 10, 15, 20, 50].map((int value) {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
return DropdownMenuItem<int>(
|
||||||
children: [
|
value: value,
|
||||||
DropdownButton<int>(
|
child: Text(
|
||||||
value: _rowsPerPage,
|
' $value ',
|
||||||
items: [5, 10, 15, 20, 50].map((int value) {
|
style: GoogleFonts.poppins(fontSize: 15),
|
||||||
return DropdownMenuItem<int>(
|
|
||||||
value: value,
|
|
||||||
child: Text(
|
|
||||||
' $value ',
|
|
||||||
style: GoogleFonts.poppins(fontSize: 15),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (newValue) {
|
|
||||||
setState(() {
|
|
||||||
_rowsPerPage = newValue!;
|
|
||||||
_currentPage = 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
IconButton(
|
);
|
||||||
onPressed: _currentPage > 1
|
}).toList(),
|
||||||
? () {
|
onChanged: (newValue) {
|
||||||
|
setState(() {
|
||||||
|
_rowsPerPage = newValue!;
|
||||||
|
_currentPage =
|
||||||
|
1; // Reset to first page when rows per page changes
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: _currentPage > 1
|
||||||
|
? () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_currentPage--;
|
_currentPage--;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
icon: Icon(Icons.chevron_left),
|
icon: Icon(Icons.chevron_left),
|
||||||
|
),
|
||||||
|
for (int i = 1;
|
||||||
|
i <= (filteredData.length / _rowsPerPage).ceil();
|
||||||
|
i++)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: _currentPage == i
|
||||||
|
? Color(0xFF00A6A6)
|
||||||
|
: Colors.grey[300],
|
||||||
|
foregroundColor:
|
||||||
|
_currentPage == i ? Colors.white : Colors.black,
|
||||||
|
minimumSize: Size(36, 36),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
),
|
),
|
||||||
for (int i = 1;
|
onPressed: () {
|
||||||
i <= (filteredData.length / _rowsPerPage).ceil();
|
setState(() {
|
||||||
i++)
|
_currentPage = i;
|
||||||
Padding(
|
});
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
},
|
||||||
child: ElevatedButton(
|
child: Text(i.toString()),
|
||||||
style: ElevatedButton.styleFrom(
|
),
|
||||||
backgroundColor: _currentPage == i
|
|
||||||
? Color(0xFF00A6A6)
|
|
||||||
: Colors.grey[300],
|
|
||||||
foregroundColor:
|
|
||||||
_currentPage == i ? Colors.white : Colors.black,
|
|
||||||
minimumSize: Size(36, 36),
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_currentPage = i;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Text(i.toString()),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: _currentPage <
|
|
||||||
(filteredData.length / _rowsPerPage).ceil()
|
|
||||||
? () {
|
|
||||||
setState(() {
|
|
||||||
_currentPage++;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
icon: Icon(Icons.chevron_right),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed:
|
||||||
|
_currentPage < (filteredData.length / _rowsPerPage).ceil()
|
||||||
|
? () {
|
||||||
|
setState(() {
|
||||||
|
_currentPage++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
icon: Icon(Icons.chevron_right),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:jwt_decode/jwt_decode.dart';
|
import 'package:jwt_decode/jwt_decode.dart';
|
||||||
|
|
||||||
|
import '../../claimshistory.dart';
|
||||||
import '../../models/environment.dart';
|
import '../../models/environment.dart';
|
||||||
import '../api_service.dart';
|
import '../api_service.dart';
|
||||||
|
|
||||||
@ -119,14 +120,14 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
final response = await apiService.getClaimPoliciesToApi(widget.postToken);
|
final response = await apiService.getClaimPoliciesToApi(widget.postToken);
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
setState(() {
|
setState(() {
|
||||||
getClaimPoliciesApi = Map<String, dynamic>.from(response['data']);
|
getClaimPoliciesApi = Map<String, dynamic>.from(response['data']);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// ToastHelper.showWarningToast(
|
// ToastHelper.showWarningToast(
|
||||||
@ -227,9 +228,20 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
isLoading
|
||||||
child: _buildClaimsDataTable(context),
|
? Expanded(
|
||||||
),
|
// 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
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: _buildClaimsDataTable(context),
|
||||||
|
),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: Container(
|
// child: Container(
|
||||||
// child: Column(
|
// child: Column(
|
||||||
@ -692,24 +704,46 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
child: Text(item['ticket_created_date'] ?? '-', style: _dataBold),
|
child: Text(item['ticket_created_date'] ?? '-', style: _dataBold),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 1,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Dialog(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
insetPadding: EdgeInsets.all(16),
|
||||||
|
child: ClaimHistoryPopup(
|
||||||
|
ticket_id: item['id'],
|
||||||
|
empName: item['emp_name'], // example
|
||||||
|
empCode: item['emp_code'], // example
|
||||||
|
policyType: item['policy_type'],
|
||||||
|
clientPolicyNo: item['client_policy_no'],
|
||||||
|
claimAmount: item['claim_amount'],
|
||||||
|
claimNo: item['claim_no'],
|
||||||
|
postToken: widget.postToken,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 30,
|
height: 35,
|
||||||
width: 30,
|
width: 35,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xFF86D1D4),
|
color: Color(0xFF86D1D4),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(6), // You can adjust this value
|
padding: EdgeInsets.all(10), // You can adjust this value
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/claimHistory.png',
|
'assets/claimHistory.png',
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
|
width: 5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1106,6 +1140,12 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
height: 40,
|
height: 40,
|
||||||
child: DropdownSearch<String>(
|
child: DropdownSearch<String>(
|
||||||
selectedItem: selectedPolicyTypeName,
|
selectedItem: selectedPolicyTypeName,
|
||||||
|
dropdownBuilder: (context, selectedItem) {
|
||||||
|
return Text(
|
||||||
|
selectedItem ?? "",
|
||||||
|
style: TextStyle(fontSize: 12),
|
||||||
|
);
|
||||||
|
},
|
||||||
items: (String? filter, _) {
|
items: (String? filter, _) {
|
||||||
return ticketTypeList
|
return ticketTypeList
|
||||||
.map<String>((item) => item['type_name'].toString())
|
.map<String>((item) => item['type_name'].toString())
|
||||||
@ -1123,7 +1163,6 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
},
|
},
|
||||||
decoratorProps: DropDownDecoratorProps(
|
decoratorProps: DropDownDecoratorProps(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
constraints: BoxConstraints(maxHeight: 200),
|
|
||||||
hintText: "Select Policy Type",
|
hintText: "Select Policy Type",
|
||||||
hintStyle: TextStyle(fontSize: 12),
|
hintStyle: TextStyle(fontSize: 12),
|
||||||
filled: true,
|
filled: true,
|
||||||
@ -1144,9 +1183,12 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
popupProps: const PopupProps.menu(
|
popupProps: PopupProps.menu(
|
||||||
|
menuProps: const MenuProps(color: Colors.red),
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
constraints: const BoxConstraints(maxHeight: 250),
|
||||||
showSearchBox: true,
|
showSearchBox: true,
|
||||||
searchFieldProps: TextFieldProps(
|
searchFieldProps: const TextFieldProps(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "Search Policy Type",
|
hintText: "Search Policy Type",
|
||||||
hintStyle: TextStyle(fontSize: 12),
|
hintStyle: TextStyle(fontSize: 12),
|
||||||
@ -1207,7 +1249,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
"Claim Status",
|
"Claim Status",
|
||||||
style: TextStyle(fontSize: 12),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
height: 3,
|
height: 3,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -1229,42 +1271,15 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
"Selected selectedClaimStatusName: $selectedClaimStatusName");
|
"Selected selectedClaimStatusName: $selectedClaimStatusName");
|
||||||
print("Selected selectedClaimStatus: $selectedClaimStatus");
|
print("Selected selectedClaimStatus: $selectedClaimStatus");
|
||||||
},
|
},
|
||||||
|
dropdownBuilder: (context, selectedItem) {
|
||||||
// selectedItem: selectedClaimStatus,
|
return Text(
|
||||||
// selectedItem: getTypeNameById(selectedClaimStatus),
|
selectedItem ?? "",
|
||||||
// items: (String? filter, _) {
|
style: TextStyle(fontSize: 12),
|
||||||
// List<String> allItems = claimStatusList
|
);
|
||||||
// .map<String>((item) => item['claim_status'].toString())
|
},
|
||||||
// .toList();
|
|
||||||
//
|
|
||||||
// if (filter == null || filter.isEmpty) return allItems;
|
|
||||||
//
|
|
||||||
// return allItems
|
|
||||||
// .where((element) =>
|
|
||||||
// element.toLowerCase().contains(filter.toLowerCase()))
|
|
||||||
// .toList();
|
|
||||||
// },
|
|
||||||
|
|
||||||
//
|
|
||||||
// onChanged: (value) {
|
|
||||||
// if (!mounted) return;
|
|
||||||
// print("Selected ticket_type11: $value");
|
|
||||||
//
|
|
||||||
// final id = getIdByTypeName(value);
|
|
||||||
// print("getIdByTypeName returned: $id");
|
|
||||||
//
|
|
||||||
// if (id != null) {
|
|
||||||
// setState(() {
|
|
||||||
// selectedClaimStatus = id;
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// print("No match found for $value");
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
decoratorProps: DropDownDecoratorProps(
|
decoratorProps: DropDownDecoratorProps(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
constraints: BoxConstraints(maxHeight: 200),
|
// suffixStyle: TextStyle(color: Colors.red),
|
||||||
hintText: "Select Policy Type",
|
hintText: "Select Policy Type",
|
||||||
hintStyle: TextStyle(fontSize: 12),
|
hintStyle: TextStyle(fontSize: 12),
|
||||||
filled: true,
|
filled: true,
|
||||||
@ -1283,12 +1298,17 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
),
|
),
|
||||||
contentPadding:
|
contentPadding:
|
||||||
EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
|
labelStyle: TextStyle(fontSize: 19, color: Colors.red),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
popupProps: PopupProps.menu(
|
popupProps: const PopupProps.menu(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
constraints: BoxConstraints(maxHeight: 250),
|
||||||
showSearchBox: true,
|
showSearchBox: true,
|
||||||
searchFieldProps: TextFieldProps(
|
searchFieldProps: TextFieldProps(
|
||||||
|
style: TextStyle(fontSize: 14.0, color: Colors.red),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
labelStyle: TextStyle(fontSize: 19, color: Colors.red),
|
||||||
hintText: "Search Claim Status",
|
hintText: "Search Claim Status",
|
||||||
hintStyle: TextStyle(fontSize: 12),
|
hintStyle: TextStyle(fontSize: 12),
|
||||||
contentPadding:
|
contentPadding:
|
||||||
|
|||||||
@ -29,6 +29,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
late ApiService apiService;
|
late ApiService apiService;
|
||||||
dynamic getCardArrays = [];
|
dynamic getCardArrays = [];
|
||||||
int selectedIndex = 0;
|
int selectedIndex = 0;
|
||||||
|
bool isLoading = false;
|
||||||
// List<Map<String, dynamic>> getCardArrays = [
|
// List<Map<String, dynamic>> getCardArrays = [
|
||||||
// {
|
// {
|
||||||
// "client_policy_id": 392,
|
// "client_policy_id": 392,
|
||||||
@ -91,7 +92,7 @@ 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;
|
||||||
// });
|
// });
|
||||||
@ -106,7 +107,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
// clintID!, clintBranchId!, hr_id, token);
|
// clintID!, clintBranchId!, hr_id, token);
|
||||||
print('IN1');
|
print('IN1');
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
// isLoading = false;
|
isLoading = false;
|
||||||
setState(() {
|
setState(() {
|
||||||
print('response');
|
print('response');
|
||||||
print(response['data']);
|
print(response['data']);
|
||||||
@ -120,6 +121,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
print('IN2');
|
print('IN2');
|
||||||
print("getCardArrays9 - $getCardArrays");
|
print("getCardArrays9 - $getCardArrays");
|
||||||
} else {
|
} else {
|
||||||
|
isLoading = false;
|
||||||
print('API request failed with status');
|
print('API request failed with status');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -159,39 +161,51 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
isLoading
|
||||||
// color: Colors.redAccent.shade100,
|
? Container(
|
||||||
// color: Colors.white,
|
// color: Color(0x98FFFCE5), // Semi-transparent background
|
||||||
// color: Colors.white,
|
child: Center(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
child: // Your GIF loader widget
|
||||||
height: MediaQuery.of(context).size.height * 0.45,
|
Image.asset(
|
||||||
// height: 400,
|
height: 60,
|
||||||
|
width: 60,
|
||||||
child: getCardArrays.isEmpty
|
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||||
? Center(
|
|
||||||
child: Text(
|
|
||||||
'No data found',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
color: Colors.grey.shade600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: GridView.builder(
|
|
||||||
itemCount: getCardArrays.length,
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 4,
|
|
||||||
crossAxisSpacing: 20,
|
|
||||||
mainAxisSpacing: 20,
|
|
||||||
// childAspectRatio: 2,
|
|
||||||
childAspectRatio: aspectRatio,
|
|
||||||
// childAspectRatio: 2.1,
|
|
||||||
),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return buildPolicyCard(getCardArrays[index]);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
|
: Container(
|
||||||
|
// color: Colors.redAccent.shade100,
|
||||||
|
// color: Colors.white,
|
||||||
|
// color: Colors.white,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.45,
|
||||||
|
// height: 400,
|
||||||
|
|
||||||
|
child: getCardArrays.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: Text(
|
||||||
|
'No data found',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: GridView.builder(
|
||||||
|
itemCount: getCardArrays.length,
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 4,
|
||||||
|
crossAxisSpacing: 20,
|
||||||
|
mainAxisSpacing: 20,
|
||||||
|
// childAspectRatio: 2,
|
||||||
|
childAspectRatio: aspectRatio,
|
||||||
|
// childAspectRatio: 2.1,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return buildPolicyCard(getCardArrays[index]);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user