UI_BUGFIX

This commit is contained in:
venbaittech 2025-11-07 10:17:58 +05:30
parent cb82278834
commit 705731d2ab
15 changed files with 7126 additions and 6534 deletions

View File

@ -32,7 +32,6 @@ import 'package:nhance_app_pwa/pages/session/SetPinBiometric.dart';
import 'package:nhance_app_pwa/pages/session/changePin.dart'; import 'package:nhance_app_pwa/pages/session/changePin.dart';
import 'package:nhance_app_pwa/pages/session/settingUpPinAndBiometric.dart'; import 'package:nhance_app_pwa/pages/session/settingUpPinAndBiometric.dart';
import 'package:nhance_app_pwa/pages/verify.dart'; import 'package:nhance_app_pwa/pages/verify.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'models/environment.dart'; import 'models/environment.dart';
@ -65,8 +64,6 @@ class _SplashScreenState extends State<SplashScreen> {
} else { } else {
if (mounted) context.go('/login'); if (mounted) context.go('/login');
} }
} }
@override @override
@ -82,7 +79,6 @@ class _SplashScreenState extends State<SplashScreen> {
} }
} }
/// Middleware logic for tokens + mpin /// Middleware logic for tokens + mpin
Future<String?> tokenRedirectLogic( Future<String?> tokenRedirectLogic(
BuildContext context, GoRouterState state) async { BuildContext context, GoRouterState state) async {
@ -110,7 +106,8 @@ Future<String?> tokenRedirectLogic(
await SessionManager().clear(); await SessionManager().clear();
// Show toast once // Show toast once
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
ToastHelper.showErrorToast(context, 'Session expired. Please login again.'); ToastHelper.showErrorToast(
context, 'Session expired. Please login again.');
}); });
return '/login'; return '/login';
} }
@ -192,7 +189,8 @@ Future<void> main() async {
final router = GoRouter( final router = GoRouter(
initialLocation: initialLocation, initialLocation: initialLocation,
routes: [ routes: [
GoRoute(path: '/splash', builder: (context, state) => const SplashScreen()), GoRoute(
path: '/splash', builder: (context, state) => const SplashScreen()),
GoRoute(path: '/login', builder: (context, state) => login()), GoRoute(path: '/login', builder: (context, state) => login()),
// GoRoute( // GoRoute(
// path: '/verify', // path: '/verify',
@ -241,7 +239,9 @@ Future<void> main() async {
// ), // ),
// GoRoute(path: '/mailVerify', builder: (context, state) => MyEmailVerify(email: '')), // GoRoute(path: '/mailVerify', builder: (context, state) => MyEmailVerify(email: '')),
GoRoute(path: '/pinPage', builder: (context, state) => pinPage()), GoRoute(path: '/pinPage', builder: (context, state) => pinPage()),
GoRoute(path: '/pinSettingPage', builder: (context, state) => pinSettingPage()), GoRoute(
path: '/pinSettingPage',
builder: (context, state) => pinSettingPage()),
GoRoute( GoRoute(
path: '/changePin', path: '/changePin',
builder: (context, state) => changePin(), builder: (context, state) => changePin(),
@ -249,24 +249,31 @@ Future<void> main() async {
GoRoute(path: '/home', builder: (context, state) => Home()), GoRoute(path: '/home', builder: (context, state) => Home()),
GoRoute(path: '/profile', builder: (context, state) => profile()), GoRoute(path: '/profile', builder: (context, state) => profile()),
GoRoute(path: '/help', builder: (context, state) => help()), GoRoute(path: '/help', builder: (context, state) => help()),
GoRoute(path: '/claimprocess', builder: (context, state) => claimprocess()), GoRoute(
path: '/claimprocess', builder: (context, state) => claimprocess()),
GoRoute(path: '/wellness', builder: (context, state) => wellness()), GoRoute(path: '/wellness', builder: (context, state) => wellness()),
GoRoute(path: '/privacypolicy', builder: (context, state) => privacypolicy()), GoRoute(
path: '/privacypolicy', builder: (context, state) => privacypolicy()),
GoRoute(path: '/termsofuse', builder: (context, state) => termsofuse()), GoRoute(path: '/termsofuse', builder: (context, state) => termsofuse()),
GoRoute(path: '/generalExclusionsDeductibles', builder: (context, state) => generalExclusionsDeductibles()), GoRoute(
GoRoute(path: '/raisedTicketHistory', builder: (context, state) => raisedTicketHistory()), path: '/generalExclusionsDeductibles',
builder: (context, state) => generalExclusionsDeductibles()),
GoRoute(
path: '/raisedTicketHistory',
builder: (context, state) => raisedTicketHistory()),
GoRoute(path: '/tickets', builder: (context, state) => tickets()), GoRoute(path: '/tickets', builder: (context, state) => tickets()),
GoRoute( GoRoute(
path: '/policies', path: '/policies',
builder: (context, state) { builder: (context, state) {
final arguments = state.extra as Map<String, dynamic>?; // 👈 receive here final arguments =
state.extra as Map<String, dynamic>?; // 👈 receive here
return policies(arguments: arguments); return policies(arguments: arguments);
}, },
), ),
GoRoute( GoRoute(
path: '/claims', path: '/claims',
builder: (context, state) { builder: (context, state) {
final int tabIndex = state.extra as int? ?? 1 ; // default to 0 final int tabIndex = state.extra as int? ?? 0; // default to 0
return claims(initialTab: tabIndex); return claims(initialTab: tabIndex);
}, },
), ),
@ -284,9 +291,15 @@ Future<void> main() async {
return tickettracklist(ticketID: ticketID); return tickettracklist(ticketID: ticketID);
}, },
), ),
GoRoute(path: '/empDetails',builder:(context,state) => empDetails(),), GoRoute(
GoRoute(path: '/addOnsDetails', builder: (context, state) => addOnsDetails()), path: '/empDetails',
GoRoute(path: '/empReviewDetails', builder: (context, state) => empReviewDetails()), builder: (context, state) => empDetails(),
),
GoRoute(
path: '/addOnsDetails', builder: (context, state) => addOnsDetails()),
GoRoute(
path: '/empReviewDetails',
builder: (context, state) => empReviewDetails()),
], ],
// Middleware hook // Middleware hook
@ -327,7 +340,6 @@ class _MyAppState extends State<MyApp> {
DataManager().init(apiService); DataManager().init(apiService);
DataManager().loadAdvertisementImages(); DataManager().loadAdvertisementImages();
}); });
} }
@override @override

View File

