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/
TICKET_API_URL=https://dev.venbait.in/nhance/helpdesk/uat/api
BASE_HREF=/nhance/employee/uat/
ENV=production
ENV=uat

View File

@ -28,6 +28,10 @@
android:resource="@style/NormalTheme"
/>
<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"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

View File

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

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

View File

@ -3883,6 +3883,8 @@ class _addOnsDetailsState extends State<addOnsDetails> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -3890,12 +3892,14 @@ class _addOnsDetailsState extends State<addOnsDetails> {
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:
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) {
print(action);
print(floaterData);
@ -4301,21 +4317,11 @@ class _addOnsDetailsState extends State<addOnsDetails> {
fontWeight: FontWeight.w600,
),
),
if (gmcECardDownload != null)
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
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');
}
_launchURL(
item['eCardDownload']);
},
child: MouseRegion(
cursor:
@ -4535,16 +4541,10 @@ class _addOnsDetailsState extends State<addOnsDetails> {
fontWeight: FontWeight.w600,
),
),
if (gpaECardDownload != null)
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
Uri uri = Uri.parse(gpaECardDownload);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
_launchURL(item['eCardDownload']);
},
child: MouseRegion(
cursor: SystemMouseCursors.click,

View File

@ -829,6 +829,8 @@ class _empDetailsState extends State<empDetails> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -836,12 +838,14 @@ class _empDetailsState extends State<empDetails> {
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:
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) {
print(action);
print(floaterData);
@ -1706,13 +1723,7 @@ class _empDetailsState extends State<empDetails> {
if (gpaECardDownload != null)
GestureDetector(
onTap: () async {
Uri uri = Uri.parse(gpaECardDownload);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
_launchURL(item['eCardDownload']);
},
child: MouseRegion(
cursor: SystemMouseCursors.click,
@ -2101,22 +2112,10 @@ class _empDetailsState extends State<empDetails> {
fontWeight: FontWeight.w600,
),
),
if (gmcECardDownload != null)
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
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');
}
_launchURL(item['eCardDownload']);
},
child: MouseRegion(
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
Widget build(BuildContext context) {
if ((gpaMappedFamilyFloaters == [] && gpaMappedFamilyFloaters == null) &&
@ -1051,21 +1064,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
Uri uri = Uri.parse(
_launchURL(
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(
cursor:
@ -1283,21 +1283,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
Uri uri = Uri.parse(
_launchURL(
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(
cursor:
@ -1512,21 +1499,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
Uri uri = Uri.parse(
_launchURL(
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(
cursor:
@ -2278,6 +2252,8 @@ class _empReviewDetailsState extends State<empReviewDetails> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -2285,12 +2261,14 @@ class _empReviewDetailsState extends State<empReviewDetails> {
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:
0, // Initial index of the bottom navigation bar
@ -2420,16 +2398,10 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontWeight: FontWeight.w600,
),
),
if (gpaECardDownload != null)
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
Uri uri = Uri.parse(gpaECardDownload);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
} else {
print(
'Could not launch $gpaECardDownload');
}
_launchURL(item['eCardDownload']);
},
child: MouseRegion(
cursor: SystemMouseCursors.click,
@ -2584,22 +2556,11 @@ class _empReviewDetailsState extends State<empReviewDetails> {
fontWeight: FontWeight.w600,
),
),
if (gmcECardDownload != null)
if (item['eCardDownload'] != null)
GestureDetector(
onTap: () async {
// Convert the URL string to a Uri object
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');
}
_launchURL(
item['eCardDownload']);
},
child: MouseRegion(
cursor:

File diff suppressed because it is too large Load Diff

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:url_launcher/url_launcher.dart';
import '../../customAppBar/customAppBar.dart';
import '../../customAppBar/customAppBarChatbot.dart';
import 'data.dart';
class chatbot extends StatefulWidget {
@ -318,7 +319,7 @@ class _chatbotState extends State<chatbot> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(),
appBar: CustomAppBarChatbot(),
body: DashChat(
currentUser: user,
onSend: (ChatMessage m) {

View File

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

View File

@ -653,6 +653,8 @@ class _claimsState extends State<claims> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -660,12 +662,14 @@ class _claimsState extends State<claims> {
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: 1, // Initial index of the bottom navigation bar
),

View File

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

View File

@ -1,7 +1,9 @@
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 =
'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
ChatUser user = ChatUser(id: '0');

View File

@ -780,6 +780,8 @@ class _generalExclusionsDeductiblesState
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -787,12 +789,14 @@ class _generalExclusionsDeductiblesState
Icons.sticky_note_2_outlined,
Icons.person_outline_outlined,
Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
],
labels: [
"Home",
"Claim",
"Profile",
"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:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http;
import 'package:url_launcher/url_launcher.dart';
import '../../customAppBar/customFooter.dart';
import '../../customAppBar/responsive.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
Widget build(BuildContext context) {
return Scaffold(
@ -224,8 +249,8 @@ class _helpState extends State<help> {
children: [
SvgPicture.string(
SvgService.getSvg('help'),
width: 300,
height: 300,
width: 150,
height: 150,
),
],
))),
@ -235,15 +260,124 @@ class _helpState extends State<help> {
],
),
),
SizedBox(height: 10),
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),
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(
width: double.infinity,
height: 75,
padding: Responsive.isDesktop(context)
? EdgeInsets.only(top: 20, bottom: 20, left: 30, right: 30)
: EdgeInsets.only(
top: 10,
bottom: 10,
top: 5,
bottom: 5,
left: 10,
right: 10), // Add padding to the container
child: Row(
@ -278,7 +412,7 @@ class _helpState extends State<help> {
],
),
),
SizedBox(height: 15),
SizedBox(height: 5),
if (trackClaimsList == null)
Card(
elevation: 0,
@ -549,98 +683,6 @@ class _helpState extends State<help> {
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),
]),
)),
@ -678,6 +720,8 @@ class _helpState extends State<help> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -685,12 +729,14 @@ class _helpState extends State<help> {
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: 3, // Initial index of the bottom navigation bar
),
@ -791,18 +837,25 @@ class _helpState extends State<help> {
),
),
SizedBox(height: 5),
Text(
claimsSubject,
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context)
? 14
: 12,
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
), // Ensure text automatically wraps
),
Container(
width:
150, // Set a fixed width or adjust based on your layout
child: Text(
claimsSubject,
textAlign: TextAlign.left,
style: GoogleFonts.poppins(
fontSize:
Responsive.isDesktop(context)
? 14
: 12,
fontWeight: FontWeight.w400,
color: Color(0xFF777777),
),
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');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -643,13 +645,9 @@ class _MyAppState extends State<MyApp> {
Icons.sticky_note_2_outlined,
Icons.person_outline_outlined,
Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
],
labels: [
"Home",
"Claim",
"Profile",
"Help",
],
labels: ["Home", "Claim", "Profile", "Help", "Wellness"],
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))
@ -910,6 +910,8 @@ class _planclaimsformState extends State<planclaimsform> {
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
// Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -917,12 +919,14 @@ class _planclaimsformState extends State<planclaimsform> {
Icons.sticky_note_2_outlined,
Icons.person_outline_outlined,
Icons.headset_mic_outlined,
Icons.health_and_safety_outlined,
],
labels: [
"Home",
"Claim",
"Profile",
"Help",
"Wellness",
], // Initial index of the bottom navigation bar
),
);

View File

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

View File

@ -676,6 +676,8 @@ class _profileState extends State<profile> {
Navigator.pushNamed(context, 'profile');
} else if (index == 3) {
Navigator.pushNamed(context, 'help');
} else if (index == 4) {
Navigator.pushNamed(context, 'wellness');
}
},
icons: [
@ -683,12 +685,14 @@ class _profileState extends State<profile> {
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: 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');
if (token != null && token.isNotEmpty) {
ToastHelper.showSuccessToast(context, 'Successfully Login');
if (emp_status == 'enrolled') {
if (emp_status == 'enrolled' || emp_status == 'active') {
Navigator.pushReplacementNamed(context, 'home');
} else {
Navigator.pushReplacementNamed(context, 'empDetails');
@ -237,328 +237,350 @@ class _pinPageState extends State<pinPage> {
),
);
return Scaffold(
body: Container(
color: Colors.white, // Set the color for the body
child: SizedBox.expand(
child: Stack(children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(0),
color: Color(0xFFFFFCE5),
child: Column(children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFFCE5), // Set background color for the container
borderRadius: BorderRadius.circular(
10), // Set border radius for the container
),
// padding: EdgeInsets.only(top: 0, bottom: 0, left: 10, right: 10),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
return WillPopScope(
onWillPop: () async {
return false;
},
child: Scaffold(
body: Container(
color: Colors.white, // Set the color for the body
child: SizedBox.expand(
child: Stack(children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(0),
color: Color(0xFFFFFCE5),
child: Column(children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFFCE5), // Set background color for the container
borderRadius: BorderRadius.circular(
10), // Set border radius for the container
),
// padding: EdgeInsets.only(top: 0, bottom: 0, left: 10, right: 10),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 100,
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 100,
),
),
),
),
),
],
),
],
),
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: SvgPicture.string(
SvgService.getSvg('mpin'),
width: 150,
height: 150,
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: SvgPicture.string(
SvgService.getSvg('mpin'),
width: 150,
height: 150,
),
),
),
),
),
],
),
],
),
SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Text(
'Enter PIN to login',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 16,
color: Color(0xFF404040),
fontWeight: FontWeight.w500,
SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Text(
'Enter PIN to login',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 16,
color: Color(0xFF404040),
fontWeight: FontWeight.w500,
),
),
),
),
],
),
SizedBox(height: 10),
],
),
SizedBox(height: 10),
],
),
),
Container(
decoration: BoxDecoration(
color: Colors
.white, // Set background color for the container
borderRadius: BorderRadius.only(
topLeft: Radius.circular(150.0),
topRight: Radius.circular(0),
), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 20, bottom: 10, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
Row(
),
Container(
decoration: BoxDecoration(
color: Colors
.white, // Set background color for the container
borderRadius: BorderRadius.only(
topLeft: Radius.circular(150.0),
topRight: Radius.circular(0),
), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 20, bottom: 10, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
Expanded(
flex: 12,
child: Column(
children: [
SizedBox(height: 40),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Enter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight.w400,
Row(
children: [
Expanded(
flex: 12,
child: Column(
children: [
SizedBox(height: 40),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Enter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight
.w400,
),
),
),
]),
),
SizedBox(height: 5),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder:
(index) =>
const SizedBox(
width: 8),
showCursor: true,
controller:
_pinController,
validator: _validatePin,
errorPinTheme:
defaultPinTheme
.copyBorderWith(
border: Border.all(
color: Colors
.redAccent),
),
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment
.end,
children: [
Container(
margin:
const EdgeInsets
.only(
bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius
.circular(8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius
.circular(19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
),
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton
.styleFrom(
backgroundColor:
Color(0xFF00989E),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
10),
),
),
),
]),
),
SizedBox(height: 5),
Container(
margin: EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder: (index) =>
const SizedBox(width: 8),
showCursor: true,
controller: _pinController,
validator: _validatePin,
errorPinTheme: defaultPinTheme
.copyBorderWith(
border: Border.all(
color:
Colors.redAccent),
),
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Container(
margin: const EdgeInsets
.only(bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius.circular(
8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius.circular(
19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
),
SizedBox(height: 15),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton
.styleFrom(
backgroundColor:
Color(0xFF00989E),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(10),
),
),
onPressed: () async {
enterLoginPin();
},
child: Text(
"Submit",
style:
GoogleFonts.poppins(
color: Color(
0xFFFFFFFF)),
),
),
),
),
SizedBox(height: 15),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
forgotPin();
},
child: Text(
'Forget PIN?',
style:
GoogleFonts.poppins(
fontSize: 12,
color:
Color(0xFF929292),
fontWeight:
FontWeight.w400,
onPressed: () async {
enterLoginPin();
},
child: Text(
"Submit",
style: GoogleFonts
.poppins(
color: Color(
0xFFFFFFFF)),
),
),
),
],
),
),
SizedBox(height: 15),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
GestureDetector(
onTap: () {
forgotPin();
},
child: Text(
'Forget PIN?',
style: GoogleFonts
.poppins(
fontSize: 12,
color: Color(
0xFF929292),
fontWeight:
FontWeight
.w400,
),
),
),
],
),
),
],
),
],
),
),
],
),
],
),
],
),
),
),
),
],
),
],
),
),
]),
)),
Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity, // Make the footer full width
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
]),
)),
Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity, // Make the footer full width
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
),
),
),
),
]),
)));
]),
))));
}
}

View File

@ -173,475 +173,513 @@ class _pinSettingPageState extends State<pinSettingPage> {
),
);
return Scaffold(
body: Container(
color: Colors.white, // Set the color for the body
child: SizedBox.expand(
child: Stack(children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(0),
color: Color(0xFFFFFCE5),
child: Column(children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFFCE5), // Set background color for the container
borderRadius: BorderRadius.circular(
10), // Set border radius for the container
),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
return WillPopScope(
onWillPop: () async {
return false;
},
child: Scaffold(
body: Container(
color: Colors.white, // Set the color for the body
child: SizedBox.expand(
child: Stack(children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(0),
color: Color(0xFFFFFCE5),
child: Column(children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFFCE5), // Set background color for the container
borderRadius: BorderRadius.circular(
10), // Set border radius for the container
),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 100,
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 100,
),
),
),
),
),
],
),
],
),
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: SvgPicture.string(
SvgService.getSvg('mpin'),
width: 150,
height: 150,
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0), // Add left margin
child: SvgPicture.string(
SvgService.getSvg('mpin'),
width: 150,
height: 150,
),
),
),
),
),
],
),
],
),
SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Text(
'Set PIN To enter',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 16,
color: Color(0xFF404040),
fontWeight: FontWeight.w500,
SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Text(
'Set PIN To enter',
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontSize: 16,
color: Color(0xFF404040),
fontWeight: FontWeight.w500,
),
),
),
),
],
),
SizedBox(height: 10),
],
),
SizedBox(height: 10),
],
),
),
Container(
decoration: BoxDecoration(
color: Colors
.white, // Set background color for the container
borderRadius: BorderRadius.only(
topLeft: Radius.circular(150.0),
topRight: Radius.circular(0),
), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 20, bottom: 10, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
Row(
),
Container(
decoration: BoxDecoration(
color: Colors
.white, // Set background color for the container
borderRadius: BorderRadius.only(
topLeft: Radius.circular(150.0),
topRight: Radius.circular(0),
), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 20, bottom: 10, left: 10, right: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
Expanded(
flex: 12,
child: Column(
children: [
SizedBox(height: 40),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Enter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight.w400,
Row(
children: [
Expanded(
flex: 12,
child: Column(
children: [
SizedBox(height: 40),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Enter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight
.w400,
),
),
),
),
]),
),
SizedBox(height: 5),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder:
(index) =>
const SizedBox(
width: 8),
showCursor: true,
controller:
_pinController,
validator: _validatePin,
errorPinTheme:
defaultPinTheme
.copyBorderWith(
border: Border.all(
color: Colors
.redAccent),
),
]),
),
SizedBox(height: 5),
Container(
margin: EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder: (index) =>
const SizedBox(width: 8),
showCursor: true,
controller: _pinController,
validator: _validatePin,
errorPinTheme: defaultPinTheme
.copyBorderWith(
border: Border.all(
color:
Colors.redAccent),
),
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Container(
margin: const EdgeInsets
.only(bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius.circular(
8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius.circular(
19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
),
SizedBox(height: 15),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Reenter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight.w400,
),
),
),
]),
),
SizedBox(height: 5),
Container(
margin: Responsive.isDesktop(
context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder: (index) =>
const SizedBox(width: 8),
showCursor: true,
controller:
_confirmPinController,
validator:
_validateConfirmPin,
errorPinTheme: defaultPinTheme
.copyBorderWith(
border: Border.all(
color:
Colors.redAccent),
),
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Container(
margin: const EdgeInsets
.only(bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius.circular(
8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme.copyWith(
decoration: defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius.circular(
19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
),
SizedBox(height: 15),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.end, // Align text to the right
children: [
Text(
'Enable Biometric',
style:
GoogleFonts.poppins(
fontSize: 12,
color:
Color(0xFF000000),
fontWeight:
FontWeight.w400,
),
),
SizedBox(
width:
10), // Optional: Add some spacing between the text and switch
Transform.scale(
scale:
0.8, // Adjust the scale factor to change the size
child: Switch(
value:
_enableBiometric,
onChanged: (value) {
setState(() {
_enableBiometric =
value;
});
},
activeColor: Color(
0xFFE26728), // Color when the switch is ON
inactiveTrackColor: Color(
0xFFD8D8D8), // Color of the switch track when OFF
),
),
]),
),
SizedBox(height: 15),
Container(
margin: EdgeInsets.symmetric(
horizontal: 30),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton
.styleFrom(
backgroundColor:
Color(0xFF00989E),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(10),
),
),
onPressed: () async {
setLoginPin();
},
child: Text(
"Save",
style:
GoogleFonts.poppins(
color: Color(
0xFFFFFFFF)),
),
),
),
),
SizedBox(height: 15),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
setSkipStatus();
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
child: Text(
'Skip ?',
style:
GoogleFonts.poppins(
fontSize: 12,
color:
Color(0xFF929292),
fontWeight:
FontWeight.w400,
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment
.end,
children: [
Container(
margin:
const EdgeInsets
.only(
bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius
.circular(8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius
.circular(19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
],
),
),
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.start, // Align text to the right
children: [
Align(
// alignment: Alignment.centerLeft,
child: Text(
'Reenter the 4 Digit pin',
style: GoogleFonts
.poppins(
fontSize: 16,
color: Color(
0xFF909090),
fontWeight:
FontWeight
.w400,
),
),
),
]),
),
SizedBox(height: 5),
Container(
margin: Responsive
.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 4,
defaultPinTheme:
defaultPinTheme,
separatorBuilder:
(index) =>
const SizedBox(
width: 8),
showCursor: true,
controller:
_confirmPinController,
validator:
_validateConfirmPin,
errorPinTheme:
defaultPinTheme
.copyBorderWith(
border: Border.all(
color: Colors
.redAccent),
),
hapticFeedbackType:
HapticFeedbackType
.lightImpact,
onCompleted: (pin) {
debugPrint(
'onCompleted: $pin');
},
onChanged: (value) {
debugPrint(
'onChanged: $value');
},
cursor: Column(
mainAxisAlignment:
MainAxisAlignment
.end,
children: [
Container(
margin:
const EdgeInsets
.only(
bottom: 9),
width: 22,
height: 1,
color:
focusedBorderColor,
),
],
),
focusedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
borderRadius:
BorderRadius
.circular(8),
border: Border.all(
color:
focusedBorderColor),
),
),
submittedPinTheme:
defaultPinTheme
.copyWith(
decoration:
defaultPinTheme
.decoration!
.copyWith(
color: fillColor,
borderRadius:
BorderRadius
.circular(19),
border: Border.all(
color:
focusedBorderColor),
),
),
),
),
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.end, // Align text to the right
children: [
Text(
'Enable Biometric',
style: GoogleFonts
.poppins(
fontSize: 12,
color: Color(
0xFF000000),
fontWeight:
FontWeight
.w400,
),
),
SizedBox(
width:
10), // Optional: Add some spacing between the text and switch
Transform.scale(
scale:
0.8, // Adjust the scale factor to change the size
child: Switch(
value:
_enableBiometric,
onChanged:
(value) {
setState(() {
_enableBiometric =
value;
});
},
activeColor: Color(
0xFFE26728), // Color when the switch is ON
inactiveTrackColor:
Color(
0xFFD8D8D8), // Color of the switch track when OFF
),
),
]),
),
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(
horizontal: 30),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton
.styleFrom(
backgroundColor:
Color(0xFF00989E),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
10),
),
),
onPressed: () async {
setLoginPin();
},
child: Text(
"Save",
style: GoogleFonts
.poppins(
color: Color(
0xFFFFFFFF)),
),
),
),
),
SizedBox(height: 15),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
GestureDetector(
onTap: () {
setSkipStatus();
},
child: Text(
'Skip ?',
style: GoogleFonts
.poppins(
fontSize: 12,
color: Color(
0xFF929292),
fontWeight:
FontWeight
.w400,
),
),
),
],
),
),
],
),
],
),
),
],
),
],
),
],
),
),
),
),
SizedBox(height: 40),
],
),
SizedBox(height: 40),
],
),
),
]),
)),
Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity, // Make the footer full width
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
]),
)),
Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity, // Make the footer full width
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
),
),
),
),
]),
)));
]),
))));
}
}

View File

@ -208,7 +208,7 @@ class _MyVerifyState extends State<MyVerify> {
} else {
if (token != null && token.isNotEmpty) {
ToastHelper.showSuccessToast(context, 'Successfully Login');
if (emp_status == 'enrolled') {
if (emp_status == 'enrolled' || emp_status == 'active') {
Navigator.pushReplacementNamed(context, 'home');
} else {
Navigator.pushReplacementNamed(context, 'empDetails');
@ -386,454 +386,481 @@ class _MyVerifyState extends State<MyVerify> {
),
);
return Scaffold(
body: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container(
height: _size.height,
color: Colors.white,
child: Stack(
children: [
Visibility(
visible: _size.width <= 1100,
child: ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
child: Container(
height: _size.height / 3,
width: double.infinity,
color: Color(0xFFFFFCE5),
child: Stack(
children: [
Column(
return WillPopScope(
onWillPop: () async {
Navigator.pushReplacementNamed(context, 'login');
return false;
},
child: Scaffold(
body: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container(
height: _size.height,
color: Colors.white,
child: Stack(
children: [
Visibility(
visible: _size.width <= 1100,
child: ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
child: Container(
height: _size.height / 3,
width: double.infinity,
color: Color(0xFFFFFCE5),
child: Stack(
children: [
Column(
children: [
SizedBox(
height: _size.height /
6.4), // Adjust the spacing between the rows
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Align to the center
children: [
Expanded(
flex: Responsive.isDesktop(context)
? 10
: 12,
child: Align(
alignment: Responsive.isDesktop(context)
? Alignment.centerLeft
: Alignment.bottomCenter,
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
),
),
),
if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context))
Expanded(
flex: 2,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
// Add your navigation logic here
// For example, you can use Navigator.push to navigate to another page
Navigator.pushNamed(
context, 'hrLogin');
},
child: Row(
mainAxisAlignment: MainAxisAlignment
.end, // Align to the end (right)
children: [
Text(
'HR Login',
style: GoogleFonts.poppins(
color: Color(
0xFF000000), // Text color
// Add other text styles as needed
),
),
SizedBox(width: 5),
Icon(
Icons
.east, // Icon for customer login
color: Colors
.black, // Adjust color as needed
),
],
),
),
),
),
],
),
],
),
],
),
),
),
),
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
SizedBox(
height: _size.height /
6.4), // Adjust the spacing between the rows
Row(
mainAxisAlignment: MainAxisAlignment
.center, // Align to the center
children: [
Expanded(
flex: Responsive.isDesktop(context) ? 10 : 12,
child: Align(
alignment: Responsive.isDesktop(context)
? Alignment.centerLeft
: Alignment.bottomCenter,
child: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
flex: _size.width < 1100 ? 6 : 12,
child: Container(
margin: _size.width > 1100
? EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(left: 0, right: 0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context))
Row(
children: [
Expanded(
flex: 10,
child: Align(
alignment: Responsive
.isDesktop(context)
? Alignment.centerLeft
: Alignment
.bottomCenter, // Align to the start
child: _size.width <= 1100
? Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
)
: _size.width > 1100
? Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
)
: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
),
)),
],
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: GoogleFonts.poppins(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text:
"Please enter the one-time usage code sent to your mobile number $mobileNumber",
style: TextStyle(
fontSize: 12,
height: 1.5,
color: Color(0xFF000000)),
children: [
TextSpan(
text: " (Change Number)",
style: TextStyle(
fontSize: 12,
color: Color(
0xFFE26728)), // Change color as desired
recognizer:
TapGestureRecognizer()
..onTap = () {
// Navigate to the page where the user can change the phone number
Navigator.pushNamed(
context, 'login');
},
),
],
),
),
),
SizedBox(height: 15),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: Pinput(
length: 6,
// defaultPinTheme: defaultPinTheme,
// focusedPinTheme: focusedPinTheme,
// submittedPinTheme: submittedPinTheme,
showCursor: true,
controller: _otpController,
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment
.end, // Align text to the right
children: [
_isTimerRunning
? Text(
"Resend OTP in $_secondsRemaining seconds",
style:
GoogleFonts.poppins(
color:
Colors.black),
)
: InkWell(
onTap: () {
_resendOTP();
},
child: Text(
"Resend OTP",
style:
GoogleFonts.poppins(
color: Colors
.blue),
),
),
],
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(
horizontal: 0),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor:
Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
),
onPressed: () {
if (_formKey.currentState!
.validate()) {
_formKey.currentState!
.save(); // Save form fields before calling verifyOTP
verifyOTP(
_otpController.text);
}
},
child: Text(
"Submit",
style: GoogleFonts.poppins(
color: Color(0xFFFFFFFF)),
),
),
),
),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Column(
children: [
SizedBox(height: 20),
Text(
"Benefits of Login",
style:
GoogleFonts.poppins(
fontSize: 20,
fontWeight:
FontWeight.bold,
),
),
SizedBox(height: 15),
],
))
: SizedBox(),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
flex: 6,
child: Container(
padding: EdgeInsets
.symmetric(
vertical: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Expanded(
child: Container(
padding: EdgeInsets
.symmetric(
vertical:
12),
decoration:
BoxDecoration(
border:
Border(
right:
BorderSide(
width: 1,
color: Colors
.black,
),
),
),
child: Column(
children: [
Icon(
Icons
.policy,
color: Color(
0xFFE26728)),
SizedBox(
height:
10),
Text(
"View Policy",
style: GoogleFonts
.poppins()),
],
),
),
),
Expanded(
child: Container(
padding: EdgeInsets
.symmetric(
vertical:
12),
child: Column(
children: [
Icon(
Icons
.edit,
color: Color(
0xFFE26728)),
SizedBox(
height:
10),
Text(
"Manage Claims",
style: GoogleFonts
.poppins()),
],
),
),
),
],
),
),
),
],
),
)
: SizedBox(
height: Responsive.isDesktop(
context)
? _size.height * 0.1
: _size.height * 0.2,
),
SizedBox(
height: _size.height * 0.1,
),
Container(
alignment: Alignment.bottomCenter,
padding:
EdgeInsets.symmetric(vertical: 8),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text:
'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
),
),
],
),
),
),
if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context))
if (_size.width > 1100)
Expanded(
flex: 2,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
// Add your navigation logic here
// For example, you can use Navigator.push to navigate to another page
Navigator.pushNamed(
context, 'hrLogin');
},
child: Row(
mainAxisAlignment: MainAxisAlignment
.end, // Align to the end (right)
children: [
Text(
'HR Login',
style: GoogleFonts.poppins(
color: Color(
0xFF000000), // Text color
// Add other text styles as needed
),
),
SizedBox(width: 5),
Icon(
Icons
.east, // Icon for customer login
color: Colors
.black, // Adjust color as needed
),
],
),
),
flex: _size.width < 1100 ? 6 : 12,
child: LayoutBuilder(
builder: (BuildContext context,
BoxConstraints constraints) {
if (constraints.maxWidth > 600) {
return Image.asset(
'assets/login_web.jpg',
height: _size.height,
fit: BoxFit.cover,
);
} else {
return SizedBox();
}
},
),
),
],
),
],
),
],
),
),
),
),
),
Container(
margin: marginInsets,
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Form(
key: _formKey,
child: Column(
children: [
Row(
children: [
Expanded(
flex: _size.width < 1100 ? 6 : 12,
child: Container(
margin: _size.width > 1100
? EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(left: 0, right: 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (!Responsive.isMobile(context) &&
!Responsive.isTablet(context))
Row(
children: [
Expanded(
flex: 10,
child: Align(
alignment: Responsive.isDesktop(
context)
? Alignment.centerLeft
: Alignment
.bottomCenter, // Align to the start
child: _size.width <= 1100
? Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
)
: _size.width > 1100
? Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
)
: Image.asset(
'assets/nhance_app_logo.png',
width: 150,
height: 150,
),
)),
],
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: GoogleFonts.poppins(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text:
"Please enter the one-time usage code sent to your mobile number $mobileNumber",
style: TextStyle(
fontSize: 12,
height: 1.5,
color: Color(0xFF000000)),
children: [
TextSpan(
text: " (Change Number)",
style: TextStyle(
fontSize: 12,
color: Color(
0xFFE26728)), // Change color as desired
recognizer: TapGestureRecognizer()
..onTap = () {
// Navigate to the page where the user can change the phone number
Navigator.pushNamed(
context, 'login');
},
),
],
),
),
),
SizedBox(height: 15),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0),
child: Pinput(
length: 6,
// defaultPinTheme: defaultPinTheme,
// focusedPinTheme: focusedPinTheme,
// submittedPinTheme: submittedPinTheme,
showCursor: true,
controller: _otpController,
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment
.end, // Align text to the right
children: [
_isTimerRunning
? Text(
"Resend OTP in $_secondsRemaining seconds",
style: GoogleFonts.poppins(
color: Colors.black),
)
: InkWell(
onTap: () {
_resendOTP();
},
child: Text(
"Resend OTP",
style: GoogleFonts.poppins(
color: Colors.blue),
),
),
],
),
),
SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? EdgeInsets.symmetric(
horizontal: 150)
: EdgeInsets.symmetric(horizontal: 0),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
),
onPressed: () {
if (_formKey.currentState!
.validate()) {
_formKey.currentState!
.save(); // Save form fields before calling verifyOTP
verifyOTP(_otpController.text);
}
},
child: Text(
"Submit",
style: GoogleFonts.poppins(
color: Color(0xFFFFFFFF)),
),
),
),
),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Column(
children: [
SizedBox(height: 20),
Text(
"Benefits of Login",
style: GoogleFonts.poppins(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 15),
],
))
: SizedBox(),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
flex: 6,
child: Container(
padding:
EdgeInsets.symmetric(
vertical: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Expanded(
child: Container(
padding: EdgeInsets
.symmetric(
vertical:
12),
decoration:
BoxDecoration(
border: Border(
right:
BorderSide(
width: 1,
color: Colors
.black,
),
),
),
child: Column(
children: [
Icon(
Icons
.policy,
color: Color(
0xFFE26728)),
SizedBox(
height: 10),
Text(
"View Policy",
style: GoogleFonts
.poppins()),
],
),
),
),
Expanded(
child: Container(
padding: EdgeInsets
.symmetric(
vertical:
12),
child: Column(
children: [
Icon(Icons.edit,
color: Color(
0xFFE26728)),
SizedBox(
height: 10),
Text(
"Manage Claims",
style: GoogleFonts
.poppins()),
],
),
),
),
],
),
),
),
],
),
)
: SizedBox(
height:
Responsive.isDesktop(context)
? _size.height * 0.1
: _size.height * 0.2,
),
SizedBox(
height: _size.height * 0.1,
),
Container(
alignment: Alignment.bottomCenter,
padding:
EdgeInsets.symmetric(vertical: 8),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text:
'By continuing, you agree with our ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
children: <TextSpan>[
TextSpan(
text: 'privacy policy ',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
TextSpan(
text: 'and ',
style: GoogleFonts.poppins(
color: Colors.black,
fontSize: 9,
),
),
TextSpan(
text: 'terms of use',
style: GoogleFonts.poppins(
color: Color(0xFF00989E),
fontSize: 9,
),
),
],
),
),
),
],
),
),
),
if (_size.width > 1100)
Expanded(
flex: _size.width < 1100 ? 6 : 12,
child: LayoutBuilder(
builder: (BuildContext context,
BoxConstraints constraints) {
if (constraints.maxWidth > 600) {
return Image.asset(
'assets/login_web.jpg',
height: _size.height,
fit: BoxFit.cover,
);
} else {
return SizedBox();
}
},
),
),
],
),
],
),
),
),
),
],
)),
));
],
)),
)));
}
}

View File

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