UI_EXCEL_UPLOAD

This commit is contained in:
venbaittech 2025-07-09 16:34:54 +05:30
parent 3a4850460e
commit 4817d1ab7a
9 changed files with 130 additions and 73 deletions

BIN
assets/searchData.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

View File

@ -31,7 +31,7 @@ class ClaimHistoryPopup extends StatefulWidget {
class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> { class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
late ApiService apiService; late ApiService apiService;
List<Map<String, dynamic>> getClaimsHistoryList = []; List<Map<String, dynamic>> getClaimsHistoryList = [];
List<String> stepKeys =[]; List<String> stepKeys = [];
late Map<String, dynamic> stepMap; late Map<String, dynamic> stepMap;
int _index = 4; int _index = 4;
@ -71,7 +71,9 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
// isLoading = false; // isLoading = false;
}); });
setState(() { setState(() {
getClaimsHistoryList = [Map<String, dynamic>.from(response['data']['ticket_data'])]; getClaimsHistoryList = [
Map<String, dynamic>.from(response['data']['ticket_data'])
];
stepMap = getClaimsHistoryList[0]; stepMap = getClaimsHistoryList[0];
stepKeys = stepMap.keys.toList(); stepKeys = stepMap.keys.toList();
print('Claims History List $getClaimsHistoryList'); print('Claims History List $getClaimsHistoryList');
@ -178,10 +180,10 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
children: [ children: [
Row( Row(
children: [ children: [
Expanded( Expanded(
child: _buildKeyValue( child: _buildKeyValue('Name',
'Name', '${widget.empName ?? ''} (${widget.empCode ?? ''})'), '${widget.empName ?? ''} (${widget.empCode ?? ''})'),
), ),
SizedBox(width: 16), SizedBox(width: 16),
Expanded( Expanded(
child: _buildKeyValue('Policy Name', child: _buildKeyValue('Policy Name',
@ -197,7 +199,8 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
), ),
SizedBox(width: 16), SizedBox(width: 16),
Expanded( Expanded(
child: _buildKeyValue('Claim Number', widget.claimNo ?? ''), child: _buildKeyValue(
'Claim Number', widget.claimNo ?? ''),
), ),
], ],
), ),
@ -351,9 +354,9 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
// Dotted line below circle (except for last step) // Dotted line below circle (except for last step)
if (!isLast) if (!isLast)
Container( Container(
height: 50, // increase to extend line height: 120, // increase to extend line
width: 2, width: 2,
margin: EdgeInsets.only(top: 4, bottom: 4), // margin: EdgeInsets.only(top: 4, bottom: 4),
child: CustomPaint( child: CustomPaint(
painter: DottedLinePainter(), painter: DottedLinePainter(),
), ),
@ -394,7 +397,6 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
// return '$status ($modifiedBy $modifiedAt)'; // return '$status ($modifiedBy $modifiedAt)';
// } // }
Widget _getStepTitleFromApi(String status, Map<String, dynamic> data) { Widget _getStepTitleFromApi(String status, Map<String, dynamic> data) {
final modifiedBy = data['modified_by'] ?? ''; final modifiedBy = data['modified_by'] ?? '';
final modifiedAt = data['modified_at'] ?? ''; final modifiedAt = data['modified_at'] ?? '';
@ -423,7 +425,6 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
); );
} }
Widget _getStepContentFromApi(Map<String, dynamic> data) { Widget _getStepContentFromApi(Map<String, dynamic> data) {
List<Widget> rows = []; List<Widget> rows = [];
@ -454,7 +455,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
title, title,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
color: Color(0xFF747474), color: Color(0xFF747474),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 16, fontSize: 16,
), ),
), ),
@ -473,7 +474,7 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
Widget _buildHistoryListData(String title, String value) { Widget _buildHistoryListData(String title, String value) {
final displayValue = final displayValue =
(value == null || value.trim().isEmpty) ? 'N/A' : value; (value == null || value.trim().isEmpty) ? 'N/A' : value;
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 6), // optional spacing padding: const EdgeInsets.symmetric(vertical: 6), // optional spacing
@ -514,7 +515,6 @@ class _ClaimHistoryPopupState extends State<ClaimHistoryPopup> {
), ),
); );
} }
} }
class DottedLinePainter extends CustomPainter { class DottedLinePainter extends CustomPainter {

View File

@ -253,6 +253,7 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
enrollmentClient_id = decodedToken['client_id']; enrollmentClient_id = decodedToken['client_id'];
prefs.setString('enrollmentClient_id', enrollmentClient_id); prefs.setString('enrollmentClient_id', enrollmentClient_id);
enrollmentHrId = decodedToken['id']; enrollmentHrId = decodedToken['id'];
print("enrollmentHrId- $enrollmentHrId");
prefs.setString('enrollmentHrId', enrollmentHrId); prefs.setString('enrollmentHrId', enrollmentHrId);
enrollmentAllowed_modules = decodedToken['allowed_modules']; enrollmentAllowed_modules = decodedToken['allowed_modules'];
prefs.setString( prefs.setString(

View File

@ -8,6 +8,7 @@ import 'dart:convert';
import 'dart:async'; import 'dart:async';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:nhancepolicy/customAppBar/toastHelper.dart'; import 'package:nhancepolicy/customAppBar/toastHelper.dart';
import 'package:nhancepolicy/hrPolicyDetails.dart';
import 'package:nhancepolicy/models/environment.dart'; import 'package:nhancepolicy/models/environment.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_html/html.dart' as html; import 'package:universal_html/html.dart' as html;
@ -512,7 +513,7 @@ class _excelVerifyState extends State<excelVerify> {
}); });
// ToastHelper.showSuccessToast( // ToastHelper.showSuccessToast(
// context, 'Failed to upload file: ${response.reasonPhrase}'); // context, 'Failed to upload file: ${response.reasonPhrase}');
ToastHelper.showSuccessToast(context, 'Something went wrong'); ToastHelper.showErrorToast(context, 'Something went wrong');
print('Failed to upload file: ${response.reasonPhrase}'); print('Failed to upload file: ${response.reasonPhrase}');
} }
} }
@ -719,9 +720,43 @@ class _excelVerifyState extends State<excelVerify> {
// For Step 1: Check excelValidationStatus // For Step 1: Check excelValidationStatus
if (excelValidationStaus == 0) { if (excelValidationStaus == 0) {
// Navigate to hrPolicyDetails page // Navigate to hrPolicyDetails page
Navigator.pushNamed( // Navigator.pushNamed(
context, 'hrPolicyDetails', // context, 'hrPolicyDetails',
arguments: argumentsData); // arguments: argumentsData);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
hrPolicyDetails(
ClientId: widget
.ClientId, // <-- from map
ClientPoliyId:
widget.ClientPoliyId,
clientBranchId:
widget.clientBranchId,
Token: widget.Token,
TokenType:
widget.TokenType,
cardType: widget.cardType,
cardPolicyNo:
widget.cardPolicyNo,
cardInsurer_name: widget
.cardInsurer_name,
cardPolicy_name: widget
.cardPolicy_name,
cardPolicy_ExpDate: widget
.cardPolicy_ExpDate,
// Token: widget.Token,
// ClientId: widget.ClientId,
// ClientPolicyId : widget.ClientPoliyId,
// PolicyName: widget.cardPolicy_name,
// PolicyNo: widget.cardPolicyNo,
// ClientBranchId: widget.HrId,
// PolicyType: widget.cardType,
),
),
);
} }
// If excelValidationStatus is 1, button will be disabled (do nothing) // If excelValidationStatus is 1, button will be disabled (do nothing)
} }
@ -810,7 +845,7 @@ class _excelVerifyState extends State<excelVerify> {
child: Text( child: Text(
'${widget.cardPolicy_name} - (${widget.cardType})', '${widget.cardPolicy_name} - (${widget.cardType})',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight fontWeight: FontWeight
.w600, // Adjust the font size as needed .w600, // Adjust the font size as needed
@ -922,7 +957,7 @@ class _excelVerifyState extends State<excelVerify> {
resetErrorCount(); resetErrorCount();
}, },
child: child:
Row( const Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: [ children: [
@ -1022,6 +1057,7 @@ class _excelVerifyState extends State<excelVerify> {
), ),
isActive: _currentStep == 0, isActive: _currentStep == 0,
), ),
Step( Step(
title: Text( title: Text(
'Excel Validation', 'Excel Validation',

View File

@ -566,48 +566,53 @@ class _hrDashboardState extends State<hrDashboard>
), ),
SizedBox(height: 8), SizedBox(height: 8),
Container(
// padding: const EdgeInsets.all(5), tabData.isNotEmpty
// height: MediaQuery.of(context).size.height * 0.08, ? Container(
decoration: BoxDecoration( // padding: const EdgeInsets.all(5),
color: // height: MediaQuery.of(context).size.height * 0.08,
Color(0xFFC4E3E6), // 🔹 Background behind the TabBar decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), color: Color(
border: Border.all(color: Colors.transparent), 0xFFC4E3E6), // 🔹 Background behind the TabBar
boxShadow: [ borderRadius: BorderRadius.circular(12),
BoxShadow( border: Border.all(color: Colors.transparent),
color: Colors.black.withOpacity(0.15), boxShadow: [
blurRadius: 4, BoxShadow(
offset: const Offset(0, 4), color: Colors.black.withOpacity(0.15),
blurRadius: 4,
offset: const Offset(0, 4),
),
],
),
child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
children: [
TabBar(
controller: _tabController,
isScrollable: true,
labelPadding: EdgeInsets.zero,
dividerColor: Colors.transparent,
indicatorColor: Colors.transparent,
indicatorPadding: EdgeInsets.zero,
labelColor: Colors.white,
unselectedLabelColor: const Color(0xFF828282),
// tabs: visibleTabs,
tabs: List.generate(tabData.length, (index) {
final data = tabData[index];
return CustomTab(
icon: data['icon'],
label: data['label'],
isSelected: selectedIndex == index,
);
}),
),
],
),
)
: const Center(
child: Text("No Data Available"),
), ),
],
),
child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
children: [
TabBar(
controller: _tabController,
isScrollable: true,
labelPadding: EdgeInsets.zero,
dividerColor: Colors.transparent,
indicatorColor: Colors.transparent,
indicatorPadding: EdgeInsets.zero,
labelColor: Colors.white,
unselectedLabelColor: const Color(0xFF828282),
// tabs: visibleTabs,
tabs: List.generate(tabData.length, (index) {
final data = tabData[index];
return CustomTab(
icon: data['icon'],
label: data['label'],
isSelected: selectedIndex == index,
);
}),
),
],
),
),
SizedBox(height: 16), SizedBox(height: 16),
// Expanded TabBarView // Expanded TabBarView
Expanded( Expanded(

View File

@ -414,12 +414,13 @@ class ApiService {
Future<Map<String, dynamic>> getCashDepositDetailsToApi( Future<Map<String, dynamic>> getCashDepositDetailsToApi(
String clintID, String empRefId, String hr_id, String token) async { String clintID, String empRefId, String hr_id, String token) async {
print("getCashDepositDetailsToApi1"); print("getCashDepositDetailsToApi1");
print("HRID- $hr_id");
if (token == null) { if (token == null) {
await _initializeToken(); await _initializeToken();
} }
final url = Uri.parse( final url = Uri.parse(
'${Environment.apiUrl}getPolicyLevelEmployeeSummaryData?client_id=$clintID&client_branch_id=$empRefId&hr_id=470'); '${Environment.apiUrl}getPolicyLevelEmployeeSummaryData?client_id=$clintID&client_branch_id=$empRefId&hr_id=$hr_id');
final headers = { final headers = {
'Authorization': 'Bearer $token' ?? '', 'Authorization': 'Bearer $token' ?? '',
@ -508,7 +509,7 @@ class ApiService {
} }
Future<Map<String, dynamic>> getClaimsHistoryToApi( Future<Map<String, dynamic>> getClaimsHistoryToApi(
String ticket_type_id,String token) async { String ticket_type_id, String token) async {
print("getCashDepositDetailsToApi1"); print("getCashDepositDetailsToApi1");
final url = Uri.parse( final url = Uri.parse(
'${Environment.apiUrlPost}claimView?ticket_id=$ticket_type_id'); '${Environment.apiUrlPost}claimView?ticket_id=$ticket_type_id');

View File

@ -1426,7 +1426,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
), ),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728), backgroundColor: Color(0xFFE26728),
padding: EdgeInsets.symmetric(horizontal: 34, vertical: 14), padding: EdgeInsets.symmetric(horizontal: 4, vertical: 14),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
@ -1452,7 +1452,7 @@ class _ClaimsPolicieState extends State<ClaimsPolicies> {
), ),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728), backgroundColor: Color(0xFFE26728),
padding: EdgeInsets.symmetric(horizontal: 34, vertical: 14), padding: EdgeInsets.symmetric(horizontal: 4, vertical: 14),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),

View File

@ -182,12 +182,22 @@ class _PreEnrollmentState extends State<PreEnrollment> {
child: getCardArrays.isEmpty child: getCardArrays.isEmpty
? Center( ? Center(
child: Text( child: Column(
'No data found', children: [
style: TextStyle( Image.asset(
fontSize: 16, 'assets/searchData.jpg', // Replace 'default_image.png' with your default image asset path
color: Colors.grey.shade600, width: 200,
), height: 200,
fit: BoxFit.cover,
),
Text(
'No data found',
style: TextStyle(
fontSize: 16,
color: Colors.grey.shade600,
),
),
],
), ),
) )
: GridView.builder( : GridView.builder(
@ -289,8 +299,10 @@ class _PreEnrollmentState extends State<PreEnrollment> {
), ),
), ),
Text( Text(
"${policy['insurer_short_name']} - ${policy['policy_name']} " ?? // "${policy['insurer_short_name']} - ${policy['policy_name']} " ??
'', // '',
policy['insurer_name'] ?? "",
style: const TextStyle( style: const TextStyle(
fontSize: 11, fontSize: 11,
color: Colors.grey, color: Colors.grey,

View File

@ -5,6 +5,7 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import file_picker
import firebase_auth import firebase_auth
import firebase_core import firebase_core
import google_sign_in_ios import google_sign_in_ios
@ -14,6 +15,7 @@ import smart_auth
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))