@ -2,6 +2,7 @@
// import 'package:firebase_messaging/firebase_messaging.dart'; // import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart';
@ -20,11 +21,11 @@ import '../customAppBar/responsive.dart';
import '../customAppBar/toastHelper.dart'; import '../customAppBar/toastHelper.dart';
import '../models/environment.dart'; import '../models/environment.dart';
import '../models/platform_helper_mobile.dart' import '../models/platform_helper_mobile.dart'
if (dart.library.html) '../models/platform_helper_other.dart'; if (dart.library.html) '../models/platform_helper_other.dart';
// import 'dart:html' as html; // import 'dart:html' as html;
import '../pages/helpers/html_stub.dart' import '../pages/helpers/html_stub.dart'
if (dart.library.html) '../pages/helpers/html_web.dart'; if (dart.library.html) '../pages/helpers/html_web.dart';
// import '../pages/helpers/html_stub.dart' if (dart.library.html) 'html_web.dart'; // import '../pages/helpers/html_stub.dart' if (dart.library.html) 'html_web.dart';
@ -159,8 +160,8 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
try { try {
final response = await http.post( final response = await http.post(
Uri.parse(Environment.apiUrl + 'storeFireBase'), Uri.parse(Environment.apiUrl + 'storeFireBase'),
body: json body: json.encode(
.encode({'mobile': session.mobileNo, 'firebase_token': deviceToken}), {'mobile': session.mobileNo, 'firebase_token': deviceToken}),
headers: { headers: {
HttpHeaders.contentTypeHeader: 'application/json', HttpHeaders.contentTypeHeader: 'application/json',
'Authorization': 'Bearer $_preToken', 'Authorization': 'Bearer $_preToken',
@ -203,13 +204,12 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
try { try {
// print('EMAIL PARAMS : ${widget.email} - OTP : $otp'); // print('EMAIL PARAMS : ${widget.email} - OTP : $otp');
final Map<String, dynamic> payload = (widget.type == 'mobile') final Map<String, dynamic> payload = (widget.type == 'mobile')
? {'otp': _otpController.text,'mobile_number': widget.value} ? {'otp': _otpController.text, 'mobile_number': widget.value}
: {'otp': _otpController.text, 'email_id': widget.value}; : {'otp': _otpController.text, 'email_id': widget.value};
final response = await http.post( final response = await http.post(
Uri.parse(Environment.apiUrlEnrollment + 'getVerifiedUserData'), Uri.parse(Environment.apiUrlEnrollment + 'getVerifiedUserData'),
body: body: json.encode(payload),
json.encode(payload),
headers: { headers: {
HttpHeaders.contentTypeHeader: 'application/json', HttpHeaders.contentTypeHeader: 'application/json',
}, },
@ -238,7 +238,8 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
} }
String? postToken; String? postToken;
if (data['post_enrollment'] != null && data['post_enrollment']['data'] is String) { if (data['post_enrollment'] != null &&
data['post_enrollment']['data'] is String) {
postToken = data['post_enrollment']['data']; postToken = data['post_enrollment']['data'];
} }
@ -427,7 +428,7 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
// if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') { // if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') {
if (_postToken != null && _postToken.isNotEmpty) { if (_postToken != null && _postToken.isNotEmpty) {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
if(widget.type == 'mobile'){ if (widget.type == 'mobile') {
prefs.setString('empMobileNo', widget.value); prefs.setString('empMobileNo', widget.value);
} else { } else {
prefs.setString('empEmailid', widget.value); prefs.setString('empEmailid', widget.value);
@ -485,7 +486,7 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
// if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') { // if (prefs.containsKey('mpin') && mpinText == 'Mpin - exist') {
if (_preToken != null && _preToken.isNotEmpty) { if (_preToken != null && _preToken.isNotEmpty) {
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
if(widget.type == 'mobile'){ if (widget.type == 'mobile') {
prefs.setString('empMobileNo', widget.value); prefs.setString('empMobileNo', widget.value);
} else { } else {
prefs.setString('empEmailid', widget.value); prefs.setString('empEmailid', widget.value);
@ -541,14 +542,13 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
bool userVerification = data['data']['user_verification']; bool userVerification = data['data']['user_verification'];
String message = data['data']['message']; String message = data['data']['message'];
if (userVerification) { if (userVerification) {
if(widget.type == 'mobile'){ if (widget.type == 'mobile') {
ToastHelper.showSuccessToast( ToastHelper.showSuccessToast(
context, 'Verification code sent to ${widget.value}'); context, 'Verification code sent to ${widget.value}');
} else { } else {
ToastHelper.showSuccessToast( ToastHelper.showSuccessToast(
context, 'Verification code sent to ${widget.value}'); context, 'Verification code sent to ${widget.value}');
} }
} else { } else {
ToastHelper.showErrorToast(context, message); ToastHelper.showErrorToast(context, message);
print('Invalid mobile number'); print('Invalid mobile number');
@ -647,7 +647,8 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
} }
Future<void> getClientLogoAndDetails() async { Future<void> getClientLogoAndDetails() async {
var url = Uri.parse(Environment.apiUrlEnrollment + 'getClientDetails?post_client_id=${session.client_id}&post_branch_id=${session.empClientBranchId}&pre_client_id=${session.enrollmentClient_id}&pre_branch_id=${session.enrollmentEmpClientBranchId}'); var url = Uri.parse(Environment.apiUrlEnrollment +
'getClientDetails?post_client_id=${session.client_id}&post_branch_id=${session.empClientBranchId}&pre_client_id=${session.enrollmentClient_id}&pre_branch_id=${session.enrollmentEmpClientBranchId}');
try { try {
var response = await http.get( var response = await http.get(
url, url,
@ -664,8 +665,10 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
if (data.containsKey('data')) { if (data.containsKey('data')) {
dynamic clientDetails = data['data']; dynamic clientDetails = data['data'];
final SharedPreferences prefs = await SharedPreferences.getInstance(); final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('clientLogo', clientDetails['client']['client_logo']); await prefs.setString(
await prefs.setString('clientName', clientDetails['client']['client_name']); 'clientLogo', clientDetails['client']['client_logo']);
await prefs.setString(
'clientName', clientDetails['client']['client_name']);
await prefs.setString( await prefs.setString(
'addon_subheading', clientDetails['client']['addon_subheading']); 'addon_subheading', clientDetails['client']['addon_subheading']);
setState(() { setState(() {
@ -940,16 +943,20 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
color: Color(0xFF000000)), color: Color(0xFF000000)),
children: [ children: [
TextSpan( TextSpan(
text: widget.type == 'mobile' ? 'mobile number ${widget.value}' : 'Email Id ${widget.value}', text: widget.type == 'mobile'
? 'mobile number ${widget.value}'
: 'Email Id ${widget.value}',
), ),
TextSpan( TextSpan(
text: widget.type == 'mobile' ? ' (Change Mobile)' : ' (Change Email)', text: widget.type == 'mobile'
? ' (Change Mobile)'
: ' (Change Email)',
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Color( color: Color(
0xFFE26728) 0xFFE26728)), // Change color as desired
), // Change color as desired recognizer:
recognizer: TapGestureRecognizer() TapGestureRecognizer()
..onTap = () { ..onTap = () {
context.go('/login'); context.go('/login');
// Navigator.pushNamed( // Navigator.pushNamed(
@ -972,6 +979,11 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
// defaultPinTheme: defaultPinTheme, // defaultPinTheme: defaultPinTheme,
// focusedPinTheme: focusedPinTheme, // focusedPinTheme: focusedPinTheme,
// submittedPinTheme: submittedPinTheme, // submittedPinTheme: submittedPinTheme,
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly, // allows only 09
],
keyboardType: TextInputType.number,
showCursor: true, showCursor: true,
controller: _otpController, controller: _otpController,
), ),

View File

@ -134,7 +134,8 @@ class _empDetailsState extends State<empDetails> {
Future<void> getTokenStatus() async { Future<void> getTokenStatus() async {
// final SharedPreferences prefs = await SharedPreferences.getInstance(); // final SharedPreferences prefs = await SharedPreferences.getInstance();
setState(() async { setState(() async {
isTokenAvailable = (await TokenService.getPostToken())?.isNotEmpty ?? false; isTokenAvailable =
(await TokenService.getPostToken())?.isNotEmpty ?? false;
print('isTokenAvailable $isTokenAvailable'); print('isTokenAvailable $isTokenAvailable');
}); });
} }
@ -149,8 +150,9 @@ class _empDetailsState extends State<empDetails> {
// Decode the JWT token received from the API response // Decode the JWT token received from the API response
enrollmentEmpClientBranchId = session.enrollmentEmpClientBranchId; enrollmentEmpClientBranchId = session.enrollmentEmpClientBranchId;
enrollmentEmpCodeString = session.enrollmentEmpCodeString; enrollmentEmpCodeString = session.enrollmentEmpCodeString;
print('enrollmentEmpCodeString : $enrollmentEmpCodeString'); // Check if emp_code is correct print(
enrollmentEmpPrimaryId =session.enrollmentEmpPrimaryId; 'enrollmentEmpCodeString : $enrollmentEmpCodeString'); // Check if emp_code is correct
enrollmentEmpPrimaryId = session.enrollmentEmpPrimaryId;
enrollmentGpaEmpName = session.enrollmentGpaEmpName; enrollmentGpaEmpName = session.enrollmentGpaEmpName;
enrollmentClient_id = session.enrollmentClient_id; enrollmentClient_id = session.enrollmentClient_id;
selfEmpStatus = prefs.getString('selfEmpStatus'); selfEmpStatus = prefs.getString('selfEmpStatus');
@ -230,7 +232,9 @@ class _empDetailsState extends State<empDetails> {
// enrollmentEmpClientBranchId == null) { // enrollmentEmpClientBranchId == null) {
// return; // return;
// } // }
final response = await apiService.getClientLogoAndDetailsToApi(empClientId,empClientBranchId, final response = await apiService.getClientLogoAndDetailsToApi(
empClientId,
empClientBranchId,
enrollmentClient_id!, enrollmentClient_id!,
enrollmentEmpClientBranchId!); enrollmentEmpClientBranchId!);
print('check 1'); print('check 1');
@ -481,6 +485,16 @@ class _empDetailsState extends State<empDetails> {
} }
} }
String formatDate(String inputDate) {
// Parse the input date string
DateTime dateTime = DateFormat('dd-MM-yyyy').parse(inputDate);
// Format the date to the desired format
String formattedDate = DateFormat('dd MMM yyyy').format(dateTime);
return formattedDate;
}
Future<void> deleteItem(Map<String, dynamic> deletedItem) async { Future<void> deleteItem(Map<String, dynamic> deletedItem) async {
print(deletedItem); print(deletedItem);
try { try {
@ -733,8 +747,8 @@ class _empDetailsState extends State<empDetails> {
if (loadingProgress == null) return child; if (loadingProgress == null) return child;
return Center( return Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
value: value: loadingProgress
loadingProgress.expectedTotalBytes != .expectedTotalBytes !=
null null
? loadingProgress ? loadingProgress
.cumulativeBytesLoaded / .cumulativeBytesLoaded /
@ -842,6 +856,26 @@ class _empDetailsState extends State<empDetails> {
right: 10), // Add padding to the container right: 10), // Add padding to the container
child: Row( child: Row(
children: [ children: [
InkWell(
onTap: () {
context.go('/home');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
// if (!Responsive.isDesktop(context))
Icon(
Icons.chevron_left,
color: Color(0xFF000000),
size: 30,
),
SizedBox(
width: Responsive.isDesktop(context)
? 0
: 5),
],
),
),
Expanded( Expanded(
flex: 6, flex: 6,
child: Container( child: Container(
@ -858,8 +892,8 @@ class _empDetailsState extends State<empDetails> {
if (loadingProgress == null) return child; if (loadingProgress == null) return child;
return Center( return Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
value: value: loadingProgress
loadingProgress.expectedTotalBytes != .expectedTotalBytes !=
null null
? loadingProgress ? loadingProgress
.cumulativeBytesLoaded / .cumulativeBytesLoaded /
@ -951,7 +985,8 @@ class _empDetailsState extends State<empDetails> {
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728), backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5), borderRadius:
BorderRadius.circular(5),
), ),
), ),
), ),
@ -1041,7 +1076,8 @@ class _empDetailsState extends State<empDetails> {
], ],
initialIndex: initialIndex:
0, // Initial index of the bottom navigation bar 0, // Initial index of the bottom navigation bar
) : null, )
: null,
)); ));
} }
} }
@ -1111,12 +1147,13 @@ class _empDetailsState extends State<empDetails> {
// Set values to all fields // Set values to all fields
_relationShipController.text = floaterData['relationship'] ?? ''; _relationShipController.text = floaterData['relationship'] ?? '';
_memberNameController.text = floaterData['name'] ?? ''; _memberNameController.text = floaterData['name'] ?? '';
_dobController.text = floaterData['dob'] ?? ''; _dobController.text = formatDate(floaterData['dob']) ?? '';
// Add more fields as needed // Add more fields as needed
} }
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -1831,7 +1868,7 @@ class _empDetailsState extends State<empDetails> {
), ),
), ),
Text( Text(
'${floaterData['relationship']} - ${floaterData['dob']}' ?? '${floaterData['relationship']} - ${formatDate(floaterData['dob'])}' ??
'NA', 'NA',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
@ -2332,7 +2369,7 @@ class _empDetailsState extends State<empDetails> {
), ),
), ),
Text( Text(
'${floaterData['relationship']} - ${floaterData['dob']}', '${floaterData['relationship']} - ${formatDate(floaterData['dob'])}',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) ? 18 : 16, fontSize: Responsive.isDesktop(context) ? 18 : 16,
@ -2359,17 +2396,24 @@ class _empDetailsState extends State<empDetails> {
onTap: () { onTap: () {
deleteItem(floaterData); deleteItem(floaterData);
}, },
child: Text( child: Tooltip(
'Delete', message: 'Delete',
textAlign: TextAlign.left, child: Icon(
style: GoogleFonts.poppins( Icons.delete,
fontSize: Responsive.isDesktop(context) color: Color(0xFFE26728),
? 16
: 15,
color: Color(
0xFFE26728), // Add underline decoration
), ),
), ),
// child: Text(
// 'Delete',
// textAlign: TextAlign.left,
// style: GoogleFonts.poppins(
// fontSize: Responsive.isDesktop(context)
// ? 16
// : 15,
// color: Color(
// 0xFFE26728), // Add underline decoration
// ),
// ),
), ),
) )
], ],
@ -2383,15 +2427,16 @@ class _empDetailsState extends State<empDetails> {
floaterData['relationship'] != 'Self') floaterData['relationship'] != 'Self')
? Responsive.isDesktop(context) ? Responsive.isDesktop(context)
? 1 ? 1
: 2 : 4
: Responsive.isDesktop(context) : Responsive.isDesktop(context)
? 2 ? 1
: 4, : 4,
child: Container( child: Container(
alignment: Alignment.topRight, // alignment: Alignment.topRight,
// color: Colors.yellow,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MouseRegion( MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,
@ -2404,17 +2449,32 @@ class _empDetailsState extends State<empDetails> {
floaterData, 'Edit', gmcSumInsured); floaterData, 'Edit', gmcSumInsured);
} }
}, },
child: Text( // child: Text(
floaterData['relationship'] == 'Self' // floaterData['relationship'] == 'Self'
? 'View' // ? 'View'
: 'Edit', // : 'Edit',
textAlign: TextAlign.left, // textAlign: TextAlign.left,
style: GoogleFonts.poppins( // style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) // fontSize: Responsive.isDesktop(context)
? 16 // ? 16
: 15, // : 15,
color: Color( // color: Color(
0xFFE26728), // Add underline decoration // 0xFFE26728), // Add underline decoration
// ),
// ),
child: floaterData['relationship'] == 'Self'
? Tooltip(
message: 'View',
child: Icon(
Icons.remove_red_eye,
color: const Color(0xFFE26728),
),
)
: Tooltip(
message: 'Edit',
child: Icon(
Icons.edit,
color: const Color(0xFFE26728),
), ),
), ),
), ),

File diff suppressed because it is too large Load Diff

View File

@ -674,7 +674,20 @@ class _loginState extends State<login> {
SizedBox(width: 10), SizedBox(width: 10),
SizedBox( SizedBox(
width: 40, width: 40,
child: TextField( // child: TextField(
// controller:
// countryController,
// keyboardType:
// TextInputType
// .number,
// decoration:
// InputDecoration(
// border:
// InputBorder
// .none,
// ),
// ),
child: TextFormField(
controller: controller:
countryController, countryController,
keyboardType: keyboardType:
@ -686,6 +699,23 @@ class _loginState extends State<login> {
InputBorder InputBorder
.none, .none,
), ),
validator: (value) {
if (value ==
null ||
value
.isEmpty) {
return 'Required';
}
return null;
},
inputFormatters: [
FilteringTextInputFormatter
.allow(RegExp(
r'[0-9+]')),
LengthLimitingTextInputFormatter(
3),
],
), ),
), ),
Text( Text(

View File

@ -17,7 +17,6 @@ import '../service/SessionManager.dart';
import '../service/TokenService.dart'; import '../service/TokenService.dart';
import '../service/popup_helper.dart'; import '../service/popup_helper.dart';
class claimprocess extends StatefulWidget { class claimprocess extends StatefulWidget {
const claimprocess({Key? key}) : super(key: key); const claimprocess({Key? key}) : super(key: key);
@ -73,11 +72,9 @@ class _claimprocessState extends State<claimprocess> {
} }
} }
Future<void> getCashlessAndReimbursement() async { Future<void> getCashlessAndReimbursement() async {
final response = await apiService.getCashlessAndReimbursementToApi(); final response = await apiService.getCashlessAndReimbursementToApi();
print('check 1'); print('check 1 getCashlessAndReimbursement');
if (response['status'] == 'success') { if (response['status'] == 'success') {
print(response['data']); print(response['data']);
setState(() { setState(() {
@ -161,9 +158,10 @@ class _claimprocessState extends State<claimprocess> {
context.go('/claims'); context.go('/claims');
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
if (!Responsive.isDesktop(context)) // if (!Responsive.isDesktop(context))
Icon( Icon(
Icons.chevron_left, Icons.chevron_left,
color: Color(0xFF000000), color: Color(0xFF000000),
@ -220,7 +218,8 @@ class _claimprocessState extends State<claimprocess> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 6, flex: 6,
@ -234,37 +233,43 @@ class _claimprocessState extends State<claimprocess> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: TextButton.styleFrom( style:
padding: TextButton.styleFrom(
EdgeInsets.symmetric( padding: EdgeInsets
horizontal: .symmetric(
Responsive.isDesktop( horizontal: Responsive
.isDesktop(
context) context)
? 80 ? 80
: 40, : 40,
vertical: vertical: Responsive
Responsive.isDesktop( .isDesktop(
context) context)
? 12 ? 12
: 7, : 7,
), ),
), ),
child: Text( child: Text(
cashLessSectionName ?? '', cashLessSectionName ??
textAlign: TextAlign.center, '',
style: GoogleFonts.poppins( textAlign:
fontSize: TextAlign.center,
Responsive.isDesktop( style:
GoogleFonts.poppins(
fontSize: Responsive
.isDesktop(
context) context)
? 18 ? 18
: 14, : 14,
fontWeight: fontWeight:
FontWeight.w500, FontWeight.w500,
color: Color(0xFF593AFF), color:
Color(0xFF593AFF),
), ),
), ),
), ),
@ -278,7 +283,8 @@ class _claimprocessState extends State<claimprocess> {
context) context)
? 18 ? 18
: 14, : 14,
fontWeight: FontWeight.w400, fontWeight:
FontWeight.w400,
color: Color(0xFF636363), color: Color(0xFF636363),
), ),
), ),
@ -296,26 +302,48 @@ class _claimprocessState extends State<claimprocess> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: TextButton.styleFrom( style:
padding: TextButton.styleFrom(
EdgeInsets.symmetric( padding: EdgeInsets
horizontal: .symmetric(
Responsive.isDesktop( horizontal: Responsive
.isDesktop(
context) context)
? 80 ? 80
: 40, : 40,
vertical: vertical: Responsive
Responsive.isDesktop( .isDesktop(
context) context)
? 12 ? 12
: 7, : 7,
), ),
), ),
child: Text( child: Text(
reimbursementSectionName ??
'',
textAlign:
TextAlign.center,
style:
GoogleFonts.poppins(
fontSize: Responsive
.isDesktop(
context)
? 18
: 14,
fontWeight:
FontWeight.w500,
color:
Color(0xFF593AFF),
),
),
),
)
: Text(
reimbursementSectionName ?? reimbursementSectionName ??
'', '',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -326,22 +354,7 @@ class _claimprocessState extends State<claimprocess> {
? 18 ? 18
: 14, : 14,
fontWeight: fontWeight:
FontWeight.w500, FontWeight.w400,
color: Color(0xFF593AFF),
),
),
),
)
: Text(
reimbursementSectionName ?? '',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(
context)
? 18
: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF636363), color: Color(0xFF636363),
), ),
), ),
@ -363,21 +376,25 @@ class _claimprocessState extends State<claimprocess> {
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.symmetric(vertical: 15, horizontal: 25) ? EdgeInsets.symmetric(
vertical: 15, horizontal: 25)
: EdgeInsets.all(10), : EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (cashLessClaimsDetails != null) if (cashLessClaimsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
cashLessHeading ?? '', cashLessHeading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -390,7 +407,8 @@ class _claimprocessState extends State<claimprocess> {
double itemHeight = double itemHeight =
40; // Adjust item height based on content 40; // Adjust item height based on content
double listViewHeight = double listViewHeight =
cashLessContent.length * itemHeight; cashLessContent.length *
itemHeight;
double maxHeight = double maxHeight =
constraints.maxHeight; constraints.maxHeight;
@ -401,46 +419,52 @@ class _claimprocessState extends State<claimprocess> {
return Container( return Container(
height: listViewHeight, height: listViewHeight,
child: ListView.builder( child: ListView.builder(
itemCount: cashLessContent.length, itemCount:
cashLessContent.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = cashLessContent.keys String key = cashLessContent
.keys
.elementAt(index); .elementAt(index);
String value = String value =
cashLessContent[key]!; cashLessContent[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(
vertical: 8.0), vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFFE26728), color: Color(
0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFF000000), color: Color(
0xFF000000),
), ),
), ),
), ),
@ -457,14 +481,17 @@ class _claimprocessState extends State<claimprocess> {
), ),
if (cashLessClaimsDetails != null) if (cashLessClaimsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Notes', 'Notes',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -477,7 +504,8 @@ class _claimprocessState extends State<claimprocess> {
double itemHeight = double itemHeight =
70; // Adjust item height based on content 70; // Adjust item height based on content
double listViewHeight = double listViewHeight =
cashLessNotes.length * itemHeight; cashLessNotes.length *
itemHeight;
double maxHeight = double maxHeight =
constraints.maxHeight; constraints.maxHeight;
@ -490,44 +518,49 @@ class _claimprocessState extends State<claimprocess> {
child: ListView.builder( child: ListView.builder(
itemCount: cashLessNotes.length, itemCount: cashLessNotes.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = cashLessNotes.keys String key = cashLessNotes
.keys
.elementAt(index); .elementAt(index);
String value = String value =
cashLessNotes[key]!; cashLessNotes[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(
vertical: 8.0), vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFFE26728), color: Color(
0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFF000000), color: Color(
0xFF000000),
), ),
), ),
), ),
@ -550,21 +583,25 @@ class _claimprocessState extends State<claimprocess> {
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.symmetric(vertical: 15, horizontal: 25) ? EdgeInsets.symmetric(
vertical: 15, horizontal: 25)
: EdgeInsets.all(10), : EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (reimbursementClaimsDetails != null) if (reimbursementClaimsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
reimbursementHeading ?? '', reimbursementHeading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -592,45 +629,50 @@ class _claimprocessState extends State<claimprocess> {
itemCount: itemCount:
reimbursementContent.length, reimbursementContent.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = reimbursementContent String key =
.keys reimbursementContent.keys
.elementAt(index); .elementAt(index);
String value = String value =
reimbursementContent[key]!; reimbursementContent[
key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(
vertical: 8.0), vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFFE26728), color: Color(
0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFF000000), color: Color(
0xFF000000),
), ),
), ),
), ),
@ -647,14 +689,17 @@ class _claimprocessState extends State<claimprocess> {
), ),
if (reimbursementClaimsDetails != null) if (reimbursementClaimsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Notes', 'Notes',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -682,45 +727,49 @@ class _claimprocessState extends State<claimprocess> {
itemCount: itemCount:
reimbursementNotes.length, reimbursementNotes.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = reimbursementNotes String key =
.keys reimbursementNotes.keys
.elementAt(index); .elementAt(index);
String value = String value =
reimbursementNotes[key]!; reimbursementNotes[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(
vertical: 8.0), vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFFE26728), color: Color(
0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
color: .w400,
Color(0xFF000000), color: Color(
0xFF000000),
), ),
), ),
), ),
@ -799,7 +848,6 @@ class _claimprocessState extends State<claimprocess> {
"Wellness", "Wellness",
], ],
), ),
) ));
);
} }
} }

