CHANGE_
This commit is contained in:
parent
76ba68f022
commit
f7edbd6a99
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,9 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:nhance_app_pwa/customAppBar/enrollmentAppBar.dart';
|
||||
import 'package:nhance_app_pwa/pages/enrollment/service/api_service.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../customAppBar/customFooter.dart';
|
||||
import '../../customAppBar/responsive.dart';
|
||||
import '../../customAppBar/tabs.dart';
|
||||
import '../../customAppBar/toastHelper.dart';
|
||||
import '../../models/environment.dart';
|
||||
import 'package:jwt_decode/jwt_decode.dart';
|
||||
@ -16,6 +18,7 @@ import 'package:intl/intl.dart';
|
||||
import 'dart:io';
|
||||
import 'dart:async';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../postEnrollment/chatbot.dart';
|
||||
|
||||
class empDetails extends StatefulWidget {
|
||||
const empDetails({Key? key}) : super(key: key);
|
||||
@ -707,8 +710,8 @@ class _empDetailsState extends State<empDetails> {
|
||||
if (loadingProgress == null) return child;
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress
|
||||
.expectedTotalBytes !=
|
||||
value:
|
||||
loadingProgress.expectedTotalBytes !=
|
||||
null
|
||||
? loadingProgress
|
||||
.cumulativeBytesLoaded /
|
||||
@ -776,8 +779,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 8,
|
||||
@ -804,8 +806,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
children: [
|
||||
Text(
|
||||
'Group Personal Accident Coverage ',
|
||||
textAlign:
|
||||
TextAlign.left,
|
||||
textAlign: TextAlign.left,
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
@ -842,8 +843,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
SystemMouseCursors
|
||||
.click,
|
||||
child: Icon(
|
||||
Icons
|
||||
.file_download,
|
||||
Icons.file_download,
|
||||
color: Color(
|
||||
0xFFE26728),
|
||||
size: 25,
|
||||
@ -884,8 +884,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -907,9 +906,8 @@ class _empDetailsState extends State<empDetails> {
|
||||
// )),
|
||||
// ),
|
||||
SizedBox(
|
||||
height: Responsive.isDesktop(context)
|
||||
? 15
|
||||
: 15),
|
||||
height:
|
||||
Responsive.isDesktop(context) ? 15 : 15),
|
||||
// Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color: Color(
|
||||
@ -970,13 +968,9 @@ class _empDetailsState extends State<empDetails> {
|
||||
left: 25,
|
||||
right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 8,
|
||||
bottom: 8,
|
||||
left: 10,
|
||||
right: 10),
|
||||
top: 8, bottom: 8, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: Responsive.isDesktop(context)
|
||||
@ -991,8 +985,8 @@ class _empDetailsState extends State<empDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: Responsive
|
||||
.isDesktop(context)
|
||||
padding: Responsive.isDesktop(
|
||||
context)
|
||||
? EdgeInsets.all(10)
|
||||
: EdgeInsets.all(
|
||||
5), // Padding around the icon
|
||||
@ -1034,8 +1028,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
context)
|
||||
? 18
|
||||
: 16,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@ -1062,16 +1055,15 @@ class _empDetailsState extends State<empDetails> {
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
MouseRegion(
|
||||
cursor: SystemMouseCursors
|
||||
.click,
|
||||
cursor:
|
||||
SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
openSelfForm('View');
|
||||
},
|
||||
child: Text(
|
||||
'View',
|
||||
textAlign:
|
||||
TextAlign.left,
|
||||
textAlign: TextAlign.left,
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
@ -1138,8 +1130,7 @@ class _empDetailsState extends State<empDetails> {
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color(0xFFE26728),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(5),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -1148,13 +1139,14 @@ class _empDetailsState extends State<empDetails> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0xFFFFFCE5), // Semi-transparent background
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
@ -1163,7 +1155,58 @@ class _empDetailsState extends State<empDetails> {
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
]));
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
floatingActionButton: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButton(
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => chatbot()),
|
||||
),
|
||||
child: Icon(Icons.chat),
|
||||
),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// Add your navigation logic here
|
||||
// For example:
|
||||
if (index == 0) {
|
||||
Navigator.pushNamed(context, 'home');
|
||||
} else if (index == 1) {
|
||||
Navigator.pushNamed(context, 'claims');
|
||||
} else if (index == 2) {
|
||||
Navigator.pushNamed(context, 'profile');
|
||||
} else if (index == 3) {
|
||||
Navigator.pushNamed(context, 'help');
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claim",
|
||||
"Profile",
|
||||
"Help",
|
||||
],
|
||||
initialIndex: 0, // Initial index of the bottom navigation bar
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -12,8 +12,11 @@ import 'package:flutter/services.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../customAppBar/customFooter.dart';
|
||||
import '../../customAppBar/responsive.dart';
|
||||
import '../../customAppBar/tabs.dart';
|
||||
import '../../customAppBar/toastHelper.dart';
|
||||
import '../postEnrollment/chatbot.dart';
|
||||
|
||||
class empReviewDetails extends StatefulWidget {
|
||||
const empReviewDetails({Key? key}) : super(key: key);
|
||||
@ -24,6 +27,7 @@ class empReviewDetails extends StatefulWidget {
|
||||
|
||||
class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
late ApiService apiService;
|
||||
bool isLoading = true;
|
||||
bool isChecked = false; // Declare the _isSwitched variable here
|
||||
dynamic _token;
|
||||
dynamic empCodeString;
|
||||
@ -123,6 +127,11 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
super.initState();
|
||||
apiService = ApiService(context); // Initialize ApiService here
|
||||
_loadToken();
|
||||
Future.delayed(Duration(seconds: 3), () {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@ -332,7 +341,7 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
setState(() {
|
||||
gpaDataIsEmpty = 0;
|
||||
});
|
||||
ToastHelper.showWarningToast(context, 'No data found');
|
||||
// ToastHelper.showWarningToast(context, 'No data found');
|
||||
print('No data found in the response');
|
||||
}
|
||||
} else {
|
||||
@ -617,6 +626,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
}
|
||||
|
||||
Future<void> sendAddOnAPI() async {
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
if (addOnsDependentMappedFamilyFloatersArray != null) {
|
||||
dynamic getDependentTrueObjects = addOnsDependentMappedFamilyFloatersArray
|
||||
.where((element) => element['is_value_exist'] == true)
|
||||
@ -688,14 +700,24 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
final response = await apiService.sendAddOnToAPI(apiParams);
|
||||
|
||||
if (response['status'] == 'success') {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
isChecked = false;
|
||||
});
|
||||
print('response.statusCode == 200');
|
||||
ToastHelper.showSuccessToast(context, 'Saved Successfully...');
|
||||
} else {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
// Handle other status codes
|
||||
ToastHelper.showErrorToast(context, 'Failed to Save');
|
||||
print('Request failed with status: ${response['code']}');
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
// Handle exceptions
|
||||
print('Exception occurred: $e');
|
||||
}
|
||||
@ -726,7 +748,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
} else {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(),
|
||||
body: SingleChildScrollView(
|
||||
body: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.symmetric(
|
||||
@ -771,17 +794,19 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
if (loadingProgress == null) return child;
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress.expectedTotalBytes !=
|
||||
value:
|
||||
loadingProgress.expectedTotalBytes !=
|
||||
null
|
||||
? loadingProgress
|
||||
.cumulativeBytesLoaded /
|
||||
loadingProgress.expectedTotalBytes!
|
||||
loadingProgress
|
||||
.expectedTotalBytes!
|
||||
: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
errorBuilder: (BuildContext context, Object error,
|
||||
StackTrace? stackTrace) {
|
||||
errorBuilder: (BuildContext context,
|
||||
Object error, StackTrace? stackTrace) {
|
||||
return Image.asset(
|
||||
'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path
|
||||
width: 80,
|
||||
@ -798,7 +823,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
clientName ?? '',
|
||||
textAlign: TextAlign.right,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(context) ? 20 : 18,
|
||||
fontSize:
|
||||
Responsive.isDesktop(context) ? 20 : 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@ -815,7 +841,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
width: double.infinity,
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.all(30)
|
||||
: EdgeInsets.all(10), // Add padding to the container
|
||||
: EdgeInsets.all(
|
||||
10), // Add padding to the container
|
||||
child: Column(children: [
|
||||
Row(
|
||||
children: [
|
||||
@ -918,9 +945,15 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 25, right: 25)
|
||||
top: 15,
|
||||
bottom: 15,
|
||||
left: 25,
|
||||
right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -950,9 +983,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
Text(
|
||||
'Group Personal Accident Coverage',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
@ -960,7 +994,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if (gpaECardDownload != null)
|
||||
if (gpaECardDownload !=
|
||||
null)
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// Convert the URL string to a Uri object
|
||||
@ -971,7 +1006,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
if (await canLaunchUrl(
|
||||
uri)) {
|
||||
// Open the URL in the default browser
|
||||
await launchUrl(uri);
|
||||
await launchUrl(
|
||||
uri);
|
||||
} else {
|
||||
// Handle the case where the URL cannot be launched
|
||||
print(
|
||||
@ -984,8 +1020,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
.click,
|
||||
child: Icon(
|
||||
Icons.file_download,
|
||||
color:
|
||||
Color(0xFFE26728),
|
||||
color: Color(
|
||||
0xFFE26728),
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
@ -1047,8 +1083,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.arrow_right,
|
||||
color:
|
||||
Color(0xFFE26728)), // Arrow icon
|
||||
color: Color(
|
||||
0xFFE26728)), // Arrow icon
|
||||
SizedBox(
|
||||
width: Responsive.isDesktop(context)
|
||||
? 10
|
||||
@ -1134,9 +1170,15 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 25, right: 25)
|
||||
top: 15,
|
||||
bottom: 15,
|
||||
left: 25,
|
||||
right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -1166,9 +1208,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
Text(
|
||||
'Group Medical Coverage - Top Up',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
@ -1188,7 +1231,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
if (await canLaunchUrl(
|
||||
uri)) {
|
||||
// Open the URL in the default browser
|
||||
await launchUrl(uri);
|
||||
await launchUrl(
|
||||
uri);
|
||||
} else {
|
||||
// Handle the case where the URL cannot be launched
|
||||
print(
|
||||
@ -1201,8 +1245,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
.click,
|
||||
child: Icon(
|
||||
Icons.file_download,
|
||||
color:
|
||||
Color(0xFFE26728),
|
||||
color: Color(
|
||||
0xFFE26728),
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
@ -1270,8 +1314,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.arrow_right,
|
||||
color:
|
||||
Color(0xFFE26728)), // Arrow icon
|
||||
color: Color(
|
||||
0xFFE26728)), // Arrow icon
|
||||
SizedBox(
|
||||
width: Responsive.isDesktop(context)
|
||||
? 10
|
||||
@ -1349,9 +1393,15 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 25, right: 25)
|
||||
top: 15,
|
||||
bottom: 15,
|
||||
left: 25,
|
||||
right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -1381,9 +1431,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
Text(
|
||||
topUpParentTypeName ?? '',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
@ -1403,7 +1454,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
if (await canLaunchUrl(
|
||||
uri)) {
|
||||
// Open the URL in the default browser
|
||||
await launchUrl(uri);
|
||||
await launchUrl(
|
||||
uri);
|
||||
} else {
|
||||
// Handle the case where the URL cannot be launched
|
||||
print(
|
||||
@ -1416,8 +1468,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
.click,
|
||||
child: Icon(
|
||||
Icons.file_download,
|
||||
color:
|
||||
Color(0xFFE26728),
|
||||
color: Color(
|
||||
0xFFE26728),
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
@ -1486,8 +1538,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.arrow_right,
|
||||
color:
|
||||
Color(0xFFE26728)), // Arrow icon
|
||||
color: Color(
|
||||
0xFFE26728)), // Arrow icon
|
||||
SizedBox(
|
||||
width: Responsive.isDesktop(context)
|
||||
? 10
|
||||
@ -1565,15 +1617,22 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 15, bottom: 15, left: 25, right: 25)
|
||||
top: 15,
|
||||
bottom: 15,
|
||||
left: 25,
|
||||
right: 25)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex:
|
||||
Responsive.isDesktop(context) ? 9 : 8,
|
||||
flex: Responsive.isDesktop(context)
|
||||
? 9
|
||||
: 8,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Column(
|
||||
@ -1583,7 +1642,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
addOnsDependentPolicyName ?? '',
|
||||
addOnsDependentPolicyName ??
|
||||
'',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
@ -1598,9 +1658,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
Text(
|
||||
'Group Medical Coverage - Dependent AddOns',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
@ -1620,7 +1681,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
if (await canLaunchUrl(
|
||||
uri)) {
|
||||
// Open the URL in the default browser
|
||||
await launchUrl(uri);
|
||||
await launchUrl(
|
||||
uri);
|
||||
} else {
|
||||
// Handle the case where the URL cannot be launched
|
||||
print(
|
||||
@ -1633,8 +1695,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
.click,
|
||||
child: Icon(
|
||||
Icons.file_download,
|
||||
color:
|
||||
Color(0xFFE26728),
|
||||
color: Color(
|
||||
0xFFE26728),
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
@ -1644,8 +1706,9 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
],
|
||||
))),
|
||||
Expanded(
|
||||
flex:
|
||||
Responsive.isDesktop(context) ? 3 : 4,
|
||||
flex: Responsive.isDesktop(context)
|
||||
? 3
|
||||
: 4,
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Column(
|
||||
@ -1655,7 +1718,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
addOnsFloaterTextHeading ?? '',
|
||||
addOnsFloaterTextHeading ??
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
@ -1702,8 +1766,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.arrow_right,
|
||||
color:
|
||||
Color(0xFFE26728)), // Arrow icon
|
||||
color: Color(
|
||||
0xFFE26728)), // Arrow icon
|
||||
SizedBox(
|
||||
width: Responsive.isDesktop(context)
|
||||
? 10
|
||||
@ -1756,7 +1820,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
'Premium Summary',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 16,
|
||||
@ -1793,10 +1858,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
children: [
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
padding:
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Policy ',
|
||||
textAlign: TextAlign.start,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
@ -1810,10 +1877,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
padding:
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Additional Premium',
|
||||
textAlign: TextAlign.start,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
@ -1827,10 +1896,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
padding:
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'GST',
|
||||
textAlign: TextAlign.start,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
@ -1844,10 +1915,12 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
),
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
padding:
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Total',
|
||||
textAlign: TextAlign.start,
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive
|
||||
.isDesktop(
|
||||
@ -1890,8 +1963,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpSiPremiumValue/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -1910,8 +1983,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpSiPremiumGst/-',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -1930,8 +2003,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpSiTotalAmt/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -1975,8 +2048,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpParentSiPremiumValue/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -1995,8 +2068,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpParentSiPremiumGst/-',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -2015,8 +2088,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$topUpParentSiTotalAmt/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -2060,8 +2133,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$addOnDependentPremiumValue/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -2080,8 +2153,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$addOnsDependentPremiumGst/-',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -2100,8 +2173,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'₹$addOnsDependentTotalAmt/Year',
|
||||
textAlign:
|
||||
Responsive.isDesktop(
|
||||
textAlign: Responsive
|
||||
.isDesktop(
|
||||
context)
|
||||
? TextAlign.start
|
||||
: TextAlign.start,
|
||||
@ -2141,7 +2214,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
'Total Payable',
|
||||
textAlign: TextAlign.left,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 20
|
||||
: 16,
|
||||
@ -2165,7 +2239,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
'₹$totalPayableAmt/Year',
|
||||
textAlign: TextAlign.right,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 16,
|
||||
@ -2216,12 +2291,13 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
children: [
|
||||
Text(
|
||||
'I declare that the information I have provided is true and accurate to the best of my knowledge',
|
||||
textAlign:
|
||||
Responsive.isDesktop(context)
|
||||
textAlign: Responsive.isDesktop(
|
||||
context)
|
||||
? TextAlign.left
|
||||
: TextAlign.start,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: Responsive.isDesktop(
|
||||
fontSize:
|
||||
Responsive.isDesktop(
|
||||
context)
|
||||
? 18
|
||||
: 15,
|
||||
@ -2303,10 +2379,73 @@ class _empReviewDetailsState extends State<empReviewDetails> {
|
||||
],
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 30)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isLoading)
|
||||
Container(
|
||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||
child: Center(
|
||||
child: // Your GIF loader widget
|
||||
Image.asset(
|
||||
height: 60,
|
||||
width: 60,
|
||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||
),
|
||||
),
|
||||
if (Responsive.isDesktop(context))
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
width: double.infinity, // Make the footer full width
|
||||
child: CustomFooter(),
|
||||
),
|
||||
),
|
||||
]),
|
||||
floatingActionButton: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButton(
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => chatbot()),
|
||||
),
|
||||
child: Icon(Icons.chat),
|
||||
),
|
||||
floatingActionButtonLocation: Responsive.isDesktop(context)
|
||||
? null
|
||||
: FloatingActionButtonLocation.miniEndFloat,
|
||||
bottomNavigationBar: Responsive.isDesktop(context)
|
||||
? null
|
||||
: CustomBottomNavigationBar(
|
||||
onTabChanged: (index) {
|
||||
// Add your navigation logic here
|
||||
// For example:
|
||||
if (index == 0) {
|
||||
Navigator.pushNamed(context, 'home');
|
||||
} else if (index == 1) {
|
||||
Navigator.pushNamed(context, 'claims');
|
||||
} else if (index == 2) {
|
||||
Navigator.pushNamed(context, 'profile');
|
||||
} else if (index == 3) {
|
||||
Navigator.pushNamed(context, 'help');
|
||||
}
|
||||
},
|
||||
icons: [
|
||||
Icons.home_outlined,
|
||||
Icons.sticky_note_2_outlined,
|
||||
Icons.person_outline_outlined,
|
||||
Icons.headset_mic_outlined,
|
||||
],
|
||||
labels: [
|
||||
"Home",
|
||||
"Claim",
|
||||
"Profile",
|
||||
"Help",
|
||||
],
|
||||
initialIndex: 0, // Initial index of the bottom navigation bar
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_image_slideshow/flutter_image_slideshow.dart';
|
||||
@ -39,6 +38,7 @@ class _MyAppState extends State<MyApp> {
|
||||
dynamic client_branch_id;
|
||||
List<String> advertisementImages = [];
|
||||
bool isLoading = true;
|
||||
dynamic policyCount;
|
||||
|
||||
void _onTabChanged(int index) {
|
||||
setState(() {
|
||||
@ -98,7 +98,12 @@ class _MyAppState extends State<MyApp> {
|
||||
if (response['status'] == 'success') {
|
||||
setState(() {
|
||||
policyList = response['data'];
|
||||
print('policyList $policyList');
|
||||
emp_name = response['emp_name'];
|
||||
if (status == 'Active') {
|
||||
policyCount = policyList.length;
|
||||
print('policyCount : $policyCount');
|
||||
}
|
||||
});
|
||||
print(policyList);
|
||||
} else {
|
||||
@ -217,6 +222,73 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Card(
|
||||
elevation: 2,
|
||||
color: Color(0xFFDDF3FF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10), // Set the border radius here
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
10), // Apply border radius to the container
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(
|
||||
0xFFDDF3FF), // Set background color for the container
|
||||
borderRadius: BorderRadius.circular(
|
||||
10), // Set border radius for the container
|
||||
),
|
||||
padding: Responsive.isDesktop(context)
|
||||
? EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10)
|
||||
: EdgeInsets.only(
|
||||
top: 10, bottom: 10, left: 10, right: 10),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Policies for enrollment : $policyCount',
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
Responsive.isDesktop(context) ? 18 : 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Color(0xFF404040),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, 'empDetails');
|
||||
},
|
||||
child: Text('View Details'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
if (advertisementImages != null)
|
||||
Container(
|
||||
child: Row(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user