CHANGE_ : Chatbot and bug fix

This commit is contained in:
venbaittech 2024-09-20 17:02:43 +05:30
parent a5d53b6803
commit 82b039deab
25 changed files with 2372 additions and 1882 deletions

2
.env
View File

@ -1,4 +1,4 @@
API_URL=https://dev.venbait.in/nhance/uat/employeeRest/ API_URL=https://dev.venbait.in/nhance/uat/employeeRest/
TICKET_API_URL=https://dev.venbait.in/nhance/helpdesk/uat/api TICKET_API_URL=https://dev.venbait.in/nhance/helpdesk/uat/api
BASE_HREF=/nhance/employee/uat/ BASE_HREF=/nhance/employee/uat/
ENV=production ENV=uat

View File

@ -28,6 +28,10 @@
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"
/> />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>

View File

@ -42,6 +42,10 @@
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>

View File

@ -0,0 +1,87 @@
import 'package:flutter/material.dart';
import 'package:adaptive_navbar/adaptive_navbar.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:nhance_app_pwa/customAppBar/responsive.dart';
class CustomAppBarChatbot extends StatelessWidget
implements PreferredSizeWidget {
@override
Size get preferredSize => Size.fromHeight(kToolbarHeight);
Future<void> logout(BuildContext context) async {
final prefs = await SharedPreferences.getInstance();
final String? token = prefs.getString('token');
if (token != null && token.isNotEmpty) {
await prefs.clear();
Navigator.pushNamed(context, 'phone');
}
}
@override
Widget build(BuildContext context) {
final sw = MediaQuery.of(context).size.width;
final isPoliciesPage = Uri.base.fragment == 'policies';
return ClipRRect(
borderRadius: Responsive.isDesktop(context) || isPoliciesPage
? BorderRadius.zero
: BorderRadius.only(
bottomLeft: Radius.circular(32.0),
bottomRight: Radius.circular(32.0),
),
child: AppBar(
backgroundColor: const Color(0xFFFFFBDE),
elevation: 0, // Set background color for AppBar
toolbarHeight: kToolbarHeight,
titleSpacing: 0.0,
automaticallyImplyLeading: false,
title: Padding(
padding: Responsive.isDesktop(context)
? EdgeInsets.symmetric(horizontal: 16.0)
: EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
// Logo Column
Expanded(
flex: Responsive.isDesktop(context) ? 3 : 9,
child: Row(
mainAxisAlignment: Responsive.isDesktop(context)
? MainAxisAlignment.spaceEvenly
: MainAxisAlignment
.start, // Adjust the alignment as needed
children: [
Container(
margin: EdgeInsets.only(
top: 10, bottom: 10, left: 10, right: 10),
width: Responsive.isDesktop(context) ? 230 : 170,
height: Responsive.isDesktop(context) ? 230 : 170,
child: Image.asset(
'assets/nhance_client_logo.png',
fit: BoxFit.contain, // Adjust the fit as needed
),
),
],
),
),
// AdaptiveNavBar Column
Expanded(
flex: Responsive.isDesktop(context) ? 9 : 3,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Icon(
Icons.close_outlined, // Replace with your desired icon
size: 24.0, // Adjust the icon size
color: Colors.black, // Adjust the icon color
),
),
),
],
),
),
),
);
}
}

View File

@ -18,6 +18,7 @@ import 'package:nhance_app_pwa/pages/postEnrollment/policies.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/privacypolicy.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/privacypolicy.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/profile.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/profile.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/termsofuse.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/termsofuse.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/wellness.dart';
import 'package:nhance_app_pwa/pages/session/SetPinBiometric.dart'; import 'package:nhance_app_pwa/pages/session/SetPinBiometric.dart';
import 'package:nhance_app_pwa/pages/session/authenticationService.dart'; import 'package:nhance_app_pwa/pages/session/authenticationService.dart';
import 'package:nhance_app_pwa/pages/session/changePin.dart'; import 'package:nhance_app_pwa/pages/session/changePin.dart';
@ -71,6 +72,7 @@ Future<void> main() async {
'help': (context) => help(), 'help': (context) => help(),
'claimprocess': (context) => claimprocess(), 'claimprocess': (context) => claimprocess(),
'profile': (context) => profile(), 'profile': (context) => profile(),
'wellness': (context) => wellness(),
'planclaimsform': (context) => planclaimsform(), 'planclaimsform': (context) => planclaimsform(),
'claimtracklist': (context) => claimtracklist(), 'claimtracklist': (context) => claimtracklist(),
'privacypolicy': (context) => privacypolicy(), 'privacypolicy': (context) => privacypolicy(),

View File

@ -3883,6 +3883,8 @@ class _addOnsDetailsState extends State<addOnsDetails> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -3890,12 +3892,14 @@ class _addOnsDetailsState extends State<addOnsDetails> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"wellness",
], ],
initialIndex: initialIndex:
0, // Initial index of the bottom navigation bar 0, // Initial index of the bottom navigation bar
@ -3905,6 +3909,18 @@ class _addOnsDetailsState extends State<addOnsDetails> {
} }
} }
Future<void> _launchURL(String url) async {
final Uri uri = Uri.parse(url); // Parse the URL properly
print('_launchURL $uri');
if (uri != null) {
print('If $uri');
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
print('else $uri');
throw 'Could not launch $url';
}
}
void openForm(Map<String, dynamic> floaterData, action) { void openForm(Map<String, dynamic> floaterData, action) {
print(action); print(action);
print(floaterData); print(floaterData);
@ -4301,21 +4317,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
if (gmcECardDownload != null) if (item['eCardDownload'] != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(
Uri uri = item['eCardDownload']);
Uri.parse(gmcECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(uri)) {
// Open the URL in the default browser
await launchUrl(uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $gmcECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: cursor:
@ -4535,16 +4541,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
if (gpaECardDownload != null) if (item['eCardDownload'] != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
Uri uri = Uri.parse(gpaECardDownload); _launchURL(item['eCardDownload']);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,

View File

@ -829,6 +829,8 @@ class _empDetailsState extends State<empDetails> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -836,12 +838,14 @@ class _empDetailsState extends State<empDetails> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
initialIndex: initialIndex:
0, // Initial index of the bottom navigation bar 0, // Initial index of the bottom navigation bar
@ -851,6 +855,19 @@ class _empDetailsState extends State<empDetails> {
} }
} }
// Function to open URL in the default browser
Future<void> _launchURL(String url) async {
final Uri uri = Uri.parse(url); // Parse the URL properly
print('_launchURL $uri');
if (uri != null) {
print('If $uri');
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
print('else $uri');
throw 'Could not launch $url';
}
}
void openForm(Map<String, dynamic> floaterData, action) { void openForm(Map<String, dynamic> floaterData, action) {
print(action); print(action);
print(floaterData); print(floaterData);
@ -1706,13 +1723,7 @@ class _empDetailsState extends State<empDetails> {
if (gpaECardDownload != null) if (gpaECardDownload != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
Uri uri = Uri.parse(gpaECardDownload); _launchURL(item['eCardDownload']);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,
@ -2101,22 +2112,10 @@ class _empDetailsState extends State<empDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
if (gmcECardDownload != null) if (item['eCardDownload'] != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(item['eCardDownload']);
Uri uri =
Uri.parse(gmcECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(uri)) {
// Open the URL in the default browser
await launchUrl(uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $gmcECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,

View File

@ -727,6 +727,19 @@ class _empReviewDetailsState extends State<empReviewDetails> {
); );
} }
// Function to open URL in the default browser
Future<void> _launchURL(String url) async {
final Uri uri = Uri.parse(url); // Parse the URL properly
print('_launchURL $uri');
if (uri != null) {
print('If $uri');
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
print('else $uri');
throw 'Could not launch $url';
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if ((gpaMappedFamilyFloaters == [] && gpaMappedFamilyFloaters == null) && if ((gpaMappedFamilyFloaters == [] && gpaMappedFamilyFloaters == null) &&
@ -1051,21 +1064,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null) null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(
Uri uri = Uri.parse(
topUpECardDownload); topUpECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(
uri)) {
// Open the URL in the default browser
await launchUrl(
uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $topUpECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: cursor:
@ -1283,21 +1283,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null) null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(
Uri uri = Uri.parse(
topUpParentECardDownload); topUpParentECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(
uri)) {
// Open the URL in the default browser
await launchUrl(
uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $topUpParentECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: cursor:
@ -1512,21 +1499,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null) null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(
Uri uri = Uri.parse(
addOnsDependentECardDownload); addOnsDependentECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(
uri)) {
// Open the URL in the default browser
await launchUrl(
uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $addOnsDependentECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: cursor:
@ -2278,6 +2252,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -2285,12 +2261,14 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"wellness",
], ],
initialIndex: initialIndex:
0, // Initial index of the bottom navigation bar 0, // Initial index of the bottom navigation bar
@ -2420,16 +2398,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
if (gpaECardDownload != null) if (item['eCardDownload'] != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
Uri uri = Uri.parse(gpaECardDownload); _launchURL(item['eCardDownload']);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: SystemMouseCursors.click, cursor: SystemMouseCursors.click,
@ -2584,22 +2556,11 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
if (gmcECardDownload != null) if (item['eCardDownload'] != null)
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
// Convert the URL string to a Uri object _launchURL(
Uri uri = item['eCardDownload']);
Uri.parse(gmcECardDownload);
// Check if the URL is valid
if (await canLaunchUrl(uri)) {
// Open the URL in the default browser
await launchUrl(uri);
} else {
// Handle the case where the URL cannot be launched
print(
'Could not launch $gmcECardDownload');
}
}, },
child: MouseRegion( child: MouseRegion(
cursor: cursor:

View File

@ -256,7 +256,13 @@ class _loginState extends State<login> {
top: 0, // Example value for mobile top: 0, // Example value for mobile
); );
} }
return Scaffold( return WillPopScope(
onWillPop: () async {
// Close the app on mobile back button press
exit(0); // This will exit the app
return false; // Return false to prevent any other actions
},
child: Scaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container( child: Container(
@ -287,9 +293,12 @@ class _loginState extends State<login> {
.center, // Align to the center .center, // Align to the center
children: [ children: [
Expanded( Expanded(
flex: Responsive.isDesktop(context) ? 10 : 12, flex: Responsive.isDesktop(context)
? 10
: 12,
child: Align( child: Align(
alignment: Responsive.isDesktop(context) alignment:
Responsive.isDesktop(context)
? Alignment.centerLeft ? Alignment.centerLeft
: Alignment.bottomCenter, : Alignment.bottomCenter,
child: Image.asset( child: Image.asset(
@ -361,7 +370,8 @@ class _loginState extends State<login> {
? EdgeInsets.only(left: 20, right: 20) ? EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(left: 0, right: 0), : EdgeInsets.only(left: 0, right: 0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
if (!Responsive.isMobile(context) && if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context)) !Responsive.isTablet(context))
@ -370,8 +380,8 @@ class _loginState extends State<login> {
Expanded( Expanded(
flex: 12, flex: 12,
child: Align( child: Align(
alignment: Responsive.isDesktop( alignment: Responsive
context) .isDesktop(context)
? Alignment.centerLeft ? Alignment.centerLeft
: Alignment : Alignment
.bottomCenter, // Align to the start .bottomCenter, // Align to the start
@ -400,7 +410,8 @@ class _loginState extends State<login> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
@ -422,7 +433,8 @@ class _loginState extends State<login> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
@ -447,11 +459,13 @@ class _loginState extends State<login> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1, color: Colors.grey), width: 1, color: Colors.grey),
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(10),
), ),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -483,7 +497,8 @@ class _loginState extends State<login> {
Expanded( Expanded(
child: TextFormField( child: TextFormField(
controller: mobileController, controller: mobileController,
keyboardType: TextInputType.phone, keyboardType:
TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText: hintText:
@ -517,13 +532,15 @@ class _loginState extends State<login> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
height: 45, height: 45,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E), backgroundColor:
Color(0xFF00989E),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
@ -537,12 +554,15 @@ class _loginState extends State<login> {
valueColor: valueColor:
AlwaysStoppedAnimation< AlwaysStoppedAnimation<
Color>( Color>(
Color(0xFF00989E)), Color(
0xFF00989E)),
) )
: Text( : Text(
"Login With OTP", "Login With OTP",
style: GoogleFonts.poppins( style:
color: Color(0xFFFFFFFF)), GoogleFonts.poppins(
color: Color(
0xFFFFFFFF)),
), ),
), ),
), ),
@ -559,9 +579,11 @@ class _loginState extends State<login> {
SizedBox(height: 30), SizedBox(height: 30),
Text( Text(
"Benefits of Login", "Benefits of Login",
style: GoogleFonts.poppins( style:
GoogleFonts.poppins(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
), ),
), ),
SizedBox(height: 15), SizedBox(height: 15),
@ -579,8 +601,8 @@ class _loginState extends State<login> {
Expanded( Expanded(
flex: 6, flex: 6,
child: Container( child: Container(
padding: padding: EdgeInsets
EdgeInsets.symmetric( .symmetric(
vertical: 8), vertical: 8),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -595,7 +617,8 @@ class _loginState extends State<login> {
12), 12),
decoration: decoration:
BoxDecoration( BoxDecoration(
border: Border( border:
Border(
right: right:
BorderSide( BorderSide(
width: 1, width: 1,
@ -612,7 +635,8 @@ class _loginState extends State<login> {
color: Color( color: Color(
0xFFE26728)), 0xFFE26728)),
SizedBox( SizedBox(
height: 10), height:
10),
Text( Text(
"View Policy"), "View Policy"),
], ],
@ -627,11 +651,14 @@ class _loginState extends State<login> {
12), 12),
child: Column( child: Column(
children: [ children: [
Icon(Icons.edit, Icon(
Icons
.edit,
color: Color( color: Color(
0xFFE26728)), 0xFFE26728)),
SizedBox( SizedBox(
height: 10), height:
10),
Text( Text(
"Manage Claims"), "Manage Claims"),
], ],
@ -646,8 +673,8 @@ class _loginState extends State<login> {
), ),
) )
: SizedBox( : SizedBox(
height: height: Responsive.isDesktop(
Responsive.isDesktop(context) context)
? _size.height * 0.1 ? _size.height * 0.1
: _size.height * 0.2, : _size.height * 0.2,
), ),
@ -670,19 +697,23 @@ class _loginState extends State<login> {
children: <InlineSpan>[ children: <InlineSpan>[
WidgetSpan( WidgetSpan(
child: MouseRegion( child: MouseRegion(
cursor: cursor: SystemMouseCursors
SystemMouseCursors.click, .click,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.pushNamed(context, Navigator.pushNamed(
context,
'privacypolicy'); 'privacypolicy');
}, },
child: Text( child: Text(
'privacy policy ', 'privacy policy ',
style: GoogleFonts.poppins( style:
color: Color(0xFF00989E), GoogleFonts.poppins(
color:
Color(0xFF00989E),
fontSize: 9, fontSize: 9,
decoration: TextDecoration decoration:
TextDecoration
.underline, .underline,
), ),
), ),
@ -698,19 +729,23 @@ class _loginState extends State<login> {
), ),
WidgetSpan( WidgetSpan(
child: MouseRegion( child: MouseRegion(
cursor: cursor: SystemMouseCursors
SystemMouseCursors.click, .click,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.pushNamed( Navigator.pushNamed(
context, 'termsofuse'); context,
'termsofuse');
}, },
child: Text( child: Text(
'terms of use', 'terms of use',
style: GoogleFonts.poppins( style:
color: Color(0xFF00989E), GoogleFonts.poppins(
color:
Color(0xFF00989E),
fontSize: 9, fontSize: 9,
decoration: TextDecoration decoration:
TextDecoration
.underline, .underline,
), ),
), ),
@ -752,6 +787,6 @@ class _loginState extends State<login> {
), ),
], ],
)), )),
)); )));
} }
} }

View File

@ -4,6 +4,7 @@ import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../customAppBar/customAppBar.dart'; import '../../customAppBar/customAppBar.dart';
import '../../customAppBar/customAppBarChatbot.dart';
import 'data.dart'; import 'data.dart';
class chatbot extends StatefulWidget { class chatbot extends StatefulWidget {
@ -318,7 +319,7 @@ class _chatbotState extends State<chatbot> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar(), appBar: CustomAppBarChatbot(),
body: DashChat( body: DashChat(
currentUser: user, currentUser: user,
onSend: (ChatMessage m) { onSend: (ChatMessage m) {

View File

@ -768,6 +768,8 @@ class _claimprocessState extends State<claimprocess> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -775,12 +777,14 @@ class _claimprocessState extends State<claimprocess> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
), ),
); );

View File

@ -653,6 +653,8 @@ class _claimsState extends State<claims> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -660,12 +662,14 @@ class _claimsState extends State<claims> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
initialIndex: 1, // Initial index of the bottom navigation bar initialIndex: 1, // Initial index of the bottom navigation bar
), ),

View File

@ -528,6 +528,8 @@ class _claimtracklistformState extends State<claimtracklist> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -535,12 +537,14 @@ class _claimtracklistformState extends State<claimtracklist> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], // Initial index of the bottom navigation bar ], // Initial index of the bottom navigation bar
), ),
); );

View File

@ -1,7 +1,9 @@
import 'package:dash_chat_2/dash_chat_2.dart'; import 'package:dash_chat_2/dash_chat_2.dart';
// String profileImage =
// 'https://e7.pngegg.com/pngimages/811/700/png-clipart-chatbot-internet-bot-business-natural-language-processing-facebook-messenger-business-people-logo-thumbnail.png';
String profileImage = String profileImage =
'https://e7.pngegg.com/pngimages/811/700/png-clipart-chatbot-internet-bot-business-natural-language-processing-facebook-messenger-business-people-logo-thumbnail.png'; 'https://dev.venbait.in/nhance/dev/public/assets/images/chatbot.png';
// We have all the possibilities for users // We have all the possibilities for users
ChatUser user = ChatUser(id: '0'); ChatUser user = ChatUser(id: '0');

View File

@ -780,6 +780,8 @@ class _generalExclusionsDeductiblesState
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -787,12 +789,14 @@ class _generalExclusionsDeductiblesState
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
), ),
); );

View File

@ -9,6 +9,7 @@ import 'package:nhance_app_pwa/pages/postEnrollment/service/api_service.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/service/svg_service.dart'; import 'package:nhance_app_pwa/pages/postEnrollment/service/svg_service.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:url_launcher/url_launcher.dart';
import '../../customAppBar/customFooter.dart'; import '../../customAppBar/customFooter.dart';
import '../../customAppBar/responsive.dart'; import '../../customAppBar/responsive.dart';
import '../../customAppBar/tabs.dart'; import '../../customAppBar/tabs.dart';
@ -162,6 +163,30 @@ class _helpState extends State<help> {
} }
} }
void _openDialPad(String phoneNumber) async {
final url = 'tel:$phoneNumber';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not open dial pad for $phoneNumber';
}
}
void _openEmail(String email) async {
final Uri params = Uri(
scheme: 'mailto',
path: email,
query:
'subject=Your Subject&body=Hello', // Add default subject and body here
);
var url = params.toString();
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not open email client for $email';
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -224,8 +249,8 @@ class _helpState extends State<help> {
children: [ children: [
SvgPicture.string( SvgPicture.string(
SvgService.getSvg('help'), SvgService.getSvg('help'),
width: 300, width: 150,
height: 300, height: 150,
), ),
], ],
))), ))),
@ -235,15 +260,124 @@ class _helpState extends State<help> {
], ],
), ),
), ),
SizedBox(height: 15),
if (accountManagerDetails != null)
Container(
decoration: BoxDecoration(
color: Colors.white, // Set background color for the container
),
padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10)
: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Nhance Account Manager Contact',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 16 : 12,
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
),
],
),
),
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GestureDetector(
onTap: () {
_openEmail(accountManagerEmail);
},
child: SvgPicture.string(
SvgService.getSvg('email'),
width: 20,
height: 20,
),
),
SizedBox(
width: 10), // Space between icon and text
GestureDetector(
onTap: () {
_openEmail(accountManagerEmail);
},
child: Text(
accountManagerEmail ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context)
? 16
: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
),
),
),
],
),
SizedBox(height: 10), SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
GestureDetector(
onTap: () {
_openDialPad(accountManagerMobileNo);
},
child: SvgPicture.string(
SvgService.getSvg('smartphone'),
width: 20,
height: 20,
),
),
SizedBox(
width: 10), // Space between icon and text
GestureDetector(
onTap: () {
_openDialPad(accountManagerMobileNo);
},
child: Text(
accountManagerMobileNo ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context)
? 16
: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
),
),
),
],
),
],
),
),
)
]),
),
Container( Container(
width: double.infinity, width: double.infinity,
height: 75, height: 75,
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.only( : EdgeInsets.only(
top: 10, top: 5,
bottom: 10, bottom: 5,
left: 10, left: 10,
right: 10), // Add padding to the container right: 10), // Add padding to the container
child: Row( child: Row(
@ -278,7 +412,7 @@ class _helpState extends State<help> {
], ],
), ),
), ),
SizedBox(height: 15), SizedBox(height: 5),
if (trackClaimsList == null) if (trackClaimsList == null)
Card( Card(
elevation: 0, elevation: 0,
@ -549,98 +683,6 @@ class _helpState extends State<help> {
trackClaimsClosedList), // Replace 'yourDataList' with your actual data list trackClaimsClosedList), // Replace 'yourDataList' with your actual data list
), ),
), ),
SizedBox(height: 15),
if (accountManagerDetails != null)
Container(
decoration: BoxDecoration(
color: Colors.white, // Set background color 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: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Nhance Account Manager Contact',
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 16 : 12,
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
),
],
),
),
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SvgPicture.string(
SvgService.getSvg('email'),
width: 20,
height: 20,
),
SizedBox(
width: 10), // Space between icon and text
Text(
accountManagerEmail ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context)
? 16
: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
),
),
],
),
SizedBox(
height:
10), // Space between email and mobile rows
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Center align the row
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SvgPicture.string(
SvgService.getSvg('smartphone'),
width: 20,
height: 20,
),
SizedBox(
width: 10), // Space between icon and text
Text(
accountManagerMobileNo ?? '',
style: GoogleFonts.poppins(
fontSize: Responsive.isDesktop(context)
? 16
: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
),
),
],
),
],
),
),
)
]),
),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
]), ]),
)), )),
@ -678,6 +720,8 @@ class _helpState extends State<help> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -685,12 +729,14 @@ class _helpState extends State<help> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
initialIndex: 3, // Initial index of the bottom navigation bar initialIndex: 3, // Initial index of the bottom navigation bar
), ),
@ -791,7 +837,10 @@ class _helpState extends State<help> {
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
Text( Container(
width:
150, // Set a fixed width or adjust based on your layout
child: Text(
claimsSubject, claimsSubject,
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
@ -801,8 +850,12 @@ class _helpState extends State<help> {
: 12, : 12,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFF777777), color: Color(0xFF777777),
), // Ensure text automatically wraps
), ),
overflow: TextOverflow
.ellipsis, // Show ellipsis when text overflows
maxLines: 1, // Limit to one line
),
)
], ],
)) ))
], ],

View File

@ -636,6 +636,8 @@ class _MyAppState extends State<MyApp> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -643,13 +645,9 @@ class _MyAppState extends State<MyApp> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: ["Home", "Claim", "Profile", "Help", "Wellness"],
"Home",
"Claim",
"Profile",
"Help",
],
initialIndex: 0, // Initial index of the bottom navigation bar initialIndex: 0, // Initial index of the bottom navigation bar
), ),
); );

View File

@ -872,7 +872,7 @@ class _planclaimsformState extends State<planclaimsform> {
), ),
), ),
), ),
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10), SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
]), ]),
)), )),
if (Responsive.isDesktop(context)) if (Responsive.isDesktop(context))
@ -910,6 +910,8 @@ class _planclaimsformState extends State<planclaimsform> {
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
// Navigator.pushNamed(context, 'help'); // Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -917,12 +919,14 @@ class _planclaimsformState extends State<planclaimsform> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], // Initial index of the bottom navigation bar ], // Initial index of the bottom navigation bar
), ),
); );

View File

@ -100,11 +100,16 @@ class _policiesState extends State<policies> {
return formattedDate; return formattedDate;
} }
_launchURL(String ecardURL) async { // Function to open URL in the default browser
if (await canLaunch(ecardURL)) { Future<void> _launchURL(String url) async {
await launch(ecardURL); final Uri uri = Uri.parse(url); // Parse the URL properly
print('_launchURL $uri');
if (uri != null) {
print('If $uri');
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else { } else {
print('Could not launch $ecardURL'); print('else $uri');
throw 'Could not launch $url';
} }
} }
@ -235,8 +240,14 @@ class _policiesState extends State<policies> {
: 180, : 180,
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (argumentsData['eCardDownload'] !=
null) {
_launchURL( _launchURL(
argumentsData['eCardDownload']); argumentsData['eCardDownload']);
} else {
ToastHelper.showInfoToast(
context, 'Not Generated');
}
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -963,6 +974,8 @@ class _policiesState extends State<policies> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -970,12 +983,14 @@ class _policiesState extends State<policies> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], // Initial index of the bottom navigation bar ], // Initial index of the bottom navigation bar
), ),
); );
@ -1000,19 +1015,19 @@ class _policiesState extends State<policies> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
buildExpandedColumn(
context, 'Cover Amount', '${argumentsData['si_value']}'),
buildExpandedColumn( buildExpandedColumn(
context, 'Policy No', argumentsData['policy_no']), context, 'Policy No', argumentsData['policy_no']),
// buildExpandedColumn(context, '', ''),
], ],
), ),
SizedBox(height: 20), SizedBox(height: 20),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
buildExpandedColumn(
context, 'Cover Amount', '${argumentsData['si_value']}'),
buildExpandedColumn(context, 'Policy Expiry', buildExpandedColumn(context, 'Policy Expiry',
convertDateFormat(argumentsData['policy_end_date'])), convertDateFormat(argumentsData['policy_end_date'])),
buildExpandedColumn(context, '', ''),
], ],
), ),
], ],

View File

@ -676,6 +676,8 @@ class _profileState extends State<profile> {
Navigator.pushNamed(context, 'profile'); Navigator.pushNamed(context, 'profile');
} else if (index == 3) { } else if (index == 3) {
Navigator.pushNamed(context, 'help'); Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
} }
}, },
icons: [ icons: [
@ -683,12 +685,14 @@ class _profileState extends State<profile> {
Icons.sticky_note_2_outlined, Icons.sticky_note_2_outlined,
Icons.person_outline_outlined, Icons.person_outline_outlined,
Icons.headset_mic_outlined, Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
], ],
labels: [ labels: [
"Home", "Home",
"Claim", "Claim",
"Profile", "Profile",
"Help", "Help",
"Wellness",
], ],
initialIndex: 2, // Initial index of the bottom navigation bar initialIndex: 2, // Initial index of the bottom navigation bar
), ),

View File

@ -0,0 +1,217 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:nhance_app_pwa/customAppBar/customAppBar.dart';
import 'package:nhance_app_pwa/pages/postEnrollment/service/svg_service.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../customAppBar/customFooter.dart';
import '../../customAppBar/responsive.dart';
import '../../customAppBar/tabs.dart';
class wellness extends StatefulWidget {
const wellness({Key? key}) : super(key: key);
@override
State<wellness> createState() => _wellnessState();
}
class _wellnessState extends State<wellness> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
// Function to open URL in the default browser
Future<void> _launchURL(String url) async {
final Uri uri = Uri.parse(url); // Parse the URL properly
print('_launchURL $uri');
if (uri != null) {
print('If $uri');
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
print('else $uri');
throw 'Could not launch $url';
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: CustomAppBar(),
body: Stack(children: [
SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment
.center, // Center both text and button vertically
children: <Widget>[
Container(
padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 15, bottom: 15, left: 25, right: 25)
: EdgeInsets.only(top: 0, bottom: 0, left: 0, right: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: InkWell(
onTap: () {
Navigator.pushNamed(context, 'home');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons
.chevron_left, // Replace with your desired icon
color: Color(0xFF000000),
size: 30,
),
],
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.string(
SvgService.getSvg('help'),
width: 200,
height: 200,
),
],
))),
],
),
// Add more rows as needed
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Colors.white, // Set background color for the container
),
padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10)
: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Nhance Account Manager Contact\nWellness is the active pursuit of activities and lifestyle choices that contribute to holistic physical, mental, and emotional well-being. It involves balancing various aspects of health to achieve a fulfilling and healthy life.',
textAlign:
TextAlign.center, // Center align the text
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context) ? 16 : 12,
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
)
],
),
),
]),
),
SizedBox(height: 20), // Space between text and button
ElevatedButton(
onPressed: () {
_launchURL(
'https://venbait.in/nhance/dev/download-e-card/Oef7qV'); // Redirect to the browser on button click
},
child: Text(
'Wellness',
style: GoogleFonts.poppins(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
],
),
),
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.pushNamed(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');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
Icons.home_outlined,
Icons.sticky_note_2_outlined,
Icons.person_outline_outlined,
Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
],
labels: [
"Home",
"Claim",
"Profile",
"Help",
"Wellness",
],
initialIndex: 4, // Initial index of the bottom navigation bar
),
);
}
}

View File

@ -104,7 +104,7 @@ class _pinPageState extends State<pinPage> {
final token = prefs.getString('token'); final token = prefs.getString('token');
if (token != null && token.isNotEmpty) { if (token != null && token.isNotEmpty) {
ToastHelper.showSuccessToast(context, 'Successfully Login'); ToastHelper.showSuccessToast(context, 'Successfully Login');
if (emp_status == 'enrolled') { if (emp_status == 'enrolled' || emp_status == 'active') {
Navigator.pushReplacementNamed(context, 'home'); Navigator.pushReplacementNamed(context, 'home');
} else { } else {
Navigator.pushReplacementNamed(context, 'empDetails'); Navigator.pushReplacementNamed(context, 'empDetails');
@ -237,7 +237,11 @@ class _pinPageState extends State<pinPage> {
), ),
); );
return Scaffold( return WillPopScope(
onWillPop: () async {
return false;
},
child: Scaffold(
body: Container( body: Container(
color: Colors.white, // Set the color for the body color: Colors.white, // Set the color for the body
child: SizedBox.expand( child: SizedBox.expand(
@ -351,7 +355,8 @@ class _pinPageState extends State<pinPage> {
children: [ children: [
SizedBox(height: 40), SizedBox(height: 40),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -368,7 +373,8 @@ class _pinPageState extends State<pinPage> {
color: Color( color: Color(
0xFF909090), 0xFF909090),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
), ),
@ -376,22 +382,27 @@ class _pinPageState extends State<pinPage> {
), ),
SizedBox(height: 5), SizedBox(height: 5),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 0), horizontal: 0),
child: Pinput( child: Pinput(
length: 4, length: 4,
defaultPinTheme: defaultPinTheme:
defaultPinTheme, defaultPinTheme,
separatorBuilder: (index) => separatorBuilder:
const SizedBox(width: 8), (index) =>
const SizedBox(
width: 8),
showCursor: true, showCursor: true,
controller: _pinController, controller:
_pinController,
validator: _validatePin, validator: _validatePin,
errorPinTheme: defaultPinTheme errorPinTheme:
defaultPinTheme
.copyBorderWith( .copyBorderWith(
border: Border.all( border: Border.all(
color: color: Colors
Colors.redAccent), .redAccent),
), ),
hapticFeedbackType: hapticFeedbackType:
HapticFeedbackType HapticFeedbackType
@ -406,11 +417,14 @@ class _pinPageState extends State<pinPage> {
}, },
cursor: Column( cursor: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.end, MainAxisAlignment
.end,
children: [ children: [
Container( Container(
margin: const EdgeInsets margin:
.only(bottom: 9), const EdgeInsets
.only(
bottom: 9),
width: 22, width: 22,
height: 1, height: 1,
color: color:
@ -419,27 +433,31 @@ class _pinPageState extends State<pinPage> {
], ],
), ),
focusedPinTheme: focusedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
8), .circular(8),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
), ),
), ),
submittedPinTheme: submittedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
color: fillColor, color: fillColor,
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
19), .circular(19),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
@ -449,7 +467,8 @@ class _pinPageState extends State<pinPage> {
), ),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
@ -463,7 +482,8 @@ class _pinPageState extends State<pinPage> {
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius BorderRadius
.circular(10), .circular(
10),
), ),
), ),
onPressed: () async { onPressed: () async {
@ -471,8 +491,8 @@ class _pinPageState extends State<pinPage> {
}, },
child: Text( child: Text(
"Submit", "Submit",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
color: Color( color: Color(
0xFFFFFFFF)), 0xFFFFFFFF)),
), ),
@ -483,7 +503,8 @@ class _pinPageState extends State<pinPage> {
Container( Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -491,13 +512,14 @@ class _pinPageState extends State<pinPage> {
}, },
child: Text( child: Text(
'Forget PIN?', 'Forget PIN?',
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 12, fontSize: 12,
color: color: Color(
Color(0xFF929292), 0xFF929292),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
), ),
@ -559,6 +581,6 @@ class _pinPageState extends State<pinPage> {
), ),
), ),
]), ]),
))); ))));
} }
} }

View File

@ -173,7 +173,11 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
); );
return Scaffold( return WillPopScope(
onWillPop: () async {
return false;
},
child: Scaffold(
body: Container( body: Container(
color: Colors.white, // Set the color for the body color: Colors.white, // Set the color for the body
child: SizedBox.expand( child: SizedBox.expand(
@ -286,7 +290,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
children: [ children: [
SizedBox(height: 40), SizedBox(height: 40),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -303,7 +308,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
color: Color( color: Color(
0xFF909090), 0xFF909090),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
), ),
@ -311,22 +317,27 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
SizedBox(height: 5), SizedBox(height: 5),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 0), horizontal: 0),
child: Pinput( child: Pinput(
length: 4, length: 4,
defaultPinTheme: defaultPinTheme:
defaultPinTheme, defaultPinTheme,
separatorBuilder: (index) => separatorBuilder:
const SizedBox(width: 8), (index) =>
const SizedBox(
width: 8),
showCursor: true, showCursor: true,
controller: _pinController, controller:
_pinController,
validator: _validatePin, validator: _validatePin,
errorPinTheme: defaultPinTheme errorPinTheme:
defaultPinTheme
.copyBorderWith( .copyBorderWith(
border: Border.all( border: Border.all(
color: color: Colors
Colors.redAccent), .redAccent),
), ),
hapticFeedbackType: hapticFeedbackType:
HapticFeedbackType HapticFeedbackType
@ -341,11 +352,14 @@ class _pinSettingPageState extends State<pinSettingPage> {
}, },
cursor: Column( cursor: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.end, MainAxisAlignment
.end,
children: [ children: [
Container( Container(
margin: const EdgeInsets margin:
.only(bottom: 9), const EdgeInsets
.only(
bottom: 9),
width: 22, width: 22,
height: 1, height: 1,
color: color:
@ -354,27 +368,31 @@ class _pinSettingPageState extends State<pinSettingPage> {
], ],
), ),
focusedPinTheme: focusedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
8), .circular(8),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
), ),
), ),
submittedPinTheme: submittedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
color: fillColor, color: fillColor,
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
19), .circular(19),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
@ -384,7 +402,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -401,7 +420,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
color: Color( color: Color(
0xFF909090), 0xFF909090),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
), ),
@ -409,8 +429,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
SizedBox(height: 5), SizedBox(height: 5),
Container( Container(
margin: Responsive.isDesktop( margin: Responsive
context) .isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric( : EdgeInsets.symmetric(
@ -419,18 +439,21 @@ class _pinSettingPageState extends State<pinSettingPage> {
length: 4, length: 4,
defaultPinTheme: defaultPinTheme:
defaultPinTheme, defaultPinTheme,
separatorBuilder: (index) => separatorBuilder:
const SizedBox(width: 8), (index) =>
const SizedBox(
width: 8),
showCursor: true, showCursor: true,
controller: controller:
_confirmPinController, _confirmPinController,
validator: validator:
_validateConfirmPin, _validateConfirmPin,
errorPinTheme: defaultPinTheme errorPinTheme:
defaultPinTheme
.copyBorderWith( .copyBorderWith(
border: Border.all( border: Border.all(
color: color: Colors
Colors.redAccent), .redAccent),
), ),
hapticFeedbackType: hapticFeedbackType:
HapticFeedbackType HapticFeedbackType
@ -445,11 +468,14 @@ class _pinSettingPageState extends State<pinSettingPage> {
}, },
cursor: Column( cursor: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.end, MainAxisAlignment
.end,
children: [ children: [
Container( Container(
margin: const EdgeInsets margin:
.only(bottom: 9), const EdgeInsets
.only(
bottom: 9),
width: 22, width: 22,
height: 1, height: 1,
color: color:
@ -458,27 +484,31 @@ class _pinSettingPageState extends State<pinSettingPage> {
], ],
), ),
focusedPinTheme: focusedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
8), .circular(8),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
), ),
), ),
submittedPinTheme: submittedPinTheme:
defaultPinTheme.copyWith( defaultPinTheme
decoration: defaultPinTheme .copyWith(
decoration:
defaultPinTheme
.decoration! .decoration!
.copyWith( .copyWith(
color: fillColor, color: fillColor,
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius
19), .circular(19),
border: Border.all( border: Border.all(
color: color:
focusedBorderColor), focusedBorderColor),
@ -488,7 +518,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -497,13 +528,14 @@ class _pinSettingPageState extends State<pinSettingPage> {
children: [ children: [
Text( Text(
'Enable Biometric', 'Enable Biometric',
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 12, fontSize: 12,
color: color: Color(
Color(0xFF000000), 0xFF000000),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
SizedBox( SizedBox(
@ -515,7 +547,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
child: Switch( child: Switch(
value: value:
_enableBiometric, _enableBiometric,
onChanged: (value) { onChanged:
(value) {
setState(() { setState(() {
_enableBiometric = _enableBiometric =
value; value;
@ -523,7 +556,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
}, },
activeColor: Color( activeColor: Color(
0xFFE26728), // Color when the switch is ON 0xFFE26728), // Color when the switch is ON
inactiveTrackColor: Color( inactiveTrackColor:
Color(
0xFFD8D8D8), // Color of the switch track when OFF 0xFFD8D8D8), // Color of the switch track when OFF
), ),
), ),
@ -531,7 +565,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 30), horizontal: 30),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
@ -545,7 +580,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius BorderRadius
.circular(10), .circular(
10),
), ),
), ),
onPressed: () async { onPressed: () async {
@ -553,8 +589,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
}, },
child: Text( child: Text(
"Save", "Save",
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
color: Color( color: Color(
0xFFFFFFFF)), 0xFFFFFFFF)),
), ),
@ -565,7 +601,8 @@ class _pinSettingPageState extends State<pinSettingPage> {
Container( Container(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -573,13 +610,14 @@ class _pinSettingPageState extends State<pinSettingPage> {
}, },
child: Text( child: Text(
'Skip ?', 'Skip ?',
style: style: GoogleFonts
GoogleFonts.poppins( .poppins(
fontSize: 12, fontSize: 12,
color: color: Color(
Color(0xFF929292), 0xFF929292),
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
), ),
), ),
), ),
@ -642,6 +680,6 @@ class _pinSettingPageState extends State<pinSettingPage> {
), ),
), ),
]), ]),
))); ))));
} }
} }

