CHANGE_
This commit is contained in:
parent
17280b1bb8
commit
653dd27018
Binary file not shown.
575
lib/addons.dart
575
lib/addons.dart
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@ class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
|
|
||||||
class _CustomAppBarState extends State<CustomAppBar> {
|
class _CustomAppBarState extends State<CustomAppBar> {
|
||||||
bool showBackToHR = true;
|
bool showBackToHR = true;
|
||||||
bool hideInactiveStatus = true;
|
// bool hideInactiveStatus = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -32,7 +32,7 @@ class _CustomAppBarState extends State<CustomAppBar> {
|
|||||||
showBackToHR = (hrtoken != null && hrtoken.isNotEmpty) &&
|
showBackToHR = (hrtoken != null && hrtoken.isNotEmpty) &&
|
||||||
(token != null && token.isNotEmpty);
|
(token != null && token.isNotEmpty);
|
||||||
|
|
||||||
hideInactiveStatus = token != null && token.isNotEmpty;
|
// hideInactiveStatus = token != null && token.isNotEmpty;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,14 +113,14 @@ class _CustomAppBarState extends State<CustomAppBar> {
|
|||||||
Container(), // Set an empty container as we have the logo separately
|
Container(), // Set an empty container as we have the logo separately
|
||||||
title: Text(''),
|
title: Text(''),
|
||||||
navBarItems: [
|
navBarItems: [
|
||||||
if (Responsive.isDesktop(context))
|
// if (Responsive.isDesktop(context))
|
||||||
if (hideInactiveStatus)
|
// if (hideInactiveStatus)
|
||||||
NavBarItem(
|
// NavBarItem(
|
||||||
text: "Inactive Policy",
|
// text: "Inactive Policy",
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
Navigator.pushNamed(context, 'oldPolicy');
|
// Navigator.pushNamed(context, 'oldPolicy');
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
if (showBackToHR)
|
if (showBackToHR)
|
||||||
NavBarItem(
|
NavBarItem(
|
||||||
text: "Back To HR",
|
text: "Back To HR",
|
||||||
|
|||||||
23
lib/customAppBar/customFooter.dart
Normal file
23
lib/customAppBar/customFooter.dart
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CustomFooter extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
color: Color(0xFFFFFBDE), // Background color of the footer
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Copyright@ 2024 Nhance - Jubiliant',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey[600], // Text color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,6 +17,8 @@ import 'dart:async';
|
|||||||
import 'package:nhancepolicy/responsive.dart';
|
import 'package:nhancepolicy/responsive.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import 'customAppBar/customFooter.dart';
|
||||||
|
|
||||||
class empDetails extends StatefulWidget {
|
class empDetails extends StatefulWidget {
|
||||||
const empDetails({Key? key}) : super(key: key);
|
const empDetails({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -682,6 +684,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
children: [
|
children: [
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 75,
|
height: 75,
|
||||||
@ -753,6 +756,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
@ -798,6 +802,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
children: [
|
children: [
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 75,
|
height: 75,
|
||||||
@ -870,6 +875,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
if (gpaPolicies != null && gpaPolicies.length > 0)
|
if (gpaPolicies != null && gpaPolicies.length > 0)
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.all(30)
|
? EdgeInsets.all(30)
|
||||||
@ -1224,6 +1230,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
if (gmcPolicies != null && gmcPolicies.length > 0)
|
if (gmcPolicies != null && gmcPolicies.length > 0)
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 75,
|
height: 75,
|
||||||
@ -1266,13 +1273,14 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 30),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: Color(0xFFFFFCE5), // Semi-transparent background
|
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||||
child: Center(
|
child: Center(
|
||||||
child: // Your GIF loader widget
|
child: // Your GIF loader widget
|
||||||
Image.asset(
|
Image.asset(
|
||||||
@ -1281,6 +1289,13 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
'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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1348,6 +1363,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.all(30)
|
? EdgeInsets.all(30)
|
||||||
@ -1602,6 +1618,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.all(30)
|
? EdgeInsets.all(30)
|
||||||
@ -2216,6 +2233,7 @@ class _empDetailsState extends State<empDetails> {
|
|||||||
|
|
||||||
Widget card = Card(
|
Widget card = Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.all(30)
|
? EdgeInsets.all(30)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:jwt_decode/jwt_decode.dart';
|
import 'package:jwt_decode/jwt_decode.dart';
|
||||||
import 'package:nhancepolicy/customAppBar/customAppBar.dart';
|
import 'package:nhancepolicy/customAppBar/customAppBar.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
@ -17,6 +18,8 @@ import 'package:csv/csv.dart';
|
|||||||
|
|
||||||
import 'package:spreadsheet_decoder/spreadsheet_decoder.dart';
|
import 'package:spreadsheet_decoder/spreadsheet_decoder.dart';
|
||||||
|
|
||||||
|
import 'customAppBar/customFooter.dart';
|
||||||
|
|
||||||
class excelVerify extends StatefulWidget {
|
class excelVerify extends StatefulWidget {
|
||||||
const excelVerify({Key? key}) : super(key: key);
|
const excelVerify({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -43,6 +46,7 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
dynamic argumentsData;
|
dynamic argumentsData;
|
||||||
List<Map<String, dynamic>> originalData = []; // Original data source
|
List<Map<String, dynamic>> originalData = []; // Original data source
|
||||||
List<Map<String, dynamic>> filteredData = []; // Filtered data source
|
List<Map<String, dynamic>> filteredData = []; // Filtered data source
|
||||||
|
List<Map<String, dynamic>> tableData = []; // Filtered data source
|
||||||
|
|
||||||
dynamic policy_name;
|
dynamic policy_name;
|
||||||
dynamic clientPolicyId;
|
dynamic clientPolicyId;
|
||||||
@ -52,6 +56,12 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
dynamic invalidRelationships = 0;
|
dynamic invalidRelationships = 0;
|
||||||
dynamic dobAgeCheckCount = 0;
|
dynamic dobAgeCheckCount = 0;
|
||||||
dynamic empRefId;
|
dynamic empRefId;
|
||||||
|
List<String> excelHeader = [];
|
||||||
|
List<List<Map<String, dynamic>>> excelData = [];
|
||||||
|
late int excelValidationStaus = 1;
|
||||||
|
bool isSuccess = false;
|
||||||
|
String successContent = '';
|
||||||
|
bool isLoading = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -135,8 +145,9 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
html.window.localStorage['fileBytes'] = jsonString;
|
html.window.localStorage['fileBytes'] = jsonString;
|
||||||
print('File Name: $fileName');
|
print('File Name: $fileName');
|
||||||
print('File Bytes: $fileBytes');
|
print('File Bytes: $fileBytes');
|
||||||
|
sendExcelFIleTOAPI(fileBytes, fileName);
|
||||||
// Call the function to process Excel data here
|
// Call the function to process Excel data here
|
||||||
_processExcelData(fileBytes, fileName);
|
// _processExcelData(fileBytes, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -387,7 +398,12 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> sendExcelFIleTOAPI(Uint8List fileBytes, String fileName) async {
|
Future<void> sendExcelFIleTOAPI(Uint8List fileBytes, fileName) async {
|
||||||
|
// Future.delayed(Duration(seconds: 3), () {
|
||||||
|
// setState(() {
|
||||||
|
isLoading = true;
|
||||||
|
// });
|
||||||
|
// });
|
||||||
print('submit');
|
print('submit');
|
||||||
print(fileBytes);
|
print(fileBytes);
|
||||||
if (fileBytes == null) {
|
if (fileBytes == null) {
|
||||||
@ -434,19 +450,43 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
print('else');
|
print('else');
|
||||||
// Check the status code of the response
|
// Check the status code of the response
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
isLoading = false;
|
||||||
Map<String, dynamic> data = json.decode(responseString);
|
Map<String, dynamic> data = json.decode(responseString);
|
||||||
if (data['status'] == 'success') {
|
if (data['status'] == 'success') {
|
||||||
html.window.localStorage.remove('fileBytes');
|
ToastHelper.showSuccessToast(context, data['message']);
|
||||||
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
|
print('Table');
|
||||||
ToastHelper.showSuccessToast(
|
|
||||||
context, 'Data Successfully Imported...');
|
setState(() {
|
||||||
print('Data Successfully Imported');
|
isSuccess = true;
|
||||||
Navigator.pushNamed(context, 'hrPolicyDetails',
|
successContent = data['message'];
|
||||||
arguments: argumentsData);
|
excelValidationStaus = 0;
|
||||||
|
// excelHeader = List<String>.from(data['data']['excel_header']);
|
||||||
|
// print('excelHeader : $excelHeader');
|
||||||
|
// excelData = (data['data']['excel_data'] as List)
|
||||||
|
// .map<List<Map<String, dynamic>>>((row) => row
|
||||||
|
// .map<Map<String, dynamic>>(
|
||||||
|
// (cell) => Map<String, dynamic>.from(cell))
|
||||||
|
// .toList())
|
||||||
|
// .toList();
|
||||||
|
// print('excelHeader : $excelHeader');
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
|
ToastHelper.showErrorToast(context, data['message']);
|
||||||
ToastHelper.showErrorToast(context, 'Failed to Imported...');
|
print('Table');
|
||||||
// Navigator.pushNamed(context, 'hrHome');
|
|
||||||
|
setState(() {
|
||||||
|
isSuccess = false;
|
||||||
|
excelValidationStaus = 1;
|
||||||
|
excelHeader = List<String>.from(data['data']['excel_header']);
|
||||||
|
print('excelHeader : $excelHeader');
|
||||||
|
excelData = (data['data']['excel_data'] as List)
|
||||||
|
.map<List<Map<String, dynamic>>>((row) => row
|
||||||
|
.map<Map<String, dynamic>>(
|
||||||
|
(cell) => Map<String, dynamic>.from(cell))
|
||||||
|
.toList())
|
||||||
|
.toList();
|
||||||
|
print('excelHeader : $excelHeader');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ToastHelper.showSuccessToast(
|
// ToastHelper.showSuccessToast(
|
||||||
@ -483,26 +523,28 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
fileBytes = null;
|
fileBytes = null;
|
||||||
fileName = null;
|
fileName = null;
|
||||||
_currentStep = 0;
|
_currentStep = 0;
|
||||||
|
excelHeader.clear();
|
||||||
|
excelData.clear();
|
||||||
|
|
||||||
extractedData = [];
|
// extractedData = [];
|
||||||
originalData = [];
|
// originalData = [];
|
||||||
filteredData = [];
|
// filteredData = [];
|
||||||
validationArray = [];
|
// validationArray = [];
|
||||||
nonExcelFilteredData = [];
|
// nonExcelFilteredData = [];
|
||||||
print('filteredData');
|
// print('filteredData');
|
||||||
print(filteredData);
|
// print(filteredData);
|
||||||
print(validationArray);
|
// print(validationArray);
|
||||||
|
//
|
||||||
missingColumnErrorMsg = 0;
|
// missingColumnErrorMsg = 0;
|
||||||
print(missingColumnErrorMsg);
|
// print(missingColumnErrorMsg);
|
||||||
columnMissingCount = 0;
|
// columnMissingCount = 0;
|
||||||
print(columnMissingCount);
|
// print(columnMissingCount);
|
||||||
columnIndexMismatchCount = 0;
|
// columnIndexMismatchCount = 0;
|
||||||
print(columnIndexMismatchCount);
|
// print(columnIndexMismatchCount);
|
||||||
invalidRelationships = 0;
|
// invalidRelationships = 0;
|
||||||
dobAgeCheckCount = 0;
|
// dobAgeCheckCount = 0;
|
||||||
|
//
|
||||||
html.window.localStorage.remove('fileBytes');
|
// html.window.localStorage.remove('fileBytes');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -517,7 +559,8 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(),
|
appBar: CustomAppBar(),
|
||||||
body: SafeArea(
|
body: Stack(children: [
|
||||||
|
SafeArea(
|
||||||
child: Theme(
|
child: Theme(
|
||||||
data: ThemeData(
|
data: ThemeData(
|
||||||
canvasColor: Color(0xFFF4F7FE),
|
canvasColor: Color(0xFFF4F7FE),
|
||||||
@ -531,7 +574,8 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
color: Color(0xFFEFF3F6),
|
color: Color(0xFFEFF3F6),
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 1,
|
||||||
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -544,33 +588,39 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
html.window.localStorage.remove('fileBytes');
|
html.window.localStorage
|
||||||
|
.remove('fileBytes');
|
||||||
fileBytes = null;
|
fileBytes = null;
|
||||||
fileName = null;
|
fileName = null;
|
||||||
_currentStep = 0;
|
_currentStep = 0;
|
||||||
missingColumnErrorMsg = 0;
|
excelHeader.clear();
|
||||||
columnIndexMismatchCount = 0;
|
excelData.clear();
|
||||||
columnMissingCount = 0;
|
// missingColumnErrorMsg = 0;
|
||||||
invalidRelationships = 0;
|
// columnIndexMismatchCount = 0;
|
||||||
dobAgeCheckCount = 0;
|
// columnMissingCount = 0;
|
||||||
nonExcelFilteredData = [];
|
// invalidRelationships = 0;
|
||||||
|
// dobAgeCheckCount = 0;
|
||||||
|
// nonExcelFilteredData = [];
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, 'hrPolicyDetails',
|
context, 'hrPolicyDetails',
|
||||||
arguments: argumentsData);
|
arguments: argumentsData);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Close',
|
'Close',
|
||||||
style: TextStyle(color: Color(0xFFE26728)),
|
style:
|
||||||
|
TextStyle(color: Color(0xFFE26728)),
|
||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
side: BorderSide(color: Color(0xFFE26728)),
|
side: BorderSide(
|
||||||
|
color: Color(0xFFE26728)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -611,33 +661,21 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Previous',
|
'Previous',
|
||||||
style: TextStyle(color: Color(0xFFE26728)),
|
style:
|
||||||
|
TextStyle(color: Color(0xFFE26728)),
|
||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius:
|
||||||
side:
|
BorderRadius.circular(5),
|
||||||
BorderSide(color: Color(0xFFE26728)),
|
side: BorderSide(
|
||||||
|
color: Color(0xFFE26728)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
if (_currentStep != 2)
|
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _currentStep == 0
|
|
||||||
? (fileName != null
|
|
||||||
? controls.onStepContinue!
|
|
||||||
: null)
|
|
||||||
: (_currentStep == 1
|
|
||||||
? (missingColumnErrorMsg == 0 &&
|
|
||||||
columnIndexMismatchCount ==
|
|
||||||
0 &&
|
|
||||||
invalidRelationships == 0 &&
|
|
||||||
dobAgeCheckCount == 0
|
|
||||||
? controls.onStepContinue!
|
|
||||||
: null)
|
|
||||||
: null),
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'NEXT',
|
'NEXT',
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
@ -648,24 +686,48 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Disable button if excelValidationStatus is 1
|
||||||
|
// Use ternary operator to conditionally set onPressed to null
|
||||||
|
onPressed: (_currentStep == 0 &&
|
||||||
|
fileName == null) ||
|
||||||
|
(_currentStep == 1 &&
|
||||||
|
excelValidationStaus == 1)
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
if (_currentStep == 0) {
|
||||||
|
// For Step 0: Enable continue if fileName is not null
|
||||||
|
if (fileName != null) {
|
||||||
|
controls.onStepContinue!();
|
||||||
|
}
|
||||||
|
} else if (_currentStep == 1) {
|
||||||
|
// For Step 1: Check excelValidationStatus
|
||||||
|
if (excelValidationStaus == 0) {
|
||||||
|
// Navigate to hrPolicyDetails page
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, 'hrPolicyDetails',
|
||||||
|
arguments: argumentsData);
|
||||||
|
}
|
||||||
|
// If excelValidationStatus is 1, button will be disabled (do nothing)
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
if (_currentStep == 2)
|
// if (_currentStep == 2)
|
||||||
ElevatedButton(
|
// ElevatedButton(
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
_retrieveAndUploadFile();
|
// _retrieveAndUploadFile();
|
||||||
},
|
// },
|
||||||
child: Text(
|
// child: Text(
|
||||||
'Submit',
|
// 'Submit',
|
||||||
style: TextStyle(color: Colors.white),
|
// style: TextStyle(color: Colors.white),
|
||||||
),
|
// ),
|
||||||
style: ElevatedButton.styleFrom(
|
// style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Color(0xFFE26728),
|
// backgroundColor: Color(0xFFE26728),
|
||||||
shape: RoundedRectangleBorder(
|
// shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
// borderRadius: BorderRadius.circular(5),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -757,19 +819,24 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
height:
|
height:
|
||||||
250, // Adjust height as needed
|
250, // Adjust height as needed
|
||||||
child: DragTarget(
|
child: DragTarget(
|
||||||
onAccept:
|
onAccept: (html.File
|
||||||
(html.File droppedFile) {
|
droppedFile) {
|
||||||
setState(() {
|
setState(() {
|
||||||
fileName = droppedFile.name;
|
fileName =
|
||||||
|
droppedFile.name;
|
||||||
});
|
});
|
||||||
_dragAndDropFile(droppedFile);
|
_dragAndDropFile(
|
||||||
|
droppedFile);
|
||||||
},
|
},
|
||||||
builder: (BuildContext context,
|
builder:
|
||||||
List<String?> candidateData,
|
(BuildContext context,
|
||||||
|
List<String?>
|
||||||
|
candidateData,
|
||||||
List<dynamic>
|
List<dynamic>
|
||||||
rejectedData) {
|
rejectedData) {
|
||||||
return Container(
|
return Container(
|
||||||
alignment: Alignment.center,
|
alignment:
|
||||||
|
Alignment.center,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment
|
MainAxisAlignment
|
||||||
@ -812,7 +879,8 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
Icon(
|
Icon(
|
||||||
Icons
|
Icons
|
||||||
.upload_file, // Choose the appropriate icon
|
.upload_file, // Choose the appropriate icon
|
||||||
size: 35,
|
size:
|
||||||
|
35,
|
||||||
color: Color(
|
color: Color(
|
||||||
0xFFE26728), // Adjust the size as needed
|
0xFFE26728), // Adjust the size as needed
|
||||||
),
|
),
|
||||||
@ -829,8 +897,8 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
height:
|
height:
|
||||||
25), // Add some space between the icon and text
|
25), // Add some space between the icon and text
|
||||||
MouseRegion(
|
MouseRegion(
|
||||||
cursor: SystemMouseCursors
|
cursor:
|
||||||
.click, // Set cursor to pointer on hover
|
SystemMouseCursors.click, // Set cursor to pointer on hover
|
||||||
child:
|
child:
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap:
|
onTap:
|
||||||
@ -844,17 +912,13 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.delete_forever, // Choose the remove icon
|
Icons.delete_forever, // Choose the remove icon
|
||||||
size:
|
size: 20, // Adjust the size as needed
|
||||||
20, // Adjust the size as needed
|
color: Colors.red, // Set the color of the remove icon
|
||||||
color:
|
|
||||||
Colors.red, // Set the color of the remove icon
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(width: 1), // Add some space between the icon and text
|
||||||
width: 1), // Add some space between the icon and text
|
|
||||||
Text(
|
Text(
|
||||||
'Remove',
|
'Remove',
|
||||||
style:
|
style: TextStyle(fontSize: 13, color: Color(0xFF727272)),
|
||||||
TextStyle(fontSize: 13, color: Color(0xFF727272)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -869,8 +933,8 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Select File',
|
'Select File',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors
|
color:
|
||||||
.white),
|
Colors.white),
|
||||||
),
|
),
|
||||||
style: ElevatedButton
|
style: ElevatedButton
|
||||||
.styleFrom(
|
.styleFrom(
|
||||||
@ -879,8 +943,10 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
0xFFE26728),
|
0xFFE26728),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(
|
||||||
if (fileName == null)
|
height: 20),
|
||||||
|
if (fileName ==
|
||||||
|
null)
|
||||||
Text(
|
Text(
|
||||||
'Supported Files : XLSX')
|
'Supported Files : XLSX')
|
||||||
// Add more Text widgets for additional lines of text
|
// Add more Text widgets for additional lines of text
|
||||||
@ -900,19 +966,21 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment
|
||||||
|
.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Ensure that the import file is in the correct format by comparing it with our template file.',
|
'Ensure that the import file is in the correct format by comparing it with our template file.',
|
||||||
textAlign: TextAlign.center,
|
textAlign:
|
||||||
|
TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight.w400,
|
FontWeight.w400,
|
||||||
)),
|
)),
|
||||||
MouseRegion(
|
MouseRegion(
|
||||||
cursor:
|
cursor: SystemMouseCursors
|
||||||
SystemMouseCursors.click,
|
.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
downloadSampleFile();
|
downloadSampleFile();
|
||||||
@ -943,131 +1011,158 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
'Excel Validation',
|
'Excel Validation',
|
||||||
style: TextStyle(color: Color(0xFFE26728)),
|
style: TextStyle(color: Color(0xFFE26728)),
|
||||||
),
|
),
|
||||||
content: Padding(
|
content: isSuccess
|
||||||
padding: EdgeInsets.only(
|
? Center(
|
||||||
top: 30,
|
child: Text(
|
||||||
bottom: 30,
|
successContent,
|
||||||
left: 300,
|
style: TextStyle(
|
||||||
right:
|
fontSize: 20, color: Colors.green),
|
||||||
300), // Adjust the horizontal padding as needed
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
_buildRowWithIcon(
|
|
||||||
missingColumnErrorMsg == 0
|
|
||||||
? Icons.check_circle
|
|
||||||
: Icons.error,
|
|
||||||
'No of column missing : $missingColumnErrorMsg Column',
|
|
||||||
iconColor: missingColumnErrorMsg == 0
|
|
||||||
? Colors.green
|
|
||||||
: Colors
|
|
||||||
.red, // Set color based on condition
|
|
||||||
),
|
|
||||||
if (missingColumnErrorMsg == 0)
|
|
||||||
_buildRowWithIcon(
|
|
||||||
columnIndexMismatchCount == 0
|
|
||||||
? Icons.check_circle
|
|
||||||
: Icons.error,
|
|
||||||
'Mismatch in Column Order : $columnIndexMismatchCount - Column',
|
|
||||||
iconColor: columnIndexMismatchCount == 0
|
|
||||||
? Colors.green
|
|
||||||
: Colors.red,
|
|
||||||
),
|
|
||||||
_buildRowWithIcon(
|
|
||||||
invalidRelationships == 0
|
|
||||||
? Icons.check_circle
|
|
||||||
: Icons.error,
|
|
||||||
'Invalid Relationships : $invalidRelationships - Rows',
|
|
||||||
iconColor: invalidRelationships == 0
|
|
||||||
? Colors.green
|
|
||||||
: Colors.red,
|
|
||||||
),
|
|
||||||
_buildRowWithIcon(
|
|
||||||
dobAgeCheckCount == 0
|
|
||||||
? Icons.check_circle
|
|
||||||
: Icons.error,
|
|
||||||
'Age Config - $dobAgeCheckCount - Rows',
|
|
||||||
iconColor: dobAgeCheckCount == 0
|
|
||||||
? Colors.green
|
|
||||||
: Colors.red,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
isActive: _currentStep == 1,
|
|
||||||
),
|
|
||||||
Step(
|
|
||||||
title: Text(
|
|
||||||
'Preview',
|
|
||||||
style: TextStyle(color: Color(0xFFE26728)),
|
|
||||||
),
|
|
||||||
content: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 10,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Container(
|
|
||||||
width:
|
|
||||||
350, // Set your desired width here
|
|
||||||
height:
|
|
||||||
40, // Set your desired height here
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color.fromRGBO(
|
|
||||||
255,
|
|
||||||
255,
|
|
||||||
255,
|
|
||||||
0.5), // Shadow color with opacity
|
|
||||||
offset: Offset(5,
|
|
||||||
5), // Shadow position (horizontal, vertical)
|
|
||||||
blurRadius: 10, // Blur radius
|
|
||||||
spreadRadius:
|
|
||||||
0, // Spread radius
|
|
||||||
),
|
|
||||||
],
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(5),
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
textAlignVertical: TextAlignVertical
|
|
||||||
.center, // Center the text vertically
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: 'Search',
|
|
||||||
suffixIcon: Icon(Icons.search),
|
|
||||||
contentPadding: EdgeInsets.all(
|
|
||||||
10), // Adjust the horizontal padding
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(
|
|
||||||
0xFFf5f5f7)), // Set border color to gray
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onChanged:
|
|
||||||
search, // Call the search method on text change
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: _buildDataTable(),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
: excelHeader.isNotEmpty &&
|
||||||
|
excelData.isNotEmpty
|
||||||
|
? SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: DataTable(
|
||||||
|
columns: excelHeader
|
||||||
|
.map((header) => DataColumn(
|
||||||
|
label: Text(header)))
|
||||||
|
.toList(),
|
||||||
|
rows: excelData
|
||||||
|
.map((row) => DataRow(
|
||||||
|
cells: row
|
||||||
|
.map(
|
||||||
|
(cell) =>
|
||||||
|
DataCell(
|
||||||
|
cell.containsKey(
|
||||||
|
'error')
|
||||||
|
? Row(
|
||||||
|
children: [
|
||||||
|
Text(cell['value'] ?? ''),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.error_outline,
|
||||||
|
color: Colors.red,
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
title: Text('Error Details'),
|
||||||
|
content: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: (cell['error'] as List).map((e) => Text(e)).toList(),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Text('OK'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
isActive: _currentStep == 2,
|
],
|
||||||
|
)
|
||||||
|
: Text(cell['value'] ??
|
||||||
|
''),
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Center(
|
||||||
|
child: CircularProgressIndicator()),
|
||||||
|
isActive: _currentStep == 1,
|
||||||
|
),
|
||||||
|
// Step(
|
||||||
|
// title: Text(
|
||||||
|
// 'Preview',
|
||||||
|
// style: TextStyle(color: Color(0xFFE26728)),
|
||||||
|
// ),
|
||||||
|
// content: Column(
|
||||||
|
// children: [
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// flex: 10,
|
||||||
|
// child: Container(
|
||||||
|
// alignment: Alignment.centerLeft,
|
||||||
|
// child: Container(
|
||||||
|
// width:
|
||||||
|
// 350, // Set your desired width here
|
||||||
|
// height:
|
||||||
|
// 40, // Set your desired height here
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// boxShadow: [
|
||||||
|
// BoxShadow(
|
||||||
|
// color: Color.fromRGBO(
|
||||||
|
// 255,
|
||||||
|
// 255,
|
||||||
|
// 255,
|
||||||
|
// 0.5), // Shadow color with opacity
|
||||||
|
// offset: Offset(5,
|
||||||
|
// 5), // Shadow position (horizontal, vertical)
|
||||||
|
// blurRadius: 10, // Blur radius
|
||||||
|
// spreadRadius:
|
||||||
|
// 0, // Spread radius
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// borderRadius:
|
||||||
|
// BorderRadius.circular(5),
|
||||||
|
// ),
|
||||||
|
// child: TextField(
|
||||||
|
// textAlignVertical: TextAlignVertical
|
||||||
|
// .center, // Center the text vertically
|
||||||
|
// decoration: InputDecoration(
|
||||||
|
// hintText: 'Search',
|
||||||
|
// suffixIcon: Icon(Icons.search),
|
||||||
|
// contentPadding: EdgeInsets.all(
|
||||||
|
// 10), // Adjust the horizontal padding
|
||||||
|
// border: OutlineInputBorder(
|
||||||
|
// borderSide: BorderSide(
|
||||||
|
// color: Color(
|
||||||
|
// 0xFFf5f5f7)), // Set border color to gray
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// onChanged:
|
||||||
|
// search, // Call the search method on text change
|
||||||
|
// ),
|
||||||
|
// )),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 20),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// child: SingleChildScrollView(
|
||||||
|
// child: _buildDataTable(),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// isActive: _currentStep == 2,
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1095,7 +1190,25 @@ class _excelVerifyState extends State<excelVerify> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDataTable() {
|
Widget _buildDataTable() {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import 'package:nhancepolicy/service/api_service.dart';
|
|||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'customAppBar/customAppBar.dart';
|
import 'customAppBar/customAppBar.dart';
|
||||||
|
import 'customAppBar/customFooter.dart';
|
||||||
import 'customAppBar/toastHelper.dart';
|
import 'customAppBar/toastHelper.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
@ -24,10 +25,10 @@ class hrDashboard extends StatefulWidget {
|
|||||||
|
|
||||||
class _hrDashboardState extends State<hrDashboard> {
|
class _hrDashboardState extends State<hrDashboard> {
|
||||||
late ApiService apiService;
|
late ApiService apiService;
|
||||||
bool isLoading = true;
|
bool isLoading = false;
|
||||||
late String _token;
|
late String _token;
|
||||||
dynamic getPolicyNo;
|
dynamic getPolicyNo;
|
||||||
bool _isLoading = false;
|
// bool _isLoading = false;
|
||||||
dynamic getPolicyNameDetails;
|
dynamic getPolicyNameDetails;
|
||||||
dynamic clintID;
|
dynamic clintID;
|
||||||
dynamic policy_name;
|
dynamic policy_name;
|
||||||
@ -41,17 +42,18 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
Color(0xFFDBFFDE),
|
Color(0xFFDBFFDE),
|
||||||
Color(0xFFE4DFFF),
|
Color(0xFFE4DFFF),
|
||||||
];
|
];
|
||||||
|
ScrollController _scrollController = ScrollController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
apiService = ApiService(context); // Initialize ApiService here
|
apiService = ApiService(context); // Initialize ApiService here
|
||||||
_loadToken();
|
_loadToken();
|
||||||
Future.delayed(Duration(seconds: 3), () {
|
// Future.delayed(Duration(seconds: 3), () {
|
||||||
setState(() {
|
// setState(() {
|
||||||
isLoading = false;
|
// isLoading = false;
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -134,9 +136,10 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getCashDepositDetails(String clintID) async {
|
Future<void> getCashDepositDetails(String clintID) async {
|
||||||
setState(() {
|
isLoading = true;
|
||||||
_isLoading = true;
|
// setState(() {
|
||||||
});
|
// _isLoading = true;
|
||||||
|
// });
|
||||||
try {
|
try {
|
||||||
if (clintID == null || empRefId == null) {
|
if (clintID == null || empRefId == null) {
|
||||||
return;
|
return;
|
||||||
@ -144,6 +147,7 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
final response =
|
final response =
|
||||||
await apiService.getCashDepositDetailsToApi(clintID!, empRefId!);
|
await apiService.getCashDepositDetailsToApi(clintID!, empRefId!);
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
|
isLoading = false;
|
||||||
setState(() {
|
setState(() {
|
||||||
getCardArrays = List<Map<String, dynamic>>.from(response['data']);
|
getCardArrays = List<Map<String, dynamic>>.from(response['data']);
|
||||||
print(getCardArrays);
|
print(getCardArrays);
|
||||||
@ -223,12 +227,13 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(top: 30, bottom: 30, left: 50, right: 50),
|
EdgeInsets.only(top: 30, bottom: 200, left: 50, right: 50),
|
||||||
color: Color(0xFFEFF3F6),
|
color: Color(0xFFEFF3F6),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 75,
|
height: 75,
|
||||||
@ -298,117 +303,119 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
|
// if (getCardArrays.length != 0)
|
||||||
|
// Card(
|
||||||
|
// elevation: 0,
|
||||||
|
// color: Colors.white,
|
||||||
|
// child: Container(
|
||||||
|
// width: double.infinity,
|
||||||
|
// padding: Responsive.isDesktop(context)
|
||||||
|
// ? EdgeInsets.all(20)
|
||||||
|
// : EdgeInsets.all(
|
||||||
|
// 10), // Add padding to the container
|
||||||
|
// child: Column(children: [
|
||||||
|
// Row(children: [
|
||||||
|
// Text(
|
||||||
|
// 'Cash Transaction',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// fontSize: 18,
|
||||||
|
// fontWeight: FontWeight.w600,
|
||||||
|
// color: Colors.black,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// ]),
|
||||||
|
// SizedBox(height: 8),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// // Create an Expanded widget with flex of 4 for each card
|
||||||
|
// for (var cardData in getCardArrays)
|
||||||
|
// Container(
|
||||||
|
// width:
|
||||||
|
// 300, // Set a fixed width for the card
|
||||||
|
// height: cardHeight,
|
||||||
|
// child: Card(
|
||||||
|
// elevation: 3,
|
||||||
|
// color: cardColors[
|
||||||
|
// getCardArrays.indexOf(cardData) %
|
||||||
|
// cardColors.length],
|
||||||
|
// child: Column(
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// ListTile(
|
||||||
|
// title: SizedBox(
|
||||||
|
// height: 50,
|
||||||
|
// child: Text(
|
||||||
|
// cardData['insurerName'],
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// fontSize: 18,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// color: Color(0xFF000000),
|
||||||
|
// height: 1.5,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// subtitle: Text(
|
||||||
|
// 'Balance: ₹ ${cardData['balance']}',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// fontSize: 16,
|
||||||
|
// fontWeight: FontWeight.w400,
|
||||||
|
// color: Color(0xFF000000),
|
||||||
|
// height: 1.5,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 10),
|
||||||
|
// Padding(
|
||||||
|
// padding: EdgeInsets.symmetric(
|
||||||
|
// horizontal: 15),
|
||||||
|
// child: GestureDetector(
|
||||||
|
// onTap: () {
|
||||||
|
// openForm(
|
||||||
|
// cardData['depositData'],
|
||||||
|
// cardData['insurerName'],
|
||||||
|
// cardData['clientId'],
|
||||||
|
// cardData['insurerId'],
|
||||||
|
// cardColors[getCardArrays
|
||||||
|
// .indexOf(cardData) %
|
||||||
|
// cardColors.length],
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// child: MouseRegion(
|
||||||
|
// cursor:
|
||||||
|
// SystemMouseCursors.click,
|
||||||
|
// child: Align(
|
||||||
|
// alignment:
|
||||||
|
// Alignment.centerRight,
|
||||||
|
// child: Text(
|
||||||
|
// 'View Details',
|
||||||
|
// style:
|
||||||
|
// GoogleFonts.poppins(
|
||||||
|
// color:
|
||||||
|
// Color(0xFF000000),
|
||||||
|
// fontSize: 14,
|
||||||
|
// fontWeight:
|
||||||
|
// FontWeight.w300,
|
||||||
|
// height: 1.5,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ])),
|
||||||
|
// ),
|
||||||
|
// SizedBox(height: 16),
|
||||||
if (getCardArrays.length != 0)
|
if (getCardArrays.length != 0)
|
||||||
Card(
|
Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
child: Container(
|
color: Colors.white,
|
||||||
width: double.infinity,
|
|
||||||
padding: Responsive.isDesktop(context)
|
|
||||||
? EdgeInsets.all(20)
|
|
||||||
: EdgeInsets.all(
|
|
||||||
10), // Add padding to the container
|
|
||||||
child: Column(children: [
|
|
||||||
Row(children: [
|
|
||||||
Text(
|
|
||||||
'Cash Transaction',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
SizedBox(height: 8),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
// Create an Expanded widget with flex of 4 for each card
|
|
||||||
for (var cardData in getCardArrays)
|
|
||||||
Container(
|
|
||||||
width:
|
|
||||||
300, // Set a fixed width for the card
|
|
||||||
height: cardHeight,
|
|
||||||
child: Card(
|
|
||||||
elevation: 3,
|
|
||||||
color: cardColors[
|
|
||||||
getCardArrays.indexOf(cardData) %
|
|
||||||
cardColors.length],
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
ListTile(
|
|
||||||
title: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Text(
|
|
||||||
cardData['insurerName'],
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Color(0xFF000000),
|
|
||||||
height: 1.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
'Balance: ₹ ${cardData['balance']}',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Color(0xFF000000),
|
|
||||||
height: 1.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 10),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 15),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
openForm(
|
|
||||||
cardData['depositData'],
|
|
||||||
cardData['insurerName'],
|
|
||||||
cardData['clientId'],
|
|
||||||
cardData['insurerId'],
|
|
||||||
cardColors[getCardArrays
|
|
||||||
.indexOf(cardData) %
|
|
||||||
cardColors.length],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: MouseRegion(
|
|
||||||
cursor:
|
|
||||||
SystemMouseCursors.click,
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
Alignment.centerRight,
|
|
||||||
child: Text(
|
|
||||||
'View Details',
|
|
||||||
style:
|
|
||||||
GoogleFonts.poppins(
|
|
||||||
color:
|
|
||||||
Color(0xFF000000),
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight:
|
|
||||||
FontWeight.w300,
|
|
||||||
height: 1.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
])),
|
|
||||||
),
|
|
||||||
SizedBox(height: 16),
|
|
||||||
if (getCardArrays.length != 0)
|
|
||||||
Card(
|
|
||||||
elevation: 0,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.all(20)
|
? EdgeInsets.all(20)
|
||||||
@ -424,8 +431,7 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
children: List.generate(
|
children: List.generate(
|
||||||
numExpanded,
|
numExpanded,
|
||||||
(index) {
|
(index) {
|
||||||
var insurerName =
|
var insurerName = getCardArrays[index]
|
||||||
getCardArrays[index]
|
|
||||||
['insurerName'];
|
['insurerName'];
|
||||||
var policyDetails =
|
var policyDetails =
|
||||||
getCardArrays[index]
|
getCardArrays[index]
|
||||||
@ -452,20 +458,42 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon:
|
||||||
|
Icon(Icons.arrow_back),
|
||||||
|
onPressed: () {
|
||||||
|
_scrollController
|
||||||
|
.animateTo(
|
||||||
|
_scrollController
|
||||||
|
.offset -
|
||||||
|
300,
|
||||||
|
duration: Duration(
|
||||||
|
milliseconds: 500),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child:
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
scrollDirection:
|
scrollDirection:
|
||||||
Axis.horizontal,
|
Axis.horizontal,
|
||||||
controller:
|
controller:
|
||||||
ScrollController(), // Adding ScrollController
|
_scrollController,
|
||||||
dragStartBehavior:
|
dragStartBehavior:
|
||||||
DragStartBehavior.start,
|
DragStartBehavior
|
||||||
|
.start,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
policyDetails.length,
|
policyDetails.length,
|
||||||
(index) => Container(
|
(index) => Container(
|
||||||
width: 300,
|
width: 300,
|
||||||
height: policyHeight,
|
height:
|
||||||
child: GestureDetector(
|
policyHeight,
|
||||||
|
child:
|
||||||
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context,
|
context,
|
||||||
@ -474,14 +502,15 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
policyDetails[
|
policyDetails[
|
||||||
index]);
|
index]);
|
||||||
},
|
},
|
||||||
child: MouseRegion(
|
child:
|
||||||
|
MouseRegion(
|
||||||
cursor:
|
cursor:
|
||||||
SystemMouseCursors
|
SystemMouseCursors
|
||||||
.click,
|
.click,
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
color:
|
color:
|
||||||
cardColor, // Use the determined color
|
cardColor,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment
|
CrossAxisAlignment
|
||||||
@ -495,19 +524,15 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
child:
|
child:
|
||||||
Text(
|
Text(
|
||||||
'${policyDetails[index]['policy_name']} - (${policyDetails[index]['type']})',
|
'${policyDetails[index]['policy_name']} - (${policyDetails[index]['type']})',
|
||||||
style: GoogleFonts
|
style:
|
||||||
.poppins(
|
GoogleFonts.poppins(
|
||||||
fontSize:
|
fontSize: 16,
|
||||||
16,
|
fontWeight: FontWeight.w500,
|
||||||
fontWeight:
|
color: Color(0xFF000000),
|
||||||
FontWeight.w500,
|
height: 1.5,
|
||||||
color:
|
|
||||||
Color(0xFF000000),
|
|
||||||
height:
|
|
||||||
1.5,
|
|
||||||
),
|
),
|
||||||
softWrap:
|
softWrap:
|
||||||
true, // Allow text to wrap to the next line if needed
|
true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -520,15 +545,13 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
15,
|
15,
|
||||||
right:
|
right:
|
||||||
15),
|
15),
|
||||||
child: Row(
|
child:
|
||||||
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex:
|
flex: 4,
|
||||||
4,
|
child: Column(
|
||||||
child:
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Draft',
|
'Draft',
|
||||||
@ -552,12 +575,9 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex:
|
flex: 4,
|
||||||
4,
|
child: Column(
|
||||||
child:
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Enrolled',
|
'Enrolled',
|
||||||
@ -581,12 +601,9 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex:
|
flex: 4,
|
||||||
4,
|
child: Column(
|
||||||
child:
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Total',
|
'Total',
|
||||||
@ -610,8 +627,8 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
), // Adjust the horizontal padding as needed
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -621,6 +638,24 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.arrow_forward),
|
||||||
|
onPressed: () {
|
||||||
|
_scrollController
|
||||||
|
.animateTo(
|
||||||
|
_scrollController
|
||||||
|
.offset +
|
||||||
|
300,
|
||||||
|
duration: Duration(
|
||||||
|
milliseconds: 500),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -629,17 +664,18 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
))
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: Color(0xFFFFFCE5), // Semi-transparent background
|
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||||
child: Center(
|
child: Center(
|
||||||
child: // Your GIF loader widget
|
child: // Your GIF loader widget
|
||||||
Image.asset(
|
Image.asset(
|
||||||
@ -648,6 +684,13 @@ class _hrDashboardState extends State<hrDashboard> {
|
|||||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
'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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,7 +267,7 @@ class _MyPhoneState extends State<MyHrLogin> {
|
|||||||
return Image.asset(
|
return Image.asset(
|
||||||
'assets/hrLogin.jpg',
|
'assets/hrLogin.jpg',
|
||||||
height: _size.height,
|
height: _size.height,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.cover,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
@ -327,23 +327,23 @@ class _MyPhoneState extends State<MyHrLogin> {
|
|||||||
flex: 8,
|
flex: 8,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment
|
alignment: Alignment
|
||||||
.centerRight, // Align to the start
|
.topRight, // Align to the start
|
||||||
child: _size.width <= 1100
|
child: _size.width <= 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final-mobile.png',
|
'assets/Nhance-Logo-Final-mobile.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: _size.width > 1100
|
: _size.width > 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: Image.asset(
|
: Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
@ -598,7 +598,12 @@ class _MyPhoneState extends State<MyHrLogin> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: _size.height * 0.1,
|
height: _size.height * 0.1,
|
||||||
),
|
),
|
||||||
Container(
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
width: double
|
||||||
|
.infinity, // Make the footer full width
|
||||||
|
child: Container(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(vertical: 8),
|
EdgeInsets.symmetric(vertical: 8),
|
||||||
@ -607,28 +612,28 @@ class _MyPhoneState extends State<MyHrLogin> {
|
|||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text:
|
text:
|
||||||
'By continuing, you agree with our ',
|
'By continuing, you agree with our ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'privacy policy ',
|
text: 'privacy policy ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Color(0xFF00989E),
|
color: Color(0xFF00989E),
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'and ',
|
text: 'and ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'terms of use',
|
text: 'terms of use',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Color(0xFF00989E),
|
color: Color(0xFF00989E),
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
@ -637,6 +642,8 @@ class _MyPhoneState extends State<MyHrLogin> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -19,6 +19,8 @@ import 'package:excel/excel.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 'customAppBar/customFooter.dart';
|
||||||
|
|
||||||
class hrPolicyDetails extends StatefulWidget {
|
class hrPolicyDetails extends StatefulWidget {
|
||||||
const hrPolicyDetails({Key? key}) : super(key: key);
|
const hrPolicyDetails({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@ -31,6 +33,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
Uint8List? fileBytes;
|
Uint8List? fileBytes;
|
||||||
late String _token;
|
late String _token;
|
||||||
List<Map<String, dynamic>> getEmpDependenceByClintId = [];
|
List<Map<String, dynamic>> getEmpDependenceByClintId = [];
|
||||||
|
bool isLoading = false;
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
// dynamic clintID;
|
// dynamic clintID;
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
@ -133,6 +136,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getEmployeeAndDependence(clintID, getPolicyNo) async {
|
Future<void> getEmployeeAndDependence(clintID, getPolicyNo) async {
|
||||||
|
isLoading = true;
|
||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
@ -140,6 +144,7 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
final response = await apiService.getEmployeeAndDependenceToApi(
|
final response = await apiService.getEmployeeAndDependenceToApi(
|
||||||
clintID!, getPolicyNo!, empRefId!);
|
clintID!, getPolicyNo!, empRefId!);
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
|
isLoading = false;
|
||||||
setState(() {
|
setState(() {
|
||||||
getEmpDependenceByClintId =
|
getEmpDependenceByClintId =
|
||||||
List<Map<String, dynamic>>.from(response['data']);
|
List<Map<String, dynamic>>.from(response['data']);
|
||||||
@ -293,7 +298,8 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
if (filteredData == []) {
|
if (filteredData == []) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(),
|
appBar: CustomAppBar(),
|
||||||
body: SingleChildScrollView(
|
body: Stack(children: [
|
||||||
|
SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Color(0xFFEFF3F6),
|
color: Color(0xFFEFF3F6),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -304,15 +310,36 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
|
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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
} else {
|
} else {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(),
|
appBar: CustomAppBar(),
|
||||||
body: Container(
|
body: Stack(children: [
|
||||||
|
Container(
|
||||||
padding: const EdgeInsets.all(20),
|
padding: const EdgeInsets.all(20),
|
||||||
color: Color(0xFFEFF3F6),
|
color: Color(0xFFEFF3F6),
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
color: Colors.white,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -341,223 +368,8 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
'$policyName - ($policyType)',
|
'$policyName - ($policyType)',
|
||||||
textAlign: TextAlign
|
textAlign: TextAlign
|
||||||
.center, // Align text to the center
|
.center, // Align text to the center
|
||||||
style: GoogleFonts.poppins(
|
style:
|
||||||
fontSize: 16,
|
GoogleFonts.poppins(
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 6,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment
|
|
||||||
.centerRight, // Align text to the center
|
|
||||||
child: MouseRegion(
|
|
||||||
cursor:
|
|
||||||
SystemMouseCursors.click,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
context,
|
|
||||||
'hrDashboard');
|
|
||||||
},
|
|
||||||
child: Icon(
|
|
||||||
Icons
|
|
||||||
.close, // Replace with your desired icon
|
|
||||||
color: Colors
|
|
||||||
.white, // Replace with your desired icon color
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: (policyType == 'GPA' ||
|
|
||||||
policyType == 'GMC')
|
|
||||||
? 8
|
|
||||||
: 10,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Container(
|
|
||||||
width:
|
|
||||||
350, // Set your desired width here
|
|
||||||
height:
|
|
||||||
40, // Set your desired height here
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color.fromRGBO(
|
|
||||||
255,
|
|
||||||
255,
|
|
||||||
255,
|
|
||||||
0.5), // Shadow color with opacity
|
|
||||||
offset: Offset(5,
|
|
||||||
5), // Shadow position (horizontal, vertical)
|
|
||||||
blurRadius:
|
|
||||||
10, // Blur radius
|
|
||||||
spreadRadius:
|
|
||||||
0, // Spread radius
|
|
||||||
),
|
|
||||||
],
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(
|
|
||||||
5),
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
textAlignVertical:
|
|
||||||
TextAlignVertical
|
|
||||||
.center, // Center the text vertically
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: 'Search',
|
|
||||||
suffixIcon:
|
|
||||||
Icon(Icons.search),
|
|
||||||
contentPadding:
|
|
||||||
EdgeInsets.all(
|
|
||||||
10), // Adjust the horizontal padding
|
|
||||||
border:
|
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(
|
|
||||||
0xFFf5f5f7)), // Set border color to gray
|
|
||||||
),
|
|
||||||
),
|
|
||||||
controller:
|
|
||||||
searchController,
|
|
||||||
onChanged:
|
|
||||||
search, // Call the search method on text change
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () =>
|
|
||||||
{downloadExcel()},
|
|
||||||
child: Text(
|
|
||||||
'Export',
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
Colors.white),
|
|
||||||
),
|
|
||||||
style: ElevatedButton
|
|
||||||
.styleFrom(
|
|
||||||
backgroundColor:
|
|
||||||
Color(0xFFE26728),
|
|
||||||
shape:
|
|
||||||
RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius
|
|
||||||
.circular(5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: (policyType == 'GPA' ||
|
|
||||||
policyType == 'GMC')
|
|
||||||
? 5
|
|
||||||
: 0),
|
|
||||||
if ((policyType == 'GPA' ||
|
|
||||||
policyType == 'GMC') &&
|
|
||||||
inceptionType == 2)
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Container(
|
|
||||||
alignment:
|
|
||||||
Alignment.centerRight,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () =>
|
|
||||||
_uploadFile(
|
|
||||||
policyType),
|
|
||||||
child: Text(
|
|
||||||
'Import Data',
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
Colors.white),
|
|
||||||
),
|
|
||||||
style: ElevatedButton
|
|
||||||
.styleFrom(
|
|
||||||
backgroundColor:
|
|
||||||
Color(0xFFE26728),
|
|
||||||
shape:
|
|
||||||
RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius
|
|
||||||
.circular(
|
|
||||||
5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child:
|
|
||||||
_buildDataTableGPA(context),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
))
|
|
||||||
: Container(
|
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(
|
|
||||||
10), // Set your desired padding
|
|
||||||
color: Color(
|
|
||||||
0xFFE26728), // Set your desired background color
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 6,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment
|
|
||||||
.centerLeft, // Align text to the center
|
|
||||||
child: Text(
|
|
||||||
(policyName != null &&
|
|
||||||
policyType != null)
|
|
||||||
? '$policyName - ($policyType)'
|
|
||||||
: '',
|
|
||||||
textAlign: TextAlign
|
|
||||||
.center, // Align text to the center
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight.w500,
|
FontWeight.w500,
|
||||||
@ -593,6 +405,236 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: (policyType == 'GPA' ||
|
||||||
|
policyType == 'GMC')
|
||||||
|
? 8
|
||||||
|
: 10,
|
||||||
|
child: Container(
|
||||||
|
alignment:
|
||||||
|
Alignment.centerLeft,
|
||||||
|
child: Container(
|
||||||
|
width:
|
||||||
|
350, // Set your desired width here
|
||||||
|
height:
|
||||||
|
40, // Set your desired height here
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Color.fromRGBO(
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
0.5), // Shadow color with opacity
|
||||||
|
offset: Offset(5,
|
||||||
|
5), // Shadow position (horizontal, vertical)
|
||||||
|
blurRadius:
|
||||||
|
10, // Blur radius
|
||||||
|
spreadRadius:
|
||||||
|
0, // Spread radius
|
||||||
|
),
|
||||||
|
],
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(5),
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
textAlignVertical:
|
||||||
|
TextAlignVertical
|
||||||
|
.center, // Center the text vertically
|
||||||
|
decoration:
|
||||||
|
InputDecoration(
|
||||||
|
hintText: 'Search',
|
||||||
|
suffixIcon: Icon(
|
||||||
|
Icons.search),
|
||||||
|
contentPadding:
|
||||||
|
EdgeInsets.all(
|
||||||
|
10), // Adjust the horizontal padding
|
||||||
|
border:
|
||||||
|
OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(
|
||||||
|
0xFFf5f5f7)), // Set border color to gray
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller:
|
||||||
|
searchController,
|
||||||
|
onChanged:
|
||||||
|
search, // Call the search method on text change
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Container(
|
||||||
|
alignment:
|
||||||
|
Alignment.centerRight,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.center,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () =>
|
||||||
|
{downloadExcel()},
|
||||||
|
child: Text(
|
||||||
|
'Export',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.white),
|
||||||
|
),
|
||||||
|
style: ElevatedButton
|
||||||
|
.styleFrom(
|
||||||
|
backgroundColor:
|
||||||
|
Color(
|
||||||
|
0xFFE26728),
|
||||||
|
shape:
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: (policyType == 'GPA' ||
|
||||||
|
policyType == 'GMC')
|
||||||
|
? 5
|
||||||
|
: 0),
|
||||||
|
if ((policyType == 'GPA' ||
|
||||||
|
policyType == 'GMC') &&
|
||||||
|
inceptionType == 2)
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Container(
|
||||||
|
alignment:
|
||||||
|
Alignment.centerRight,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.center,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () =>
|
||||||
|
_uploadFile(
|
||||||
|
policyType),
|
||||||
|
child: Text(
|
||||||
|
'Import Data',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.white),
|
||||||
|
),
|
||||||
|
style:
|
||||||
|
ElevatedButton
|
||||||
|
.styleFrom(
|
||||||
|
backgroundColor:
|
||||||
|
Color(
|
||||||
|
0xFFE26728),
|
||||||
|
shape:
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: _buildDataTableGPA(
|
||||||
|
context),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
: Container(
|
||||||
|
height:
|
||||||
|
MediaQuery.of(context).size.height,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(
|
||||||
|
10), // Set your desired padding
|
||||||
|
color: Color(
|
||||||
|
0xFFE26728), // Set your desired background color
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 6,
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment
|
||||||
|
.centerLeft, // Align text to the center
|
||||||
|
child: Text(
|
||||||
|
(policyName != null &&
|
||||||
|
policyType !=
|
||||||
|
null)
|
||||||
|
? '$policyName - ($policyType)'
|
||||||
|
: '',
|
||||||
|
textAlign: TextAlign
|
||||||
|
.center, // Align text to the center
|
||||||
|
style:
|
||||||
|
GoogleFonts.poppins(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 6,
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment
|
||||||
|
.centerRight, // Align text to the center
|
||||||
|
child: MouseRegion(
|
||||||
|
cursor:
|
||||||
|
SystemMouseCursors
|
||||||
|
.click,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context,
|
||||||
|
'hrDashboard');
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons
|
||||||
|
.close, // Replace with your desired icon
|
||||||
|
color: Colors
|
||||||
|
.white, // Replace with your desired icon color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(height: 200),
|
SizedBox(height: 200),
|
||||||
if (inceptionType == 2)
|
if (inceptionType == 2)
|
||||||
Center(
|
Center(
|
||||||
@ -604,12 +646,15 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style:
|
||||||
|
ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Color(0xFFE26728),
|
Color(0xFFE26728),
|
||||||
shape: RoundedRectangleBorder(
|
shape:
|
||||||
|
RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(5),
|
BorderRadius.circular(
|
||||||
|
5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -635,7 +680,25 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
);
|
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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,7 +708,8 @@ class _HrPolicyDetailsState extends State<hrPolicyDetails>
|
|||||||
return Text('No available data');
|
return Text('No available data');
|
||||||
} else {
|
} else {
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 0, // Set elevation to 0 for no shadow
|
elevation: 0,
|
||||||
|
color: Colors.white, // Set elevation to 0 for no shadow
|
||||||
child: PaginatedDataTable(
|
child: PaginatedDataTable(
|
||||||
rowsPerPage: 25, // Adjust rows per page as needed
|
rowsPerPage: 25, // Adjust rows per page as needed
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:nhancepolicy/customAppBar/toastHelper.dart';
|
import 'package:nhancepolicy/customAppBar/toastHelper.dart';
|
||||||
import 'package:nhancepolicy/models/environment.dart';
|
import 'package:nhancepolicy/models/environment.dart';
|
||||||
import 'package:pinput/pinput.dart';
|
import 'package:pinput/pinput.dart';
|
||||||
@ -404,7 +405,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
return Image.asset(
|
return Image.asset(
|
||||||
'assets/hrLogin.jpg',
|
'assets/hrLogin.jpg',
|
||||||
height: _size.height,
|
height: _size.height,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.cover,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
@ -429,23 +430,23 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
flex: 8,
|
flex: 8,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment
|
alignment: Alignment
|
||||||
.centerRight, // Align to the start
|
.topRight, // Align to the start
|
||||||
child: _size.width <= 1100
|
child: _size.width <= 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final-mobile.png',
|
'assets/Nhance-Logo-Final-mobile.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: _size.width > 1100
|
: _size.width > 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: Image.asset(
|
: Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
@ -462,7 +463,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Welcome to Nhance",
|
"Welcome to Nhance",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@ -481,14 +482,14 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text:
|
text:
|
||||||
"Please enter the one-time usage code sent to your mobile number $mobileNumber",
|
"Please enter the one-time usage code sent to your mobile number $mobileNumber",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
height: 1.5,
|
height: 1.5,
|
||||||
color: Color(0xFF000000)),
|
color: Color(0xFF000000)),
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: " (Change Number)",
|
text: " (Change Number)",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Color(
|
color: Color(
|
||||||
0xFFE26728)), // Change color as desired
|
0xFFE26728)), // Change color as desired
|
||||||
@ -531,7 +532,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
_isTimerRunning
|
_isTimerRunning
|
||||||
? Text(
|
? Text(
|
||||||
"Resend OTP in $_secondsRemaining seconds",
|
"Resend OTP in $_secondsRemaining seconds",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.black),
|
color: Colors.black),
|
||||||
)
|
)
|
||||||
: InkWell(
|
: InkWell(
|
||||||
@ -540,7 +541,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Resend OTP",
|
"Resend OTP",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.blue),
|
color: Colors.blue),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -574,7 +575,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Submit",
|
"Submit",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Color(0xFFFFFFFF)),
|
color: Color(0xFFFFFFFF)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -592,7 +593,7 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
SizedBox(height: 30),
|
SizedBox(height: 30),
|
||||||
Text(
|
Text(
|
||||||
"Benefits of Login",
|
"Benefits of Login",
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@ -687,7 +688,12 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: _size.height * 0.1,
|
height: _size.height * 0.1,
|
||||||
),
|
),
|
||||||
Container(
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
width: double
|
||||||
|
.infinity, // Make the footer full width
|
||||||
|
child: Container(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(vertical: 8),
|
EdgeInsets.symmetric(vertical: 8),
|
||||||
@ -696,28 +702,28 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text:
|
text:
|
||||||
'By continuing, you agree with our ',
|
'By continuing, you agree with our ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
children: <TextSpan>[
|
children: <TextSpan>[
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'privacy policy ',
|
text: 'privacy policy ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Color(0xFF00989E),
|
color: Color(0xFF00989E),
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'and ',
|
text: 'and ',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'terms of use',
|
text: 'terms of use',
|
||||||
style: TextStyle(
|
style: GoogleFonts.poppins(
|
||||||
color: Color(0xFF00989E),
|
color: Color(0xFF00989E),
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
),
|
),
|
||||||
@ -726,6 +732,8 @@ class _MyVerifyState extends State<MyHrVerify> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -273,25 +273,25 @@ class _MyPhoneState extends State<MyPhone> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Responsive.isDesktop(
|
alignment: Responsive.isDesktop(
|
||||||
context)
|
context)
|
||||||
? Alignment.centerLeft
|
? Alignment.topLeft
|
||||||
: Alignment
|
: Alignment
|
||||||
.bottomCenter, // Align to the start
|
.bottomCenter, // Align to the start
|
||||||
child: _size.width <= 1100
|
child: _size.width <= 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final-mobile.png',
|
'assets/Nhance-Logo-Final-mobile.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: _size.width > 1100
|
: _size.width > 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: Image.asset(
|
: Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -581,7 +581,12 @@ class _MyPhoneState extends State<MyPhone> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: _size.height * 0.1,
|
height: _size.height * 0.1,
|
||||||
),
|
),
|
||||||
Container(
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
width: double
|
||||||
|
.infinity, // Make the footer full width
|
||||||
|
child: Container(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(vertical: 8),
|
EdgeInsets.symmetric(vertical: 8),
|
||||||
@ -620,6 +625,8 @@ class _MyPhoneState extends State<MyPhone> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getClientDetails?client_id=$clientId&emp_code=$empCode&client_branch_id=$branchID');
|
'${Environment.apiUrl}getClientDetails?client_id=$clientId&emp_code=$empCode&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -47,7 +47,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getEmployeeProfile?emp_code=$empCode&client_id=$clientId&client_branch_id=$branchID');
|
'${Environment.apiUrl}getEmployeeProfile?emp_code=$empCode&client_id=$clientId&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -60,7 +60,7 @@ class ApiService {
|
|||||||
}
|
}
|
||||||
final url = Uri.parse('${Environment.apiUrl}relationshipList');
|
final url = Uri.parse('${Environment.apiUrl}relationshipList');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -75,7 +75,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID');
|
'${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -90,7 +90,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID');
|
'${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -105,7 +105,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -120,7 +120,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -135,7 +135,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
'${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -150,7 +150,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$addOnsDependentClientPolicyId');
|
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$addOnsDependentClientPolicyId');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -165,7 +165,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpClientPolicyId');
|
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpClientPolicyId');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -180,7 +180,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpParentClientPolicyId');
|
'${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpParentClientPolicyId');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -193,7 +193,7 @@ class ApiService {
|
|||||||
}
|
}
|
||||||
final url = Uri.parse('${Environment.apiUrl}deleteDependence?id=$id');
|
final url = Uri.parse('${Environment.apiUrl}deleteDependence?id=$id');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -208,7 +208,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence');
|
final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence');
|
final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ class ApiService {
|
|||||||
final url =
|
final url =
|
||||||
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ class ApiService {
|
|||||||
final url =
|
final url =
|
||||||
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ class ApiService {
|
|||||||
final url =
|
final url =
|
||||||
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}iAgreeForAddOn');
|
final url = Uri.parse('${Environment.apiUrl}iAgreeForAddOn');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ class ApiService {
|
|||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
final url = Uri.parse('${Environment.apiUrl}calculatePremium');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _token ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
'Content-Type': 'application/json', // Ensure content type is JSON
|
'Content-Type': 'application/json', // Ensure content type is JSON
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getCashDepositData?client_id=$clintID&client_branch_id=$empRefId');
|
'${Environment.apiUrl}getCashDepositData?client_id=$clintID&client_branch_id=$empRefId');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _hrtoken ?? '',
|
'Authorization': 'Bearer $_hrtoken' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
@ -416,7 +416,7 @@ class ApiService {
|
|||||||
final url = Uri.parse(
|
final url = Uri.parse(
|
||||||
'${Environment.apiUrl}getEmployeeAndDependenceByClientId?client_id=$clintID&client_policy_id=$getPolicyNo&client_branch_id=$empRefId');
|
'${Environment.apiUrl}getEmployeeAndDependenceByClientId?client_id=$clintID&client_policy_id=$getPolicyNo&client_branch_id=$empRefId');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': _hrtoken ?? '',
|
'Authorization': 'Bearer $_hrtoken' ?? '',
|
||||||
};
|
};
|
||||||
final response = await _makeGetRequest(url, headers);
|
final response = await _makeGetRequest(url, headers);
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@ -397,25 +397,25 @@ class _MyVerifyState extends State<MyVerify> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Responsive.isDesktop(
|
alignment: Responsive.isDesktop(
|
||||||
context)
|
context)
|
||||||
? Alignment.centerLeft
|
? Alignment.topLeft
|
||||||
: Alignment
|
: Alignment
|
||||||
.bottomCenter, // Align to the start
|
.bottomCenter, // Align to the start
|
||||||
child: _size.width <= 1100
|
child: _size.width <= 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final-mobile.png',
|
'assets/Nhance-Logo-Final-mobile.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: _size.width > 1100
|
: _size.width > 1100
|
||||||
? Image.asset(
|
? Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
)
|
)
|
||||||
: Image.asset(
|
: Image.asset(
|
||||||
'assets/Nhance-Logo-Final 1.png',
|
'assets/Nhance-Logo-Final 1.png',
|
||||||
width: 150,
|
width: 150,
|
||||||
height: 150,
|
height: 70,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
@ -658,7 +658,12 @@ class _MyVerifyState extends State<MyVerify> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: _size.height * 0.1,
|
height: _size.height * 0.1,
|
||||||
),
|
),
|
||||||
Container(
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Container(
|
||||||
|
width: double
|
||||||
|
.infinity, // Make the footer full width
|
||||||
|
child: Container(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(vertical: 8),
|
EdgeInsets.symmetric(vertical: 8),
|
||||||
@ -697,6 +702,8 @@ class _MyVerifyState extends State<MyVerify> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -53,6 +53,7 @@ dependencies:
|
|||||||
flutter_animated_button: ^2.0.3
|
flutter_animated_button: ^2.0.3
|
||||||
spreadsheet_decoder: ^2.2.0
|
spreadsheet_decoder: ^2.2.0
|
||||||
url_launcher: ^6.2.6
|
url_launcher: ^6.2.6
|
||||||
|
font_awesome_flutter: ^10.7.0
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user