From 82b039deab4f4b7439c32a80fb3f864e116f7866 Mon Sep 17 00:00:00 2001 From: venbaittech Date: Fri, 20 Sep 2024 17:02:43 +0530 Subject: [PATCH] CHANGE_ : Chatbot and bug fix --- .env | 2 +- android/app/src/main/AndroidManifest.xml | 4 + ios/Runner/Info.plist | 4 + lib/customAppBar/customAppBarChatbot.dart | 87 ++ lib/main.dart | 2 + lib/pages/enrollment/addons.dart | 42 +- lib/pages/enrollment/empDetails.dart | 41 +- lib/pages/enrollment/empReview.dart | 89 +- lib/pages/login.dart | 1003 +++++++++-------- lib/pages/postEnrollment/chatbot.dart | 3 +- lib/pages/postEnrollment/claimprocess.dart | 4 + lib/pages/postEnrollment/claims.dart | 4 + lib/pages/postEnrollment/claimtracklist.dart | 4 + lib/pages/postEnrollment/data.dart | 4 +- .../generalexclusionsdeductibles.dart | 4 + lib/pages/postEnrollment/help.dart | 273 +++-- lib/pages/postEnrollment/home.dart | 10 +- lib/pages/postEnrollment/planclaimsform.dart | 6 +- lib/pages/postEnrollment/policies.dart | 33 +- lib/pages/postEnrollment/profile.dart | 4 + lib/pages/postEnrollment/wellness.dart | 217 ++++ lib/pages/session/SetPinBiometric.dart | 606 +++++----- .../session/settingUpPinAndBiometric.dart | 912 ++++++++------- lib/pages/verify.dart | 895 ++++++++------- pubspec.yaml | 1 + 25 files changed, 2372 insertions(+), 1882 deletions(-) create mode 100644 lib/customAppBar/customAppBarChatbot.dart create mode 100644 lib/pages/postEnrollment/wellness.dart diff --git a/.env b/.env index 9a9d739..5ea1d81 100644 --- a/.env +++ b/.env @@ -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 \ No newline at end of file +ENV=uat \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c33638b..446fa34 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -28,6 +28,10 @@ android:resource="@style/NormalTheme" /> + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index e8cfb01..11b88b4 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -43,6 +43,10 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + LSApplicationQueriesSchemes + + https + CADisableMinimumFrameDurationOnPhone UIApplicationSupportsIndirectInputEvents diff --git a/lib/customAppBar/customAppBarChatbot.dart b/lib/customAppBar/customAppBarChatbot.dart new file mode 100644 index 0000000..d8ec647 --- /dev/null +++ b/lib/customAppBar/customAppBarChatbot.dart @@ -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 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 + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index f31b636..fed373d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 main() async { 'help': (context) => help(), 'claimprocess': (context) => claimprocess(), 'profile': (context) => profile(), + 'wellness': (context) => wellness(), 'planclaimsform': (context) => planclaimsform(), 'claimtracklist': (context) => claimtracklist(), 'privacypolicy': (context) => privacypolicy(), diff --git a/lib/pages/enrollment/addons.dart b/lib/pages/enrollment/addons.dart index 5db343e..6da0857 100644 --- a/lib/pages/enrollment/addons.dart +++ b/lib/pages/enrollment/addons.dart @@ -3883,6 +3883,8 @@ class _addOnsDetailsState extends State { 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 { 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 { } } + Future _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 floaterData, action) { print(action); print(floaterData); @@ -4301,21 +4317,11 @@ class _addOnsDetailsState extends State { 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 { 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, diff --git a/lib/pages/enrollment/empDetails.dart b/lib/pages/enrollment/empDetails.dart index a5497cb..1b9f0b8 100644 --- a/lib/pages/enrollment/empDetails.dart +++ b/lib/pages/enrollment/empDetails.dart @@ -829,6 +829,8 @@ class _empDetailsState extends State { 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 { 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 { } } + // Function to open URL in the default browser + Future _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 floaterData, action) { print(action); print(floaterData); @@ -1706,13 +1723,7 @@ class _empDetailsState extends State { 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 { 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, diff --git a/lib/pages/enrollment/empReview.dart b/lib/pages/enrollment/empReview.dart index dd544dd..fbf09ad 100644 --- a/lib/pages/enrollment/empReview.dart +++ b/lib/pages/enrollment/empReview.dart @@ -727,6 +727,19 @@ class _empReviewDetailsState extends State { ); } + // Function to open URL in the default browser + Future _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 { 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 { 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 { 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 { 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 { 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 { 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 { 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: diff --git a/lib/pages/login.dart b/lib/pages/login.dart index 7ca1373..12fbb34 100644 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -256,502 +256,537 @@ class _loginState extends State { top: 0, // Example value for mobile ); } - 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 { + // 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( + 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: [ - SizedBox( - height: _size.height / - 6.4), // Adjust the spacing between the rows - Row( - mainAxisAlignment: MainAxisAlignment - .center, // Align to the center + Column( 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: TextStyle( - color: Color( - 0xFF000000), // Text color - // Add other text styles as needed - ), + 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: TextStyle( + 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 + ), + ], ), - 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: [ + 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: 12, + 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: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + "Login with your mobile number and OTP to review and enroll for exciting health benefits for you and your family", + style: GoogleFonts.poppins( + fontSize: 12, + color: Color(0xFF000000)), + textAlign: TextAlign.center, + ), + ) + ], + ), + ), + SizedBox( + height: 20, + ), + Container( + height: 55, + margin: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: 150) + : EdgeInsets.symmetric( + horizontal: 0), + decoration: BoxDecoration( + border: Border.all( + width: 1, color: Colors.grey), + borderRadius: + BorderRadius.circular(10), + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + SizedBox( + width: 10, + ), + SizedBox( + width: 40, + child: TextField( + controller: countryController, + keyboardType: + TextInputType.number, + decoration: InputDecoration( + border: InputBorder.none, + ), + ), + ), + Text( + "|", + style: TextStyle( + fontSize: 33, + color: Colors.grey), + ), + SizedBox( + width: 10, + ), + Expanded( + child: TextFormField( + controller: mobileController, + keyboardType: + TextInputType.phone, + decoration: InputDecoration( + border: InputBorder.none, + hintText: + "Enter your mobile number", + ), + validator: (value) { + if (value == null || + value.isEmpty) { + return 'Please enter your mobile number'; + } + if (value.length != 10) { + return 'Mobile number must be 10 digits'; + } + return null; + }, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly, + LengthLimitingTextInputFormatter( + 10), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 20, + ), + 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: _isLoading + ? null + : verifyMobileNumber, + child: _isLoading + ? CircularProgressIndicator( + valueColor: + AlwaysStoppedAnimation< + Color>( + Color( + 0xFF00989E)), + ) + : Text( + "Login With OTP", + style: + GoogleFonts.poppins( + color: Color( + 0xFFFFFFFF)), + ), + ), + ), + ), + SizedBox( + height: _size.width <= 1100 ? 0 : 0, + ), + _size.width > 1100 + ? Container( + margin: EdgeInsets.symmetric( + horizontal: 150), + child: Column( + children: [ + SizedBox(height: 30), + 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"), + ], + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets + .symmetric( + vertical: + 12), + child: Column( + children: [ + Icon( + Icons + .edit, + color: Color( + 0xFFE26728)), + SizedBox( + height: + 10), + Text( + "Manage Claims"), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ) + : 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: [ + WidgetSpan( + child: MouseRegion( + cursor: SystemMouseCursors + .click, + child: GestureDetector( + onTap: () { + Navigator.pushNamed( + context, + 'privacypolicy'); + }, + child: Text( + 'privacy policy ', + style: + GoogleFonts.poppins( + color: + Color(0xFF00989E), + fontSize: 9, + decoration: + TextDecoration + .underline, + ), + ), + ), + ), + ), + TextSpan( + text: 'and ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + ), + WidgetSpan( + child: MouseRegion( + cursor: SystemMouseCursors + .click, + child: GestureDetector( + onTap: () { + Navigator.pushNamed( + context, + 'termsofuse'); + }, + child: Text( + 'terms of use', + style: + GoogleFonts.poppins( + color: + Color(0xFF00989E), + fontSize: 9, + decoration: + TextDecoration + .underline, + ), + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + 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(); + } + }, ), ), ], ), ], ), - ], + ), ), ), - ), - ), - 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: 12, - 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: Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: Text( - "Login with your mobile number and OTP to review and enroll for exciting health benefits for you and your family", - style: GoogleFonts.poppins( - fontSize: 12, - color: Color(0xFF000000)), - textAlign: TextAlign.center, - ), - ) - ], - ), - ), - SizedBox( - height: 20, - ), - Container( - height: 55, - margin: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( - horizontal: 150) - : EdgeInsets.symmetric(horizontal: 0), - decoration: BoxDecoration( - border: Border.all( - width: 1, color: Colors.grey), - borderRadius: BorderRadius.circular(10), - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SizedBox( - width: 10, - ), - SizedBox( - width: 40, - child: TextField( - controller: countryController, - keyboardType: - TextInputType.number, - decoration: InputDecoration( - border: InputBorder.none, - ), - ), - ), - Text( - "|", - style: TextStyle( - fontSize: 33, - color: Colors.grey), - ), - SizedBox( - width: 10, - ), - Expanded( - child: TextFormField( - controller: mobileController, - keyboardType: TextInputType.phone, - decoration: InputDecoration( - border: InputBorder.none, - hintText: - "Enter your mobile number", - ), - validator: (value) { - if (value == null || - value.isEmpty) { - return 'Please enter your mobile number'; - } - if (value.length != 10) { - return 'Mobile number must be 10 digits'; - } - return null; - }, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, - LengthLimitingTextInputFormatter( - 10), - ], - ), - ), - ], - ), - ), - SizedBox( - height: 20, - ), - 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: _isLoading - ? null - : verifyMobileNumber, - child: _isLoading - ? CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation< - Color>( - Color(0xFF00989E)), - ) - : Text( - "Login With OTP", - style: GoogleFonts.poppins( - color: Color(0xFFFFFFFF)), - ), - ), - ), - ), - SizedBox( - height: _size.width <= 1100 ? 0 : 0, - ), - _size.width > 1100 - ? Container( - margin: EdgeInsets.symmetric( - horizontal: 150), - child: Column( - children: [ - SizedBox(height: 30), - 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"), - ], - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets - .symmetric( - vertical: - 12), - child: Column( - children: [ - Icon(Icons.edit, - color: Color( - 0xFFE26728)), - SizedBox( - height: 10), - Text( - "Manage Claims"), - ], - ), - ), - ), - ], - ), - ), - ), - ], - ), - ) - : 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: [ - WidgetSpan( - child: MouseRegion( - cursor: - SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - Navigator.pushNamed(context, - 'privacypolicy'); - }, - child: Text( - 'privacy policy ', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - decoration: TextDecoration - .underline, - ), - ), - ), - ), - ), - TextSpan( - text: 'and ', - style: GoogleFonts.poppins( - color: Colors.black, - fontSize: 9, - ), - ), - WidgetSpan( - child: MouseRegion( - cursor: - SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - Navigator.pushNamed( - context, 'termsofuse'); - }, - child: Text( - 'terms of use', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - decoration: TextDecoration - .underline, - ), - ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - 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(); - } - }, - ), - ), - ], - ), - ], - ), - ), - ), - ), - ], - )), - )); + ], + )), + ))); } } diff --git a/lib/pages/postEnrollment/chatbot.dart b/lib/pages/postEnrollment/chatbot.dart index 19da9a2..27d0495 100644 --- a/lib/pages/postEnrollment/chatbot.dart +++ b/lib/pages/postEnrollment/chatbot.dart @@ -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 { @override Widget build(BuildContext context) { return Scaffold( - appBar: CustomAppBar(), + appBar: CustomAppBarChatbot(), body: DashChat( currentUser: user, onSend: (ChatMessage m) { diff --git a/lib/pages/postEnrollment/claimprocess.dart b/lib/pages/postEnrollment/claimprocess.dart index e12b1ff..8f50f91 100644 --- a/lib/pages/postEnrollment/claimprocess.dart +++ b/lib/pages/postEnrollment/claimprocess.dart @@ -768,6 +768,8 @@ class _claimprocessState extends State { 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 { Icons.sticky_note_2_outlined, Icons.person_outline_outlined, Icons.headset_mic_outlined, + Icons.health_and_safety_outlined, ], labels: [ "Home", "Claim", "Profile", "Help", + "Wellness", ], ), ); diff --git a/lib/pages/postEnrollment/claims.dart b/lib/pages/postEnrollment/claims.dart index 90a3270..efa8218 100644 --- a/lib/pages/postEnrollment/claims.dart +++ b/lib/pages/postEnrollment/claims.dart @@ -653,6 +653,8 @@ class _claimsState extends State { 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 { 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 ), diff --git a/lib/pages/postEnrollment/claimtracklist.dart b/lib/pages/postEnrollment/claimtracklist.dart index ea08e31..01db188 100644 --- a/lib/pages/postEnrollment/claimtracklist.dart +++ b/lib/pages/postEnrollment/claimtracklist.dart @@ -528,6 +528,8 @@ class _claimtracklistformState extends State { 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 { 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 ), ); diff --git a/lib/pages/postEnrollment/data.dart b/lib/pages/postEnrollment/data.dart index 578cb46..1974183 100755 --- a/lib/pages/postEnrollment/data.dart +++ b/lib/pages/postEnrollment/data.dart @@ -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'); diff --git a/lib/pages/postEnrollment/generalexclusionsdeductibles.dart b/lib/pages/postEnrollment/generalexclusionsdeductibles.dart index a27cf4c..7ad0611 100644 --- a/lib/pages/postEnrollment/generalexclusionsdeductibles.dart +++ b/lib/pages/postEnrollment/generalexclusionsdeductibles.dart @@ -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", ], ), ); diff --git a/lib/pages/postEnrollment/help.dart b/lib/pages/postEnrollment/help.dart index 2bddf11..20d5dcb 100644 --- a/lib/pages/postEnrollment/help.dart +++ b/lib/pages/postEnrollment/help.dart @@ -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 { } } + 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 { children: [ SvgPicture.string( SvgService.getSvg('help'), - width: 300, - height: 300, + width: 150, + height: 150, ), ], ))), @@ -235,15 +260,124 @@ class _helpState extends State { ], ), ), - 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: [ + 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: [ + 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 { ], ), ), - SizedBox(height: 15), + SizedBox(height: 5), if (trackClaimsList == null) Card( elevation: 0, @@ -549,98 +683,6 @@ class _helpState extends State { 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: [ - 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: [ - 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 { 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 { 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 { ), ), 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 + ), + ) ], )) ], diff --git a/lib/pages/postEnrollment/home.dart b/lib/pages/postEnrollment/home.dart index dfba724..4c3c5b5 100644 --- a/lib/pages/postEnrollment/home.dart +++ b/lib/pages/postEnrollment/home.dart @@ -636,6 +636,8 @@ class _MyAppState extends State { 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 { 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 ), ); diff --git a/lib/pages/postEnrollment/planclaimsform.dart b/lib/pages/postEnrollment/planclaimsform.dart index 1c5dcb9..7dfbc0f 100644 --- a/lib/pages/postEnrollment/planclaimsform.dart +++ b/lib/pages/postEnrollment/planclaimsform.dart @@ -872,7 +872,7 @@ class _planclaimsformState extends State { ), ), ), - 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 { } 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 { 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 ), ); diff --git a/lib/pages/postEnrollment/policies.dart b/lib/pages/postEnrollment/policies.dart index 3089a38..a6461cb 100644 --- a/lib/pages/postEnrollment/policies.dart +++ b/lib/pages/postEnrollment/policies.dart @@ -100,11 +100,16 @@ class _policiesState extends State { return formattedDate; } - _launchURL(String ecardURL) async { - if (await canLaunch(ecardURL)) { - await launch(ecardURL); +// Function to open URL in the default browser + Future _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 { : 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 { 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 { 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 { 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, '', ''), ], ), ], diff --git a/lib/pages/postEnrollment/profile.dart b/lib/pages/postEnrollment/profile.dart index 4f5237e..ed81129 100644 --- a/lib/pages/postEnrollment/profile.dart +++ b/lib/pages/postEnrollment/profile.dart @@ -676,6 +676,8 @@ class _profileState extends State { 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 { 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 ), diff --git a/lib/pages/postEnrollment/wellness.dart b/lib/pages/postEnrollment/wellness.dart new file mode 100644 index 0000000..31c3811 --- /dev/null +++ b/lib/pages/postEnrollment/wellness.dart @@ -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 createState() => _wellnessState(); +} + +class _wellnessState extends State { + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + // Function to open URL in the default browser + Future _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: [ + 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 + ), + ); + } +} diff --git a/lib/pages/session/SetPinBiometric.dart b/lib/pages/session/SetPinBiometric.dart index 287fd4e..08bc31b 100644 --- a/lib/pages/session/SetPinBiometric.dart +++ b/lib/pages/session/SetPinBiometric.dart @@ -104,7 +104,7 @@ class _pinPageState extends State { 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 { ), ); - 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( - 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( + 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, - ), - ), - ], + ), ), ), - ), - ), - ]), - ))); + ]), + )))); } } diff --git a/lib/pages/session/settingUpPinAndBiometric.dart b/lib/pages/session/settingUpPinAndBiometric.dart index be98b7a..a022bc6 100644 --- a/lib/pages/session/settingUpPinAndBiometric.dart +++ b/lib/pages/session/settingUpPinAndBiometric.dart @@ -173,475 +173,513 @@ class _pinSettingPageState extends State { ), ); - 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( - 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( + 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, - ), - ), - ], + ), ), ), - ), - ), - ]), - ))); + ]), + )))); } } diff --git a/lib/pages/verify.dart b/lib/pages/verify.dart index 8ba3340..283d760 100644 --- a/lib/pages/verify.dart +++ b/lib/pages/verify.dart @@ -208,7 +208,7 @@ class _MyVerifyState extends State { } 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 { ), ); - 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( + 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( - 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(); - } - }, - ), - ), - ], - ), - ], - ), - ), - ), - ), - ], - )), - )); + ], + )), + ))); } } diff --git a/pubspec.yaml b/pubspec.yaml index 7a6db32..431d197 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: