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

View File

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

View File

@ -8,6 +8,7 @@ import 'dart:convert';
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:nhancepolicy/customAppBar/toastHelper.dart';
import 'package:nhancepolicy/hrPolicyDetails.dart';
import 'package:nhancepolicy/models/environment.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:universal_html/html.dart' as html;
@ -512,7 +513,7 @@ class _excelVerifyState extends State<excelVerify> {
});
// ToastHelper.showSuccessToast(
// 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}');
}
}
@ -719,9 +720,43 @@ class _excelVerifyState extends State<excelVerify> {
// For Step 1: Check excelValidationStatus
if (excelValidationStaus == 0) {
// Navigate to hrPolicyDetails page
Navigator.pushNamed(
context, 'hrPolicyDetails',
arguments: argumentsData);
// Navigator.pushNamed(
// context, 'hrPolicyDetails',
// 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)
}
@ -810,7 +845,7 @@ class _excelVerifyState extends State<excelVerify> {
child: Text(
'${widget.cardPolicy_name} - (${widget.cardType})',
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight
.w600, // Adjust the font size as needed
@ -922,7 +957,7 @@ class _excelVerifyState extends State<excelVerify> {
resetErrorCount();
},
child:
Row(
const Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
@ -1022,6 +1057,7 @@ class _excelVerifyState extends State<excelVerify> {
),
isActive: _currentStep == 0,
),
Step(
title: Text(
'Excel Validation',

View File

@ -566,48 +566,53 @@ class _hrDashboardState extends State<hrDashboard>
),
SizedBox(height: 8),
Container(
// padding: const EdgeInsets.all(5),
// height: MediaQuery.of(context).size.height * 0.08,
decoration: BoxDecoration(
color:
Color(0xFFC4E3E6), // 🔹 Background behind the TabBar
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.transparent),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.15),
blurRadius: 4,
offset: const Offset(0, 4),
tabData.isNotEmpty
? Container(
// padding: const EdgeInsets.all(5),
// height: MediaQuery.of(context).size.height * 0.08,
decoration: BoxDecoration(
color: Color(
0xFFC4E3E6), // 🔹 Background behind the TabBar
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.transparent),
boxShadow: [
BoxShadow(
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),
// Expanded TabBarView
Expanded(

View File

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

View File

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

View File

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

View File

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