View File

@ -93,7 +93,7 @@ class _claimsState extends State<claims> {
trackClaimsActive = 0; trackClaimsActive = 0;
yourPlanActive = 1; yourPlanActive = 1;
isActive = false; isActive = false;
} else if(arguments == 2){ } else if (arguments == 2) {
print(arguments); print(arguments);
trackClaimsActive = 0; trackClaimsActive = 0;
yourPlanActive = 1; yourPlanActive = 1;
@ -250,7 +250,7 @@ class _claimsState extends State<claims> {
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) { onPopInvokedWithResult: (didPop, result) {
if (didPop) return; if (didPop) return;
if(widget.initialTab == 2){ if (widget.initialTab == 2) {
context.go('/home'); context.go('/home');
} else { } else {
context.pop(); context.pop();
@ -283,7 +283,11 @@ class _claimsState extends State<claims> {
flex: 12, flex: 12,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(widget.initialTab == 2){ print("CACLAIMS - ${widget.initialTab}");
if (widget.initialTab == 2) {
context.go('/home');
}
if (widget.initialTab == 0) {
context.go('/home'); context.go('/home');
} else { } else {
context.pop(); context.pop();
@ -303,10 +307,11 @@ class _claimsState extends State<claims> {
5), // Adjust space between icon and text 5), // Adjust space between icon and text
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Claims assistance', 'Claims Assistance',
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 16, fontSize: 16,
@ -385,7 +390,8 @@ class _claimsState extends State<claims> {
'Contact Us', 'Contact Us',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 12, : 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -428,7 +434,8 @@ class _claimsState extends State<claims> {
elevation: 0, elevation: 0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: Color(0xFFD9D9D9), // Set the border color here color:
Color(0xFFD9D9D9), // Set the border color here
width: 1.0, // Set the border width here width: 1.0, // Set the border width here
), ),
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
@ -465,7 +472,8 @@ class _claimsState extends State<claims> {
'Know how to file a claim', 'Know how to file a claim',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 12, : 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -498,14 +506,16 @@ class _claimsState extends State<claims> {
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Color(
Color(0xFFF6FAFF), // Set background color for the container 0xFFF6FAFF), // Set background color for the container
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
5), // Set border radius for the container 5), // Set border radius for the container
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 10, bottom: 10, left: 25, right: 25) ? EdgeInsets.only(
: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10), top: 10, bottom: 10, left: 25, right: 25)
: EdgeInsets.only(
top: 10, bottom: 10, left: 10, right: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -538,11 +548,13 @@ class _claimsState extends State<claims> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: TextButton.styleFrom( style: TextButton
.styleFrom(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: Responsive horizontal: Responsive
.isDesktop( .isDesktop(
@ -565,7 +577,8 @@ class _claimsState extends State<claims> {
? 18 ? 18
: 13, : 13,
fontWeight: fontWeight:
FontWeight.w500, FontWeight
.w500,
color: Color( color: Color(
0xFF000000)), 0xFF000000)),
), ),
@ -573,14 +586,17 @@ class _claimsState extends State<claims> {
) )
: Text( : Text(
'Your Plan', 'Your Plan',
style: GoogleFonts.poppins( style:
fontSize: GoogleFonts.poppins(
Responsive.isDesktop( fontSize: Responsive
.isDesktop(
context) context)
? 18 ? 18
: 13, : 13,
fontWeight: FontWeight.w400, fontWeight:
color: Color(0xFF636363), FontWeight.w400,
color:
Color(0xFF636363),
), ),
), ),
), ),
@ -603,11 +619,13 @@ class _claimsState extends State<claims> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: TextButton.styleFrom( style: TextButton
.styleFrom(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: Responsive horizontal: Responsive
.isDesktop( .isDesktop(
@ -623,15 +641,15 @@ class _claimsState extends State<claims> {
), ),
child: Text( child: Text(
'Track claims', 'Track claims',
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: Responsive fontSize: Responsive
.isDesktop( .isDesktop(
context) context)
? 18 ? 18
: 13, : 13,
color: color: Color(
Color(0xFF000000), 0xFF000000),
fontWeight: fontWeight:
FontWeight.w500, FontWeight.w500,
), ),
@ -640,14 +658,17 @@ class _claimsState extends State<claims> {
) )
: Text( : Text(
'Track claims', 'Track claims',
style: GoogleFonts.poppins( style:
fontSize: GoogleFonts.poppins(
Responsive.isDesktop( fontSize: Responsive
.isDesktop(
context) context)
? 18 ? 18
: 13, : 13,
fontWeight: FontWeight.w400, fontWeight:
color: Color(0xFF636363), FontWeight.w400,
color:
Color(0xFF636363),
), ),
), ),
), ),
@ -749,8 +770,7 @@ class _claimsState extends State<claims> {
], ],
initialIndex: 1, // Initial index of the bottom navigation bar initialIndex: 1, // Initial index of the bottom navigation bar
), ),
) ));
);
} }
List<Widget> generateYourPlanList(List<dynamic> data) { List<Widget> generateYourPlanList(List<dynamic> data) {

View File

@ -67,7 +67,6 @@ class _generalExclusionsDeductiblesState
final session = SessionManager(); final session = SessionManager();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -96,8 +95,6 @@ class _generalExclusionsDeductiblesState
} }
} }
Future<void> getCashlessAndReimbursement() async { Future<void> getCashlessAndReimbursement() async {
final response = await apiService.getCashlessAndReimbursementToApi(); final response = await apiService.getCashlessAndReimbursementToApi();
print('check 1'); print('check 1');
@ -201,9 +198,10 @@ class _generalExclusionsDeductiblesState
context.pop(); context.pop();
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
if (!Responsive.isDesktop(context)) // if (!Responsive.isDesktop(context))
Icon( Icon(
Icons.chevron_left, Icons.chevron_left,
color: Color(0xFF000000), color: Color(0xFF000000),
@ -258,8 +256,9 @@ class _generalExclusionsDeductiblesState
Text( Text(
type3SectionName ?? '', type3SectionName ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize: Responsive.isDesktop(context)
Responsive.isDesktop(context) ? 18 : 16, ? 18
: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
@ -269,9 +268,11 @@ class _generalExclusionsDeductiblesState
), ),
if (generalExclusionsDetails != null) if (generalExclusionsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 10), SizedBox(height: 10),
LayoutBuilder( LayoutBuilder(
@ -280,7 +281,8 @@ class _generalExclusionsDeductiblesState
50; // Adjust item height based on content 50; // Adjust item height based on content
double listViewHeight = double listViewHeight =
type3Content.length * itemHeight; type3Content.length * itemHeight;
double maxHeight = constraints.maxHeight; double maxHeight =
constraints.maxHeight;
if (listViewHeight > maxHeight) { if (listViewHeight > maxHeight) {
listViewHeight = maxHeight; listViewHeight = maxHeight;
@ -293,41 +295,43 @@ class _generalExclusionsDeductiblesState
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = type3Content.keys String key = type3Content.keys
.elementAt(index); .elementAt(index);
String value = type3Content[key]!; String value =
type3Content[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(vertical: 8.0),
vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFFE26728), 0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFF000000), 0xFF000000),
), ),
), ),
), ),
@ -362,8 +366,9 @@ class _generalExclusionsDeductiblesState
Text( Text(
type4SectionName ?? '', type4SectionName ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize: Responsive.isDesktop(context)
Responsive.isDesktop(context) ? 18 : 16, ? 18
: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF000000), color: Color(0xFF000000),
), ),
@ -373,14 +378,17 @@ class _generalExclusionsDeductiblesState
), ),
if (generalExclusionsDetails != null) if (generalExclusionsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
type4Heading ?? '', type4Heading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -394,7 +402,8 @@ class _generalExclusionsDeductiblesState
40; // Adjust item height based on content 40; // Adjust item height based on content
double listViewHeight = double listViewHeight =
type4Content.length * itemHeight; type4Content.length * itemHeight;
double maxHeight = constraints.maxHeight; double maxHeight =
constraints.maxHeight;
if (listViewHeight > maxHeight) { if (listViewHeight > maxHeight) {
listViewHeight = maxHeight; listViewHeight = maxHeight;
@ -407,41 +416,43 @@ class _generalExclusionsDeductiblesState
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = type4Content.keys String key = type4Content.keys
.elementAt(index); .elementAt(index);
String value = type4Content[key]!; String value =
type4Content[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(vertical: 8.0),
vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFFE26728), 0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFF000000), 0xFF000000),
), ),
), ),
), ),
@ -470,14 +481,17 @@ class _generalExclusionsDeductiblesState
children: [ children: [
if (generalExclusionsDetails != null) if (generalExclusionsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
type5Heading ?? '', type5Heading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -491,7 +505,8 @@ class _generalExclusionsDeductiblesState
40; // Adjust item height based on content 40; // Adjust item height based on content
double listViewHeight = double listViewHeight =
type5Content.length * itemHeight; type5Content.length * itemHeight;
double maxHeight = constraints.maxHeight; double maxHeight =
constraints.maxHeight;
if (listViewHeight > maxHeight) { if (listViewHeight > maxHeight) {
listViewHeight = maxHeight; listViewHeight = maxHeight;
@ -504,41 +519,43 @@ class _generalExclusionsDeductiblesState
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = type5Content.keys String key = type5Content.keys
.elementAt(index); .elementAt(index);
String value = type5Content[key]!; String value =
type5Content[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(vertical: 8.0),
vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFFE26728), 0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFF000000), 0xFF000000),
), ),
), ),
), ),
@ -567,14 +584,17 @@ class _generalExclusionsDeductiblesState
children: [ children: [
if (generalExclusionsDetails != null) if (generalExclusionsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
type6Heading ?? '', type6Heading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -588,7 +608,8 @@ class _generalExclusionsDeductiblesState
40; // Adjust item height based on content 40; // Adjust item height based on content
double listViewHeight = double listViewHeight =
type6Content.length * itemHeight; type6Content.length * itemHeight;
double maxHeight = constraints.maxHeight; double maxHeight =
constraints.maxHeight;
if (listViewHeight > maxHeight) { if (listViewHeight > maxHeight) {
listViewHeight = maxHeight; listViewHeight = maxHeight;
@ -601,41 +622,43 @@ class _generalExclusionsDeductiblesState
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = type6Content.keys String key = type6Content.keys
.elementAt(index); .elementAt(index);
String value = type6Content[key]!; String value =
type6Content[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(vertical: 8.0),
vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFFE26728), 0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFF000000), 0xFF000000),
), ),
), ),
), ),
@ -664,14 +687,17 @@ class _generalExclusionsDeductiblesState
children: [ children: [
if (generalExclusionsDetails != null) if (generalExclusionsDetails != null)
Padding( Padding(
padding: EdgeInsets.only(bottom: 20, left: 15), padding:
EdgeInsets.only(bottom: 20, left: 15),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
type7Heading ?? '', type7Heading ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 16, : 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -685,7 +711,8 @@ class _generalExclusionsDeductiblesState
40; // Adjust item height based on content 40; // Adjust item height based on content
double listViewHeight = double listViewHeight =
type7Content.length * itemHeight; type7Content.length * itemHeight;
double maxHeight = constraints.maxHeight; double maxHeight =
constraints.maxHeight;
if (listViewHeight > maxHeight) { if (listViewHeight > maxHeight) {
listViewHeight = maxHeight; listViewHeight = maxHeight;
@ -698,41 +725,43 @@ class _generalExclusionsDeductiblesState
itemBuilder: (context, index) { itemBuilder: (context, index) {
String key = type7Content.keys String key = type7Content.keys
.elementAt(index); .elementAt(index);
String value = type7Content[key]!; String value =
type7Content[key]!;
return Padding( return Padding(
padding: padding: const EdgeInsets
const EdgeInsets.symmetric( .symmetric(vertical: 8.0),
vertical: 8.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding:
const EdgeInsets.only( const EdgeInsets
.only(
left: 20.0), left: 20.0),
child: Text( child: Text(
"", "",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFFE26728), 0xFFE26728),
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
value, value,
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
FontWeight.w400, FontWeight.w400,
color: color: Color(
Color(0xFF000000), 0xFF000000),
), ),
), ),
), ),
@ -811,7 +840,6 @@ class _generalExclusionsDeductiblesState
"Wellness", "Wellness",
], ],
), ),
) ));
);
} }
} }

View File

@ -326,7 +326,8 @@ class _helpState extends State<help> {
child: Column(children: [ child: Column(children: [
Container( Container(
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 15, bottom: 15, left: 25, right: 25) ? EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25)
: EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0), : EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -338,7 +339,7 @@ class _helpState extends State<help> {
flex: 12, flex: 12,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
context.pop(); context.push('/claims');
// Navigator.pushNamed(context, 'home'); // Navigator.pushNamed(context, 'home');
}, },
child: Row( child: Row(
@ -365,7 +366,8 @@ class _helpState extends State<help> {
alignment: Alignment.center, alignment: Alignment.center,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
SvgPicture.string( SvgPicture.string(
SvgService.getSvg('help'), SvgService.getSvg('help'),
@ -384,11 +386,14 @@ class _helpState extends State<help> {
if (accountManagerDetails != null) if (accountManagerDetails != null)
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, // Set background color for the container color: Colors
.white, // Set background color for the container
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10) ? EdgeInsets.only(
: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), top: 10, bottom: 10, left: 10, right: 10)
: EdgeInsets.only(
top: 5, bottom: 5, left: 10, right: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -418,7 +423,8 @@ class _helpState extends State<help> {
Row( Row(
mainAxisAlignment: MainAxisAlignment mainAxisAlignment: MainAxisAlignment
.center, // Center align the row .center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -431,7 +437,8 @@ class _helpState extends State<help> {
), ),
), ),
SizedBox( SizedBox(
width: 10), // Space between icon and text width:
10), // Space between icon and text
GestureDetector( GestureDetector(
onTap: () { onTap: () {
_openEmail(accountManagerEmail); _openEmail(accountManagerEmail);
@ -439,7 +446,8 @@ class _helpState extends State<help> {
child: Text( child: Text(
accountManagerEmail ?? '', accountManagerEmail ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 16 ? 16
: 14, : 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -453,7 +461,8 @@ class _helpState extends State<help> {
Row( Row(
mainAxisAlignment: MainAxisAlignment mainAxisAlignment: MainAxisAlignment
.center, // Center align the row .center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -466,7 +475,8 @@ class _helpState extends State<help> {
), ),
), ),
SizedBox( SizedBox(
width: 10), // Space between icon and text width:
10), // Space between icon and text
GestureDetector( GestureDetector(
onTap: () { onTap: () {
_openDialPad(accountManagerMobileNo); _openDialPad(accountManagerMobileNo);
@ -474,7 +484,8 @@ class _helpState extends State<help> {
child: Text( child: Text(
accountManagerMobileNo ?? '', accountManagerMobileNo ?? '',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 16 ? 16
: 14, : 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -498,7 +509,8 @@ class _helpState extends State<help> {
// ? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30) // ? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30)
// : EdgeInsets.only(top: 5, bottom: 5,left: 10,right: 10), // : EdgeInsets.only(top: 5, bottom: 5,left: 10,right: 10),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30) ? EdgeInsets.only(
top: 20, bottom: 20, left: 30, right: 30)
: EdgeInsets.symmetric(vertical: 5, horizontal: 10), : EdgeInsets.symmetric(vertical: 5, horizontal: 10),
child: Row( child: Row(
children: [ children: [
@ -893,8 +905,6 @@ class _helpState extends State<help> {
// ), // ),
// // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70), // // SizedBox(height: Responsive.isDesktop(context) ? 40 : 70),
// if (ticketsActive == 0) // if (ticketsActive == 0)
// if (ticketList == null || ticketList.isEmpty) // if (ticketList == null || ticketList.isEmpty)
// Card( // Card(
@ -1067,8 +1077,7 @@ class _helpState extends State<help> {
], ],
initialIndex: 3, // Initial index of the bottom navigation bar initialIndex: 3, // Initial index of the bottom navigation bar
), ),
) ));
);
} }
List<Widget> generateClaimsList(List<dynamic> data) { List<Widget> generateClaimsList(List<dynamic> data) {
@ -1561,7 +1570,6 @@ class _helpState extends State<help> {
context.go('/tickettracklist', extra: item['thz_id']); context.go('/tickettracklist', extra: item['thz_id']);
// Navigator.pushNamed( // Navigator.pushNamed(
// context, // context,
// 'claimtracklist', // 'claimtracklist',

View File

@ -1,7 +1,8 @@
import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'dart:html' as html;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -30,10 +31,10 @@ import 'chatbot.dart';
// import 'dart:html' as html; // import 'dart:html' as html;
import '/pages/helpers/botman_stub.dart' import '/pages/helpers/botman_stub.dart'
if (dart.library.html) '/pages/helpers/botman_web.dart'; if (dart.library.html) '/pages/helpers/botman_web.dart';
import '/../pages/helpers/mobile_helpers.dart' import '/../pages/helpers/mobile_helpers.dart'
if (dart.library.html) '/../pages/helpers/web_helpers.dart'; if (dart.library.html) '/../pages/helpers/web_helpers.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart'; import 'package:webview_flutter_android/webview_flutter_android.dart';
class Home extends StatefulWidget { class Home extends StatefulWidget {
@ -45,6 +46,7 @@ class Home extends StatefulWidget {
class _HomeState extends State<Home> { class _HomeState extends State<Home> {
bool _dialogShown = false; bool _dialogShown = false;
late StreamSubscription<html.PopStateEvent> _popStateListener;
bool isLoadingGif = false; bool isLoadingGif = false;
late ApiService apiService; late ApiService apiService;
int _currentIndex = 0; int _currentIndex = 0;
@ -60,7 +62,7 @@ class _HomeState extends State<Home> {
dynamic policyHeading; dynamic policyHeading;
dynamic policyName; dynamic policyName;
dynamic EmployeePolicy; dynamic EmployeePolicy;
dynamic emp_name; dynamic emp_name = '';
dynamic pre_policy_count; dynamic pre_policy_count;
dynamic client_branch_id; dynamic client_branch_id;
dynamic mobileNo; dynamic mobileNo;
@ -88,7 +90,7 @@ class _HomeState extends State<Home> {
// 🔹 Load ads // 🔹 Load ads
// dataManager.loadAdvertisementImages(); // dataManager.loadAdvertisementImages();
if(kIsWeb){ if (kIsWeb) {
getAdvertisementSliderImage(); getAdvertisementSliderImage();
} else { } else {
advertisementImages = DataManager().advertisementImages; advertisementImages = DataManager().advertisementImages;
@ -118,11 +120,6 @@ class _HomeState extends State<Home> {
); );
print('loadSelfEmployeeProfile'); print('loadSelfEmployeeProfile');
// if (kIsWeb) { // if (kIsWeb) {
// openBotmanChat(); // openBotmanChat();
// } // }
@ -189,6 +186,9 @@ class _HomeState extends State<Home> {
final preToken = TokenService.getPreToken(); final preToken = TokenService.getPreToken();
print('preToken'); print('preToken');
print(preToken); print(preToken);
WidgetsBinding.instance.addPostFrameCallback((_) {
checkbackbutton();
});
setState(() { setState(() {
isTokenAvailable = preToken != null; isTokenAvailable = preToken != null;
}); });
@ -411,9 +411,22 @@ class _HomeState extends State<Home> {
); );
} }
void checkbackbutton() async {
// Push a dummy state so back button triggers popstate instead of navigating
html.window.history.pushState(null, 'home', html.window.location.href);
_popStateListener = html.window.onPopState.listen((event) {
if (!_dialogShown && mounted) {
_showBackConfirmationDialog();
}
// Re-push to prevent leaving
html.window.history.pushState(null, 'home', html.window.location.href);
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!Responsive.isDesktop(context)) if (!Responsive.isDesktop(context))
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Color(0xFFFFFBDE), // Status bar color statusBarColor: Color(0xFFFFFBDE), // Status bar color
@ -421,10 +434,14 @@ class _HomeState extends State<Home> {
)); ));
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvokedWithResult: (didPop, result) { onPopInvoked: (didPop) {
if (didPop) return; if (didPop) return;
_showExitConfirmation(context); _showExitConfirmation(context);
}, },
// onPopInvokedWithResult: (didPop, result) {
// if (didPop) return;
// _showExitConfirmation(context);
// },
child: Scaffold( child: Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: CustomAppBar(), appBar: CustomAppBar(),
@ -459,7 +476,8 @@ class _HomeState extends State<Home> {
'Hello, $emp_name!', 'Hello, $emp_name!',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 20 ? 20
: 20, : 20,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -520,8 +538,9 @@ class _HomeState extends State<Home> {
'Policies for enrollment : $pre_policy_count', 'Policies for enrollment : $pre_policy_count',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize: Responsive.isDesktop(context)
Responsive.isDesktop(context) ? 18 : 12, ? 18
: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF404040), color: Color(0xFF404040),
), ),
@ -667,7 +686,8 @@ class _HomeState extends State<Home> {
'Your Policies', 'Your Policies',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context) fontSize:
Responsive.isDesktop(context)
? 18 ? 18
: 18, : 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -694,14 +714,16 @@ class _HomeState extends State<Home> {
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Color(
Color(0xFFEEF5FF), // Set background color for the container 0xFFEEF5FF), // Set background color for the container
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
5), // Set border radius for the container 5), // Set border radius for the container
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 10, bottom: 10, left: 25, right: 25) ? EdgeInsets.only(
: EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10), top: 10, bottom: 10, left: 25, right: 25)
: EdgeInsets.only(
top: 10, bottom: 10, left: 10, right: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -733,17 +755,19 @@ class _HomeState extends State<Home> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: SizedBox( child: SizedBox(
width: Responsive.isDesktop( width: Responsive
.isDesktop(
context) context)
? 400 ? 400
: 150, // Set the width here : 150, // Set the width here
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: style: TextButton
TextButton.styleFrom( .styleFrom(
padding: EdgeInsets padding: EdgeInsets
.symmetric( .symmetric(
vertical: Responsive vertical: Responsive
@ -754,6 +778,25 @@ class _HomeState extends State<Home> {
), ),
), ),
child: Text( child: Text(
'Active',
style: GoogleFonts
.poppins(
fontSize: Responsive
.isDesktop(
context)
? 18
: 13,
fontWeight:
FontWeight
.w500,
color: Color(
0xFF593AFF),
),
),
),
),
)
: Text(
'Active', 'Active',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
@ -763,24 +806,9 @@ class _HomeState extends State<Home> {
? 18 ? 18
: 13, : 13,
fontWeight: fontWeight:
FontWeight.w500, FontWeight.w400,
color: color:
Color(0xFF593AFF), Color(0xFF636363),
),
),
),
),
)
: Text(
'Active',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(
context)
? 18
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
), ),
), ),
), ),
@ -802,17 +830,19 @@ class _HomeState extends State<Home> {
? Material( ? Material(
elevation: 5, elevation: 5,
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(
10),
color: Colors.white, color: Colors.white,
child: SizedBox( child: SizedBox(
width: Responsive.isDesktop( width: Responsive
.isDesktop(
context) context)
? 400 ? 400
: 150, // Set the width here : 150, // Set the width here
child: TextButton( child: TextButton(
onPressed: () {}, onPressed: () {},
style: style: TextButton
TextButton.styleFrom( .styleFrom(
padding: EdgeInsets padding: EdgeInsets
.symmetric( .symmetric(
vertical: Responsive vertical: Responsive
@ -823,6 +853,25 @@ class _HomeState extends State<Home> {
), ),
), ),
child: Text( child: Text(
'Inactive',
style: GoogleFonts
.poppins(
fontSize: Responsive
.isDesktop(
context)
? 18
: 13,
fontWeight:
FontWeight
.w500,
color: Color(
0xFF593AFF),
),
),
),
),
)
: Text(
'Inactive', 'Inactive',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
@ -832,24 +881,9 @@ class _HomeState extends State<Home> {
? 18 ? 18
: 13, : 13,
fontWeight: fontWeight:
FontWeight.w500, FontWeight.w400,
color: color:
Color(0xFF593AFF), Color(0xFF636363),
),
),
),
),
)
: Text(
'Inactive',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(
context)
? 18
: 13,
fontWeight: FontWeight.w400,
color: Color(0xFF636363),
), ),
), ),
), ),
@ -1222,28 +1256,67 @@ class _HomeState extends State<Home> {
SizedBox(height: 7), SizedBox(height: 7),
Row( Row(
children: [ children: [
Expanded( Flexible(
flex: 12, child: Container(
// color: Colors.red,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Tooltip(
message: '$memberNames',
child: Text(
memberNames ?? '', memberNames ?? '',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( maxLines: 1,
fontSize: overflow:
Responsive.isDesktop( TextOverflow.ellipsis,
softWrap: false,
style:
GoogleFonts.poppins(
fontSize: Responsive
.isDesktop(
context) context)
? 14 ? 14
: 13, : 13,
fontWeight: FontWeight.w400, fontWeight:
color: Color(0xFF000000), FontWeight.w400,
color: const Color(
0xFF000000),
),
), ),
), ),
], ],
), ),
), ),
),
// Expanded(
// flex: 1,
// child: Container(
// color: Colors.red,
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Text(
// memberNames ?? '',
// textAlign: TextAlign.left,
// style: GoogleFonts.poppins(
// fontSize:
// Responsive.isDesktop(
// context)
// ? 14
// : 13,
// fontWeight:
// FontWeight.w400,
// color: Color(0xFF000000),
// ),
// ),
// ],
// ),
// ),
// ),
], ],
), ),
SizedBox(height: 7), SizedBox(height: 7),

View File

@ -779,44 +779,17 @@ class _profileState extends State<profile> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Container( Container(
// color: Colors.amberAccent,
width: MediaQuery.of(context).size.width,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Expanded( Responsive.isDesktop(context)
flex: 12, ? _buildLogoutButton(context)
child: Container( : Expanded(
width: 150, flex: 12, child: _buildLogoutButton(context)),
// height: Responsive.isDesktop(context) ? 150 : 100,
alignment: Alignment.center,
child: ElevatedButton(
onPressed: () {
logout(context);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.logout,
color: Color(0xFFE26728),
),
SizedBox(
width:
8), // Adjust space between icon and text
Text(
'Logout',
style: GoogleFonts.poppins(
color: Color(0xFFE26728)),
),
],
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
side: BorderSide(color: Color(0xFFE26728)),
),
),
),
)),
], ],
), ),
), ),
@ -935,4 +908,31 @@ class _profileState extends State<profile> {
), ),
)); ));
} }
Widget _buildLogoutButton(BuildContext context) {
return Container(
alignment: Alignment.center,
child: ElevatedButton(
onPressed: () => logout(context),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
side: const BorderSide(color: Color(0xFFE26728)),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.logout, color: Color(0xFFE26728)),
const SizedBox(width: 8),
Text(
'Logout',
style: GoogleFonts.poppins(color: const Color(0xFFE26728)),
),
],
),
),
);
}
} }

View File

@ -109,7 +109,6 @@ class _ticketsState extends State<tickets> {
} }
} }
Future<void> getActiveAndInactivePolicyDetails() async { Future<void> getActiveAndInactivePolicyDetails() async {
if (client_id == null || empCodeString == null) { if (client_id == null || empCodeString == null) {
return; return;
@ -213,8 +212,7 @@ class _ticketsState extends State<tickets> {
print('Check One'); print('Check One');
Map<String, dynamic> formData = { Map<String, dynamic> formData = {
'email': decodedToken?['email_corporate'], 'email': decodedToken?['email_corporate'],
'empcode': 'empcode': decodedToken?['emp_code'],
decodedToken?['emp_code'],
'message': messageController.text, 'message': messageController.text,
'mobile': decodedToken?['mobile'], 'mobile': decodedToken?['mobile'],
'name': decodedToken?['name'], 'name': decodedToken?['name'],
@ -296,7 +294,8 @@ class _ticketsState extends State<tickets> {
15.0), // Set border radius for Container 15.0), // Set border radius for Container
), ),
padding: Responsive.isDesktop(context) padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15) ? EdgeInsets.only(
top: 15, bottom: 15, left: 15, right: 15)
: EdgeInsets.only( : EdgeInsets.only(
top: 10, top: 10,
bottom: 10, bottom: 10,
@ -332,14 +331,14 @@ class _ticketsState extends State<tickets> {
right: 10), right: 10),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex: 1, // flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
context.go('/help'); context.go('/help');
@ -355,22 +354,26 @@ class _ticketsState extends State<tickets> {
Expanded( Expanded(
flex: 11, flex: 11,
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: Responsive
Responsive.isDesktop(context) .isDesktop(context)
? MainAxisAlignment.center ? MainAxisAlignment.start
: MainAxisAlignment.start, : MainAxisAlignment.start,
children: [ children: [
Text( Text(
'Raise a Query', 'Raise a Query',
textAlign: TextAlign.start, textAlign:
style: GoogleFonts.poppins( TextAlign.start,
fontSize: style:
Responsive.isDesktop( GoogleFonts.poppins(
fontSize: Responsive
.isDesktop(
context) context)
? 20 ? 20
: 16, : 16,
fontWeight: FontWeight.w600, fontWeight:
color: Color(0xFF000000), FontWeight.w600,
color:
Color(0xFF000000),
), ),
) )
], ],
@ -422,9 +425,11 @@ class _ticketsState extends State<tickets> {
serList[ serList[
'id'] == 'id'] ==
value, value,
orElse: () => orElse:
() =>
{ {
'name': '' 'name':
''
}, },
)['name']; )['name'];
isServiceValid = isServiceValid =
@ -457,7 +462,8 @@ class _ticketsState extends State<tickets> {
String>( String>(
'Policy Number', 'Policy Number',
(value) { (value) {
setState(() { setState(
() {
policyNumberId = policyNumberId =
value; value;
isPolicyValid = isPolicyValid =
@ -475,8 +481,8 @@ class _ticketsState extends State<tickets> {
Text( Text(
'Please select a policy', 'Please select a policy',
style: TextStyle( style: TextStyle(
color: Colors color:
.red)), Colors.red)),
], ],
), ),
SizedBox(height: 15), SizedBox(height: 15),
@ -492,8 +498,8 @@ class _ticketsState extends State<tickets> {
Text( Text(
'Please enter the Subject', 'Please enter the Subject',
style: TextStyle( style: TextStyle(
color: Colors color:
.red)), Colors.red)),
SizedBox( SizedBox(
height: 15), height: 15),
buildTextAreaField( buildTextAreaField(
@ -503,8 +509,8 @@ class _ticketsState extends State<tickets> {
Text( Text(
'Please enter the Message', 'Please enter the Message',
style: TextStyle( style: TextStyle(
color: Colors color:
.red)), Colors.red)),
]), ]),
], ],
), ),
@ -520,23 +526,28 @@ class _ticketsState extends State<tickets> {
Expanded( Expanded(
flex: 12, flex: 12,
child: Container( child: Container(
alignment: Alignment.centerRight, alignment:
Alignment.centerRight,
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
sendFormDataToApi(); sendFormDataToApi();
}, },
child: Text( child: Text(
'Send', 'Send',
style: GoogleFonts.poppins( style:
color: Colors.white), GoogleFonts.poppins(
color:
Colors.white),
), ),
style: ElevatedButton.styleFrom( style: ElevatedButton
.styleFrom(
backgroundColor: backgroundColor:
Color(0xFFE26728), Color(0xFFE26728),
shape: RoundedRectangleBorder( shape:
RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
5), .circular(5),
), ),
), ),
), ),
@ -625,8 +636,7 @@ class _ticketsState extends State<tickets> {
], ],
initialIndex: 3, // Initial index of the bottom navigation bar initialIndex: 3, // Initial index of the bottom navigation bar
), ),
) ));
);
} }
Widget buildTextField(String label, TextEditingController controller, Widget buildTextField(String label, TextEditingController controller,