View File

@ -208,7 +208,7 @@ class _MyVerifyState extends State<MyVerify> {
} else { } else {
if (token != null && token.isNotEmpty) { if (token != null && token.isNotEmpty) {
ToastHelper.showSuccessToast(context, 'Successfully Login'); ToastHelper.showSuccessToast(context, 'Successfully Login');
if (emp_status == 'enrolled') { if (emp_status == 'enrolled' || emp_status == 'active') {
Navigator.pushReplacementNamed(context, 'home'); Navigator.pushReplacementNamed(context, 'home');
} else { } else {
Navigator.pushReplacementNamed(context, 'empDetails'); Navigator.pushReplacementNamed(context, 'empDetails');
@ -386,7 +386,12 @@ class _MyVerifyState extends State<MyVerify> {
), ),
); );
return Scaffold( return WillPopScope(
onWillPop: () async {
Navigator.pushReplacementNamed(context, 'login');
return false;
},
child: Scaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container( child: Container(
@ -417,7 +422,9 @@ class _MyVerifyState extends State<MyVerify> {
.center, // Align to the center .center, // Align to the center
children: [ children: [
Expanded( Expanded(
flex: Responsive.isDesktop(context) ? 10 : 12, flex: Responsive.isDesktop(context)
? 10
: 12,
child: Align( child: Align(
alignment: Responsive.isDesktop(context) alignment: Responsive.isDesktop(context)
? Alignment.centerLeft ? Alignment.centerLeft
@ -492,7 +499,8 @@ class _MyVerifyState extends State<MyVerify> {
? EdgeInsets.only(left: 20, right: 20) ? EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(left: 0, right: 0), : EdgeInsets.only(left: 0, right: 0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
if (!Responsive.isMobile(context) && if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context)) !Responsive.isTablet(context))
@ -501,8 +509,8 @@ class _MyVerifyState extends State<MyVerify> {
Expanded( Expanded(
flex: 10, flex: 10,
child: Align( child: Align(
alignment: Responsive.isDesktop( alignment: Responsive
context) .isDesktop(context)
? Alignment.centerLeft ? Alignment.centerLeft
: Alignment : Alignment
.bottomCenter, // Align to the start .bottomCenter, // Align to the start
@ -531,7 +539,8 @@ class _MyVerifyState extends State<MyVerify> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
@ -551,7 +560,8 @@ class _MyVerifyState extends State<MyVerify> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: RichText( child: RichText(
textAlign: TextAlign.center, textAlign: TextAlign.center,
text: TextSpan( text: TextSpan(
@ -568,7 +578,8 @@ class _MyVerifyState extends State<MyVerify> {
fontSize: 12, fontSize: 12,
color: Color( color: Color(
0xFFE26728)), // Change color as desired 0xFFE26728)), // Change color as desired
recognizer: TapGestureRecognizer() recognizer:
TapGestureRecognizer()
..onTap = () { ..onTap = () {
// Navigate to the page where the user can change the phone number // Navigate to the page where the user can change the phone number
Navigator.pushNamed( Navigator.pushNamed(
@ -584,7 +595,8 @@ class _MyVerifyState extends State<MyVerify> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: Pinput( child: Pinput(
length: 6, length: 6,
// defaultPinTheme: defaultPinTheme, // defaultPinTheme: defaultPinTheme,
@ -599,7 +611,8 @@ class _MyVerifyState extends State<MyVerify> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment mainAxisAlignment: MainAxisAlignment
.end, // Align text to the right .end, // Align text to the right
@ -607,8 +620,10 @@ class _MyVerifyState extends State<MyVerify> {
_isTimerRunning _isTimerRunning
? Text( ? Text(
"Resend OTP in $_secondsRemaining seconds", "Resend OTP in $_secondsRemaining seconds",
style: GoogleFonts.poppins( style:
color: Colors.black), GoogleFonts.poppins(
color:
Colors.black),
) )
: InkWell( : InkWell(
onTap: () { onTap: () {
@ -616,8 +631,10 @@ class _MyVerifyState extends State<MyVerify> {
}, },
child: Text( child: Text(
"Resend OTP", "Resend OTP",
style: GoogleFonts.poppins( style:
color: Colors.blue), GoogleFonts.poppins(
color: Colors
.blue),
), ),
), ),
], ],
@ -628,13 +645,15 @@ class _MyVerifyState extends State<MyVerify> {
margin: Responsive.isDesktop(context) margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(
horizontal: 150) horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0), : EdgeInsets.symmetric(
horizontal: 0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
height: 45, height: 45,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E), backgroundColor:
Color(0xFF00989E),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(10), BorderRadius.circular(10),
@ -645,7 +664,8 @@ class _MyVerifyState extends State<MyVerify> {
.validate()) { .validate()) {
_formKey.currentState! _formKey.currentState!
.save(); // Save form fields before calling verifyOTP .save(); // Save form fields before calling verifyOTP
verifyOTP(_otpController.text); verifyOTP(
_otpController.text);
} }
}, },
child: Text( child: Text(
@ -665,9 +685,11 @@ class _MyVerifyState extends State<MyVerify> {
SizedBox(height: 20), SizedBox(height: 20),
Text( Text(
"Benefits of Login", "Benefits of Login",
style: GoogleFonts.poppins( style:
GoogleFonts.poppins(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
), ),
), ),
SizedBox(height: 15), SizedBox(height: 15),
@ -685,8 +707,8 @@ class _MyVerifyState extends State<MyVerify> {
Expanded( Expanded(
flex: 6, flex: 6,
child: Container( child: Container(
padding: padding: EdgeInsets
EdgeInsets.symmetric( .symmetric(
vertical: 8), vertical: 8),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -701,7 +723,8 @@ class _MyVerifyState extends State<MyVerify> {
12), 12),
decoration: decoration:
BoxDecoration( BoxDecoration(
border: Border( border:
Border(
right: right:
BorderSide( BorderSide(
width: 1, width: 1,
@ -718,7 +741,8 @@ class _MyVerifyState extends State<MyVerify> {
color: Color( color: Color(
0xFFE26728)), 0xFFE26728)),
SizedBox( SizedBox(
height: 10), height:
10),
Text( Text(
"View Policy", "View Policy",
style: GoogleFonts style: GoogleFonts
@ -735,11 +759,14 @@ class _MyVerifyState extends State<MyVerify> {
12), 12),
child: Column( child: Column(
children: [ children: [
Icon(Icons.edit, Icon(
Icons
.edit,
color: Color( color: Color(
0xFFE26728)), 0xFFE26728)),
SizedBox( SizedBox(
height: 10), height:
10),
Text( Text(
"Manage Claims", "Manage Claims",
style: GoogleFonts style: GoogleFonts
@ -756,8 +783,8 @@ class _MyVerifyState extends State<MyVerify> {
), ),
) )
: SizedBox( : SizedBox(
height: height: Responsive.isDesktop(
Responsive.isDesktop(context) context)
? _size.height * 0.1 ? _size.height * 0.1
: _size.height * 0.2, : _size.height * 0.2,
), ),
@ -834,6 +861,6 @@ class _MyVerifyState extends State<MyVerify> {
), ),
], ],
)), )),
)); )));
} }
} }

View File

@ -54,6 +54,7 @@ dependencies:
firebase_auth: ^5.1.2 firebase_auth: ^5.1.2
local_auth: ^2.2.0 local_auth: ^2.2.0
google_sign_in: ^6.2.1 google_sign_in: ^6.2.1
dio: ^5.7.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: