merge
This commit is contained in:
commit
dcea271d7c
@ -21,7 +21,16 @@ import 'package:universal_html/html.dart' as html;
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
class hrDashboard extends StatefulWidget {
|
class hrDashboard extends StatefulWidget {
|
||||||
const hrDashboard({Key? key}) : super(key: key);
|
final int selectedIndex;
|
||||||
|
late final int isHrcode;
|
||||||
|
final String empCodeFromHrPolicy;
|
||||||
|
|
||||||
|
hrDashboard({
|
||||||
|
Key? key,
|
||||||
|
required this.selectedIndex,
|
||||||
|
required this.isHrcode,
|
||||||
|
required this.empCodeFromHrPolicy,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<hrDashboard> createState() => _hrDashboardState();
|
State<hrDashboard> createState() => _hrDashboardState();
|
||||||
@ -32,6 +41,7 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
late ApiService apiService;
|
late ApiService apiService;
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
|
int isHrcode = 0;
|
||||||
late String _token;
|
late String _token;
|
||||||
dynamic getPolicyNo;
|
dynamic getPolicyNo;
|
||||||
// bool _isLoading = false;
|
// bool _isLoading = false;
|
||||||
@ -52,6 +62,8 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
dynamic enrollmentEmpClientBranchId;
|
dynamic enrollmentEmpClientBranchId;
|
||||||
dynamic enrollmentHrId;
|
dynamic enrollmentHrId;
|
||||||
dynamic empClientId;
|
dynamic empClientId;
|
||||||
|
String empCodeFromHrPolcy = '';
|
||||||
|
|
||||||
final List<Color> cardColors = [
|
final List<Color> cardColors = [
|
||||||
Color(0xFFFFE3D9),
|
Color(0xFFFFE3D9),
|
||||||
Color(0xFFFFD9EE),
|
Color(0xFFFFD9EE),
|
||||||
@ -66,6 +78,8 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
super.initState();
|
super.initState();
|
||||||
apiService = ApiService(context); // Initialize ApiService here
|
apiService = ApiService(context); // Initialize ApiService here
|
||||||
_loadToken();
|
_loadToken();
|
||||||
|
empCodeFromHrPolcy = widget.empCodeFromHrPolicy;
|
||||||
|
|
||||||
// _tabController = TabController(length: 4, vsync: this);
|
// _tabController = TabController(length: 4, vsync: this);
|
||||||
// _tabController.addListener(() {
|
// _tabController.addListener(() {
|
||||||
// setState(() {
|
// setState(() {
|
||||||
@ -219,17 +233,22 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
postToken: _postToken,
|
postToken: _postToken,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
print('333');
|
||||||
if (empAllowed_modules.contains(4)) {
|
if (empAllowed_modules.contains(4)) {
|
||||||
tabData.add({
|
tabData.add({
|
||||||
'icon': Icons.receipt_long,
|
'icon': Icons.receipt_long,
|
||||||
'label': 'Claims',
|
'label': 'Claims',
|
||||||
});
|
});
|
||||||
tabViews.add(ClaimsPolicies(
|
tabViews.add(ClaimsPolicies(
|
||||||
empClientId: empClientId,
|
empClientId: empClientId,
|
||||||
empClientBranchId: empClientBranchId,
|
empClientBranchId: empClientBranchId,
|
||||||
empHrId: empHrId,
|
empHrId: empHrId,
|
||||||
postToken: _postToken,
|
postToken: _postToken,
|
||||||
));
|
isHrcode: widget.isHrcode == 1 ? 1 : 0,
|
||||||
|
empCodeHrPolicy: empCodeFromHrPolcy
|
||||||
|
// empCodeHrPolicy: widget.empCodeFromHrPolicy
|
||||||
|
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// getCashDepositDetails(
|
// getCashDepositDetails(
|
||||||
@ -244,9 +263,35 @@ class _hrDashboardState extends State<hrDashboard>
|
|||||||
}
|
}
|
||||||
|
|
||||||
_tabController = TabController(length: tabData.length, vsync: this);
|
_tabController = TabController(length: tabData.length, vsync: this);
|
||||||
|
|
||||||
|
print('selectedIndex ${widget.selectedIndex}');
|
||||||
|
// var isHrcode;
|
||||||
|
print('111');
|
||||||
|
if (widget.selectedIndex == 3) {
|
||||||
|
print("Process1");
|
||||||
|
_tabController.index = 3;
|
||||||
|
setState(() {
|
||||||
|
selectedIndex = 3;
|
||||||
|
isHrcode = 1;
|
||||||
|
empCodeFromHrPolcy = widget.empCodeFromHrPolicy;
|
||||||
|
});
|
||||||
|
print("tabIndexConti11- $selectedIndex - ${_tabController.index}");
|
||||||
|
// print("tabIndexCode11- $isHrcode - ${widget.isHrempcode}");
|
||||||
|
}
|
||||||
|
|
||||||
|
print('222');
|
||||||
_tabController.addListener(() {
|
_tabController.addListener(() {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedIndex = _tabController.index;
|
selectedIndex = _tabController.index;
|
||||||
|
if (widget.selectedIndex == 3) {
|
||||||
|
isHrcode = 1;
|
||||||
|
} else {
|
||||||
|
isHrcode = 0;
|
||||||
|
}
|
||||||
|
empCodeFromHrPolcy = '';
|
||||||
|
print("Process2");
|
||||||
|
print("tabIndexConti- $selectedIndex - ${_tabController.index}");
|
||||||
|
// print("tabIndexCode11- $isHrcode ");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:nhancepolicy/customAppBar/enrollmentAppBar.dart';
|
|||||||
import 'package:nhancepolicy/excel_verification.dart';
|
import 'package:nhancepolicy/excel_verification.dart';
|
||||||
import 'package:nhancepolicy/models/environment.dart';
|
import 'package:nhancepolicy/models/environment.dart';
|
||||||
import 'package:nhancepolicy/service/api_service.dart';
|
import 'package:nhancepolicy/service/api_service.dart';
|
||||||
|
import 'package:nhancepolicy/service/hrDashboardTabs/claims.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:jwt_decode/jwt_decode.dart';
|
import 'package:jwt_decode/jwt_decode.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
@ -22,6 +23,7 @@ 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 'package:url_launcher/url_launcher.dart';
|
||||||
import 'customAppBar/customFooter.dart';
|
import 'customAppBar/customFooter.dart';
|
||||||
|
import 'hrDashboard.dart';
|
||||||
|
|
||||||
class hrPolicyDetails extends StatefulWidget {
|
class hrPolicyDetails extends StatefulWidget {
|
||||||
final String ClientId;
|
final String ClientId;
|
||||||
@ -822,7 +824,21 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
print("policytabdata - ${item['emp_code']!}");
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => hrDashboard(
|
||||||
|
selectedIndex: 3,
|
||||||
|
empCodeFromHrPolicy:
|
||||||
|
item['emp_code']!,
|
||||||
|
isHrcode: 1),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 35,
|
height: 35,
|
||||||
width: 35,
|
width: 35,
|
||||||
|
|||||||
@ -82,15 +82,19 @@ Future<void> main() async {
|
|||||||
'empDetails': (context) => empDetails(),
|
'empDetails': (context) => empDetails(),
|
||||||
'addOnsDetails': (context) => addOnsDetails(),
|
'addOnsDetails': (context) => addOnsDetails(),
|
||||||
'empReviewDetails': (context) => empReviewDetails(),
|
'empReviewDetails': (context) => empReviewDetails(),
|
||||||
'hrDashboard': (context) => hrDashboard(),
|
'hrDashboard': (context) => hrDashboard(
|
||||||
|
selectedIndex: 0,
|
||||||
|
isHrcode: 0,
|
||||||
|
empCodeFromHrPolicy: '',
|
||||||
|
),
|
||||||
'cdTransactionDetails': (context) => cdTransactionDetails(
|
'cdTransactionDetails': (context) => cdTransactionDetails(
|
||||||
insurerName: '',
|
insurerName: '',
|
||||||
cdMasterAccountNo: '',
|
cdMasterAccountNo: '',
|
||||||
insurerId: '',
|
insurerId: '',
|
||||||
cd_ac_pk: '',
|
cd_ac_pk: '',
|
||||||
empClientId: '',
|
empClientId: '',
|
||||||
postToken: '',
|
postToken: '',
|
||||||
),
|
),
|
||||||
'hrPolicyDetails': (context) => hrPolicyDetails(
|
'hrPolicyDetails': (context) => hrPolicyDetails(
|
||||||
ClientId: '',
|
ClientId: '',
|
||||||
ClientPoliyId: '',
|
ClientPoliyId: '',
|
||||||
|
|||||||
@ -280,13 +280,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Expanded(
|
: Expanded(
|
||||||
child: Row(
|
child: _buildCDDataTable(context),
|
||||||
children: [
|
|
||||||
SingleChildScrollView(
|
|
||||||
child: _buildCDDataTable(context),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -303,129 +297,131 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// return ListView.builder(
|
return ListView.builder(
|
||||||
// itemCount: _paginatedData.length + 2, // +1 for header, +1 for pagination
|
itemCount: _paginatedData.length + 2, // +1 for header, +1 for pagination
|
||||||
// itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
// if (index == 0) return _buildHeader();
|
if (index == 0) return _buildHeader();
|
||||||
// if (index == _paginatedData.length + 1)
|
if (index == _paginatedData.length + 1)
|
||||||
// return _buildPagination(context);
|
return _buildPagination(context);
|
||||||
//
|
|
||||||
// final item = _paginatedData[index - 1];
|
|
||||||
// return _buildDataRow(item);
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
|
|
||||||
return Column(
|
final item = _paginatedData[index - 1];
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
return _buildDataRow(item);
|
||||||
children: [
|
},
|
||||||
// Header row
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Color(0xFF00A6A6),
|
|
||||||
borderRadius: BorderRadius.circular(6),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 4,
|
|
||||||
child: Text(
|
|
||||||
'Insurer Name',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.white, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Text(
|
|
||||||
'CD Account number',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.white, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Text(
|
|
||||||
'Current Balance',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.white, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: Text(
|
|
||||||
'Action',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.white, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
const SizedBox(height: 6),
|
|
||||||
|
|
||||||
// Table body rows
|
|
||||||
..._paginatedData.mapIndexed((index, item) {
|
|
||||||
return Container(
|
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: index % 2 == 0 ? Color(0xFFE6FAFB) : Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(6),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 4,
|
|
||||||
child: Text(
|
|
||||||
item['insurer_name'] ?? '-',
|
|
||||||
style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Text(
|
|
||||||
item['cd_master_account_no'] ?? '-',
|
|
||||||
style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Text(
|
|
||||||
"₹${item['balance'] ?? '0'}",
|
|
||||||
style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// return Column(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// // Header row
|
||||||
|
// Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: Color(0xFF00A6A6),
|
||||||
|
// borderRadius: BorderRadius.circular(6),
|
||||||
|
// ),
|
||||||
|
// padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||||
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// flex: 4,
|
||||||
|
// child: Text(
|
||||||
|
// 'Insurer Name',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 3,
|
||||||
|
// child: Text(
|
||||||
|
// 'CD Account number',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 2,
|
||||||
|
// child: Text(
|
||||||
|
// 'Current Balance',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 1,
|
||||||
|
// child: Text(
|
||||||
|
// 'Action',
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
//
|
||||||
|
// const SizedBox(height: 6),
|
||||||
|
//
|
||||||
|
// // Table body rows
|
||||||
|
// ..._paginatedData.mapIndexed((index, item) {
|
||||||
|
// return Container(
|
||||||
|
// margin: const EdgeInsets.only(bottom: 8),
|
||||||
|
// padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: index % 2 == 0 ? Color(0xFFE6FAFB) : Colors.white,
|
||||||
|
// borderRadius: BorderRadius.circular(6),
|
||||||
|
// ),
|
||||||
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// flex: 4,
|
||||||
|
// child: Text(
|
||||||
|
// item['insurer_name'] ?? '-',
|
||||||
|
// style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 3,
|
||||||
|
// child: Text(
|
||||||
|
// item['cd_master_account_no'] ?? '-',
|
||||||
|
// style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 2,
|
||||||
|
// child: Text(
|
||||||
|
// "₹${item['balance'] ?? '0'}",
|
||||||
|
// style: GoogleFonts.poppins(color: Color(0xFF000000)),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// 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),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }).toList(),
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDataRow(Map<String, dynamic> item) {
|
Widget _buildDataRow(Map<String, dynamic> item) {
|
||||||
@ -451,7 +447,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 4,
|
flex: 3,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -460,7 +456,7 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 2,
|
||||||
child: Text("₹${item['balance'] ?? '0'}", style: _dataBold),
|
child: Text("₹${item['balance'] ?? '0'}", style: _dataBold),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -501,10 +497,10 @@ class _CdPolicieState extends State<CdPolicies> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(flex: 4, child: Text('Insurer Name', style: _headerStyle)),
|
Expanded(flex: 4, child: Text('Insurer Name', style: _headerStyle)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 4, child: Text('CD Account number', style: _headerStyle)),
|
flex: 3, child: Text('CD Account number', style: _headerStyle)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 4, child: Text('Current Balance', style: _headerStyle)),
|
flex: 2, child: Text('Current Balance', style: _headerStyle)),
|
||||||
Expanded(flex: 4, child: Text('Actions', style: _headerStyle)),
|
Expanded(flex: 1, child: Text('Actions', style: _headerStyle)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -17,13 +17,18 @@ class ClaimsPolicies extends StatefulWidget {
|
|||||||
final String empClientBranchId;
|
final String empClientBranchId;
|
||||||
final String empHrId;
|
final String empHrId;
|
||||||
final String postToken;
|
final String postToken;
|
||||||
|
final String empCodeHrPolicy;
|
||||||
|
|
||||||
|
final int isHrcode;
|
||||||
|
|
||||||
const ClaimsPolicies(
|
const ClaimsPolicies(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.empClientId,
|
required this.empClientId,
|
||||||
required this.empClientBranchId,
|
required this.empClientBranchId,
|
||||||
required this.empHrId,
|
required this.empHrId,
|
||||||
required this.postToken});
|
required this.postToken,
|
||||||
|
required this.empCodeHrPolicy,
|
||||||
|
required this.isHrcode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ClaimsPolicies> createState() => _ClaimsPolicieState();
|
State<ClaimsPolicies> createState() => _ClaimsPolicieState();
|
||||||
@ -86,18 +91,40 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
apiService = ApiService(context);
|
apiService = ApiService(context);
|
||||||
|
|
||||||
if (widget.postToken != null && widget.postToken.isNotEmpty) {
|
|
||||||
Map<String, dynamic>? postdecodedToken = Jwt.parseJwt(widget.postToken);
|
|
||||||
|
|
||||||
empClientId = postdecodedToken['client_id'].toString();
|
|
||||||
getClaimList();
|
|
||||||
}
|
|
||||||
for (String field in tabHeader) {
|
for (String field in tabHeader) {
|
||||||
controllers[field] = TextEditingController();
|
controllers[field] = TextEditingController();
|
||||||
}
|
}
|
||||||
|
|
||||||
print("TextCXOnte - $controllers");
|
print("TextCXOnte - $controllers");
|
||||||
|
|
||||||
|
if (widget.postToken != null && widget.postToken.isNotEmpty) {
|
||||||
|
Map<String, dynamic>? postdecodedToken = Jwt.parseJwt(widget.postToken);
|
||||||
|
|
||||||
|
empClientId = postdecodedToken['client_id'].toString();
|
||||||
|
|
||||||
|
print("Empcoed1- ${widget.empCodeHrPolicy}");
|
||||||
|
print("EmpisHrcode- ${widget.isHrcode}");
|
||||||
|
if (widget.empCodeHrPolicy != '') {
|
||||||
|
print("Empcoedbool- ${widget.isHrcode}");
|
||||||
|
controllers['empCode']!.text = widget.empCodeHrPolicy;
|
||||||
|
// if (widget.isHrcode == 0) {
|
||||||
|
// controllers['empCode']?.clear();
|
||||||
|
// } else {
|
||||||
|
// controllers['empCode']!.text = widget.empCodeHrPolicy;
|
||||||
|
// }
|
||||||
|
|
||||||
|
print("Empcoed- ${widget.empCodeHrPolicy}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (widget.empCodeHrPolicy != '' && widget.isHrcode) {
|
||||||
|
// print("Empcoedbool- ${widget.isHrcode}");
|
||||||
|
// controllers['empCode']!.text = widget.empCodeHrPolicy;
|
||||||
|
// print("Empcoed- ${widget.empCodeHrPolicy}");
|
||||||
|
// }
|
||||||
|
|
||||||
|
getClaimList();
|
||||||
|
}
|
||||||
|
|
||||||
getClaimsPoliciesDetails();
|
getClaimsPoliciesDetails();
|
||||||
// getApiData();
|
// getApiData();
|
||||||
}
|
}
|
||||||
@ -107,6 +134,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
for (var controller in controllers.values) {
|
for (var controller in controllers.values) {
|
||||||
controller.dispose();
|
controller.dispose();
|
||||||
}
|
}
|
||||||
|
controllers['empCode']?.clear();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +215,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void applyFilter() {
|
void applyFilter() {
|
||||||
|
print("Filtersss");
|
||||||
final data = claim_Detials();
|
final data = claim_Detials();
|
||||||
print("data -- $data");
|
print("data -- $data");
|
||||||
getClaimList();
|
getClaimList();
|
||||||
|
|||||||
@ -139,10 +139,10 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
final totalSpacing = (crossAxisCount - 1) * spacing;
|
final totalSpacing = (crossAxisCount - 1) * spacing;
|
||||||
final itemWidth = (screenWidth - totalSpacing) / crossAxisCount;
|
final itemWidth = (screenWidth - totalSpacing) / crossAxisCount;
|
||||||
|
|
||||||
// Example: target card height
|
// Example: target card height
|
||||||
final itemHeight = screenHeight * 0.2;
|
final itemHeight = screenHeight * 0.2;
|
||||||
|
|
||||||
// Dynamic aspect ratio:
|
// Dynamic aspect ratio:
|
||||||
final aspectRatio = screenWidth / screenHeight;
|
final aspectRatio = screenWidth / screenHeight;
|
||||||
|
|
||||||
print("_PreEnrollmentState 4");
|
print("_PreEnrollmentState 4");
|
||||||
@ -176,7 +176,7 @@ class _PreEnrollmentState extends State<PreEnrollment> {
|
|||||||
// color: Colors.redAccent.shade100,
|
// color: Colors.redAccent.shade100,
|
||||||
// color: Colors.white,
|
// color: Colors.white,
|
||||||
// color: Colors.white,
|
// color: Colors.white,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
// padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
height: MediaQuery.of(context).size.height * 0.45,
|
height: MediaQuery.of(context).size.height * 0.45,
|
||||||
// height: 400,
|
// height: 400,
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user