diff --git a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/configure_fingerprint.bin index 6f4486c..94fe891 100644 --- a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logc a _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  3 ހ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ц3 ހ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/additional_project_files.txt  3  ´2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/additional_project_files.txt  ц3  ´2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/android_gradle_build.json  3 ´2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/android_gradle_build.json  ц3 ´2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/android_gradle_build_mini.json  3 ´2x +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/android_gradle_build_mini.json  ц3 ´2x v -t/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build.ninja  3 ´2| +t/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build.ninja  ц3 ´2| z -x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build.ninja.txt  3 +x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build.ninja.txt  ц3  -}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build_file_index.txt  3 _ ´2 +}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/build_file_index.txt  ц3 _ ´2  -~/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/compile_commands.json  3  +~/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/compile_commands.json  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/compile_commands.json.bin  3 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/compile_commands.json.bin  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/metadata_generation_command.txt  3  ´2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/metadata_generation_command.txt  ц3  ´2 } -{/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/prefab_config.json  3  ( ´2 +{/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/prefab_config.json  ц3  ( ´2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/symbol_folder_index.txt  3  w ´2 \ No newline at end of file +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/arm64-v8a/symbol_folder_index.txt  ц3  w ´2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/configure_fingerprint.bin index 63446e5..f2a53b4 100644 --- a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logc a _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  3 ހ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ц3 ހ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/additional_project_files.txt  3  Ǵ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/additional_project_files.txt  ц3  Ǵ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/android_gradle_build.json  3 Ǵ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/android_gradle_build.json  ц3 Ǵ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/android_gradle_build_mini.json  3 Ǵ2z +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/android_gradle_build_mini.json  ц3 Ǵ2z x -v/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build.ninja  3 Ǵ2~ +v/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build.ninja  ц3 Ǵ2~ | -z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build.ninja.txt  3 +z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build.ninja.txt  ц3  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build_file_index.txt  3 _ Ǵ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/build_file_index.txt  ц3 _ Ǵ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/compile_commands.json  3  +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/compile_commands.json  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/compile_commands.json.bin  3 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/compile_commands.json.bin  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/metadata_generation_command.txt  3  Ǵ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/metadata_generation_command.txt  ц3  Ǵ2  -}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/prefab_config.json  3  ( Ǵ2 +}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/prefab_config.json  ц3  ( Ǵ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/symbol_folder_index.txt  3  y Ǵ2 \ No newline at end of file +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/armeabi-v7a/symbol_folder_index.txt  ц3  y Ǵ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/configure_fingerprint.bin index adc2972..018bd9c 100644 --- a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logc a _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  3 ހ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ц3 ހ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/additional_project_files.txt  3  ˴2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/additional_project_files.txt  ц3  ˴2 ~ -|/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/android_gradle_build.json  3 ˴2 +|/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/android_gradle_build.json  ц3 ˴2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/android_gradle_build_mini.json  3 ˴2r +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/android_gradle_build_mini.json  ц3 ˴2r p -n/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build.ninja  3 ˴2v +n/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build.ninja  ц3 ˴2v t -r/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build.ninja.txt  3{ +r/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build.ninja.txt  ц3{ y -w/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build_file_index.txt  3 _ ˴2| +w/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/build_file_index.txt  ц3 _ ˴2| z -x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/compile_commands.json  3  +x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/compile_commands.json  ц3  ~ -|/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/compile_commands.json.bin  3 +|/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/compile_commands.json.bin  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/metadata_generation_command.txt  3  ˴2y +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/metadata_generation_command.txt  ц3  ˴2y w -u/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/prefab_config.json  3  ( ˴2~ +u/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/prefab_config.json  ц3  ( ˴2~ | -z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/symbol_folder_index.txt  3  q ˴2 \ No newline at end of file +z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86/symbol_folder_index.txt  ц3  q ˴2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/configure_fingerprint.bin index a2b64f7..341f1ba 100644 --- a/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Logc a _/Users/venbateam/Documents/flutter/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  3 ހ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ц3 ހ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/additional_project_files.txt  3  ϴ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/additional_project_files.txt  ц3  ϴ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/android_gradle_build.json  3 ϴ2 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/android_gradle_build.json  ц3 ϴ2  -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/android_gradle_build_mini.json  3 ϴ2u +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/android_gradle_build_mini.json  ц3 ϴ2u s -q/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build.ninja  3 δ2y +q/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build.ninja  ц3 δ2y w -u/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build.ninja.txt  3~ +u/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build.ninja.txt  ц3~ | -z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build_file_index.txt  3 _ ϴ2 +z/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/build_file_index.txt  ц3 _ ϴ2 } -{/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/compile_commands.json  3  +{/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/compile_commands.json  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/compile_commands.json.bin  3 +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/compile_commands.json.bin  ц3   -/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/metadata_generation_command.txt  3  ϴ2| +/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/metadata_generation_command.txt  ц3  ϴ2| z -x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/prefab_config.json  3  ( ϴ2 +x/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/prefab_config.json  ц3  ( ϴ2  -}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/symbol_folder_index.txt  3  t ϴ2 \ No newline at end of file +}/Users/venbateam/Documents/nhance/post_enrollment_app/android/app/.cxx/RelWithDebInfo/h5v1s1u6/x86_64/symbol_folder_index.txt  ц3  t ϴ2 \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index baac1e4..575c12d 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,6 +31,7 @@ import 'package:nhance_app_pwa/pages/verify.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'models/environment.dart'; import 'package:flutter/foundation.dart'; +// import 'dart:html' as html; void clearLocalStorageOnAppStart() async { if (kIsWeb) { @@ -48,6 +49,9 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { Future main() async { // clearLocalStorageOnAppStart(); + // html.window.onBeforeUnload.listen((event) { + // html.window.localStorage.clear(); // ✅ Clears local storage + // }); WidgetsFlutterBinding.ensureInitialized(); // final SharedPreferences prefs = await SharedPreferences.getInstance(); // prefs.clear(); diff --git a/lib/pages/enrollment/addons.dart b/lib/pages/enrollment/addons.dart index b8e4184..b3b0732 100755 --- a/lib/pages/enrollment/addons.dart +++ b/lib/pages/enrollment/addons.dart @@ -156,6 +156,7 @@ class _addOnsDetailsState extends State { []; // Declare this to store all disclaimers late List checkboxValues; bool isTokenAvailable = false; + bool isEnrollCompletedStatus = false; @override void initState() { @@ -1390,35 +1391,42 @@ class _addOnsDetailsState extends State { } void _showSuccessDialog() { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - backgroundColor: Colors.white, - title: Text( - 'Success', - style: GoogleFonts.poppins( - color: Colors.green, - ), - ), - content: Text('Enrollment Completed'), - actions: [ - TextButton( - child: Text( - 'OK', - style: GoogleFonts.poppins( - color: Color(0xFFE26728), - ), - ), - onPressed: () { - Navigator.of(context).pop(); - // Navigator.popAndPushNamed(context, 'home'); - }, - ), - ], - ); - }, - ); + setState(() { + isEnrollCompletedStatus = true; + }); + // showDialog( + // context: context, + // builder: (BuildContext context) { + // return AlertDialog( + // backgroundColor: Colors.white, + // title: Text( + // 'Success', + // style: GoogleFonts.poppins( + // color: Colors.green, + // ), + // ), + // content: Text('Enrollment Completed'), + // actions: [ + // TextButton( + // child: Text( + // 'OK', + // style: GoogleFonts.poppins( + // color: Color(0xFFE26728), + // ), + // ), + // onPressed: () { + // Navigator.of(context).pop(); + // setState(() { + // isEnrollCompletedStatus = true; + // }); + // + // // Navigator.popAndPushNamed(context, 'home'); + // }, + // ), + // ], + // ); + // }, + // ); } void _showErrorDialog() { @@ -1746,7 +1754,107 @@ class _addOnsDetailsState extends State { } } - return Scaffold( + return isEnrollCompletedStatus == true ? Scaffold( + backgroundColor: const Color(0xFFF2F6FA), // Matches your light gray background + appBar: CustomAppBar(), + body: Center( + child: Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.2, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0.03, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(10), + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, // Shrink wrap to content + children: [ + // ✅ Top logos + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.network( + clientLogo ?? '', // Nhance logo + height: 40, + ), + // Image.network( + // 'https://i.imgur.com/qOihOvk.png', // Prodapt logo + // height: 28, + // ), + ], + ), + const SizedBox(height: 32), + + // ✅ Checkmark and message + const Icon(Icons.check_circle, size: 70, color: Color(0xFF1A73E8)), + const SizedBox(height: 24), + const Text( + 'Congratulations!', + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Color(0xFF2D2A4A), + ), + ), + const SizedBox(height: 12), + const Text( + 'You have completed your enrolment. You can now close this tab', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + color: Color(0xFF2D2A4A), + ), + ), + ], + ), + ), + ), + floatingActionButtonLocation: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? FloatingActionButtonLocation.miniEndFloat + : null, + bottomNavigationBar: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? 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: + 0, // Initial index of the bottom navigation bar + ) + : null, + ) : Scaffold( appBar: CustomAppBar(), body: Stack(children: [ SingleChildScrollView( diff --git a/lib/pages/enrollment/empDetails.dart b/lib/pages/enrollment/empDetails.dart index 93ef59a..d8f356c 100755 --- a/lib/pages/enrollment/empDetails.dart +++ b/lib/pages/enrollment/empDetails.dart @@ -599,15 +599,15 @@ class _empDetailsState extends State { ), ); }, - errorBuilder: (BuildContext context, - Object error, StackTrace? stackTrace) { - return Image.asset( - 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - width: 80, - height: 80, - fit: BoxFit.cover, - ); - }, + // errorBuilder: (BuildContext context, + // Object error, StackTrace? stackTrace) { + // return Image.asset( + // 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + // width: 80, + // height: 80, + // fit: BoxFit.cover, + // ); + // }, ), ), ), diff --git a/lib/pages/enrollment/empReview.dart b/lib/pages/enrollment/empReview.dart index b839350..6a76603 100755 --- a/lib/pages/enrollment/empReview.dart +++ b/lib/pages/enrollment/empReview.dart @@ -168,6 +168,7 @@ class _empReviewDetailsState extends State { []; // Declare this to store all disclaimers late List checkboxValues; bool isTokenAvailable = false; + bool isEnrollCompletedStatus = false; @override void initState() { @@ -1077,35 +1078,52 @@ class _empReviewDetailsState extends State { } void _showSuccessDialog() { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - backgroundColor: Colors.white, - title: Text( - 'Success', - style: GoogleFonts.poppins( - color: Colors.green, - ), - ), - content: Text('Enrollment Completed'), - actions: [ - TextButton( - child: Text( - 'OK', - style: GoogleFonts.poppins( - color: Color(0xFFE26728), - ), - ), - onPressed: () { - Navigator.of(context).pop(); - // Navigator.popAndPushNamed(context, 'home'); - }, - ), - ], - ); - }, - ); + setState(() { + isEnrollCompletedStatus = true; + }); + + // Wait 3 seconds, then navigate to home page + Future.delayed(const Duration(seconds: 3), () { + if(isTokenAvailable) { + Navigator.pushNamed(context, 'home'); + } else { + Navigator.pushNamed(context, 'empDetails'); + } + }); + + // showDialog( + // context: context, + // builder: (BuildContext context) { + // return AlertDialog( + // backgroundColor: Colors.white, + // title: Text( + // 'Success', + // style: GoogleFonts.poppins( + // color: Colors.green, + // ), + // ), + // content: Text('Enrollment Completed'), + // actions: [ + // TextButton( + // child: Text( + // 'OK', + // style: GoogleFonts.poppins( + // color: Color(0xFFE26728), + // ), + // ), + // onPressed: () { + // Navigator.of(context).pop(); + // setState(() { + // isEnrollCompletedStatus = true; + // }); + // + // // Navigator.popAndPushNamed(context, 'home'); + // }, + // ), + // ], + // ); + // }, + // ); } void _showErrorDialog() { @@ -1228,7 +1246,135 @@ class _empReviewDetailsState extends State { ), )); } else { - return Scaffold( + return isEnrollCompletedStatus == true ? Scaffold( + backgroundColor: const Color(0xFFF2F6FA), // Matches your light gray background + appBar: CustomAppBar(), + body: Center( + child: Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.2, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0.03, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(10), + color: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, // Shrink wrap to content + children: [ + SizedBox(height: 20), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.network( + clientLogo ?? '', // Nhance logo + height: 40, + ), + // Image.network( + // 'https://i.imgur.com/qOihOvk.png', // Prodapt logo + // height: 28, + // ), + ], + ), + SizedBox(height: 32), + Icon(Icons.check_circle, size: 70, color: Color(0xFF1A73E8)), + SizedBox(height: 24), + Text( + 'Congratulations!', + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + color: Color(0xFF2D2A4A), + ), + ), + SizedBox(height: 12), + Text( + 'You have completed your enrolment. You can now close this tab', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + color: Color(0xFF2D2A4A), + ), + ), + // const SizedBox(height: 12), + Container( + width: 180, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: () => { + if(isTokenAvailable) { + Navigator.pushNamed(context, 'home') + } else { + Navigator.pushNamed(context, 'empDetails') + } + + }, + child: Text( + 'Return to Home', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + ), + ), + ), + ), + // const SizedBox(height: 20), + ], + ), + ), + ), + floatingActionButtonLocation: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? FloatingActionButtonLocation.miniEndFloat + : null, + bottomNavigationBar: Responsive.isDesktop(context) + ? null + : isTokenAvailable + ? 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: + 0, // Initial index of the bottom navigation bar + ) + : null, + ) : Scaffold( + backgroundColor: Colors.white, appBar: CustomAppBar(), body: Stack(children: [ SingleChildScrollView( diff --git a/lib/pages/login.dart b/lib/pages/login.dart index bc5b364..04e60fb 100755 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -1,5 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:http/http.dart' as http; @@ -57,6 +58,12 @@ class _loginState extends State { } // } + } else { + if(kIsWeb) { + final SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.clear(); + print('Local Storage Clear'); + } } } diff --git a/lib/pages/postEnrollment/botman_chat.dart b/lib/pages/postEnrollment/botman_chat.dart new file mode 100644 index 0000000..65aa3f1 --- /dev/null +++ b/lib/pages/postEnrollment/botman_chat.dart @@ -0,0 +1,122 @@ +// import 'package:flutter/material.dart'; +// import 'package:webview_flutter/webview_flutter.dart'; +// +// class BotmanChatPage extends StatefulWidget { +// const BotmanChatPage({super.key}); +// +// @override +// State createState() => _BotmanChatPageState(); +// } +// +// class _BotmanChatPageState extends State { +// late final WebViewController _controller; +// +// @override +// void initState() { +// super.initState(); +// +// _controller = WebViewController() +// ..setJavaScriptMode(JavaScriptMode.unrestricted) +// ..loadHtmlString(_htmlContent); +// } +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar(title: const Text('Ask ILA')), +// body: WebViewWidget(controller: _controller), +// ); +// } +// } +// +// const String _htmlContent = ''' +// +// +// +// +// +// +// +// +// +// +// +// +// '''; + +import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +class ChatbotWebViewPage extends StatefulWidget { + final String client_branch_id; + final String empCodeString; + final String empName; + final String empPrimaryId; + final String client_id; + + const ChatbotWebViewPage({ + Key? key, + required this.client_branch_id, + required this.empCodeString, + required this.empName, + required this.empPrimaryId, + required this.client_id, + }) : super(key: key); + + @override + State createState() => _ChatbotWebViewPageState(); +} + +class _ChatbotWebViewPageState extends State { + late final WebViewController _controller; + + @override + void initState() { + super.initState(); + _controller = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..loadRequest( + Uri.parse('https://venbait.in/nhance/dev/chatbot?employee_id=${widget.empPrimaryId}&emp_code=${widget.empCodeString}&origin=mob&name=${widget.empName}&client_id=${widget.client_id}&client_branch_id=${widget.client_branch_id}'), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Ask ILA')), + body: WebViewWidget(controller: _controller), + ); + } +} diff --git a/lib/pages/postEnrollment/botman_ios_chat.dart b/lib/pages/postEnrollment/botman_ios_chat.dart new file mode 100644 index 0000000..096678d --- /dev/null +++ b/lib/pages/postEnrollment/botman_ios_chat.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; + +class MyWebViewPage extends StatefulWidget { + final String url; + + const MyWebViewPage({Key? key, required this.url}) : super(key: key); + + @override + _MyWebViewPageState createState() => _MyWebViewPageState(); +} + +class _MyWebViewPageState extends State { + InAppWebViewController? webViewController; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text("Web View")), + body: InAppWebView( + initialUrlRequest: URLRequest( + url: WebUri(widget.url), + ), + onWebViewCreated: (controller) { + webViewController = controller; + }, + ), + ); + } +} diff --git a/lib/pages/postEnrollment/home.dart b/lib/pages/postEnrollment/home.dart index 024938c..ab6409d 100755 --- a/lib/pages/postEnrollment/home.dart +++ b/lib/pages/postEnrollment/home.dart @@ -18,6 +18,8 @@ import '../../customAppBar/customFooter.dart'; import '../../customAppBar/responsive.dart'; import '../../customAppBar/tabs.dart'; import '../../customAppBar/toastHelper.dart'; +import 'botman_chat.dart'; +import 'botman_ios_chat.dart'; import 'botman_widget_app.dart'; import 'chatbot.dart'; // import 'dart:js' as js; @@ -40,6 +42,7 @@ class _HomeState extends State { bool isActive = true; dynamic _token; dynamic empCodeString; + dynamic empName; dynamic empPrimaryId; dynamic client_id; dynamic policyList; @@ -177,6 +180,7 @@ class _HomeState extends State { mobileNo = decodedToken['mobile']; client_branch_id = decodedToken['client_branch_id']; empCodeString = prefs.getString('empCode'); + empName = prefs.getString('gpaEmpName'); print(empCodeString); // Check if emp_code is correct empPrimaryId = prefs.getString('empPrimaryId'); client_id = prefs.getString('client_id'); @@ -809,13 +813,35 @@ class _HomeState extends State { ), ), ]), - // floatingActionButton: Responsive.isDesktop(context) - // ? null - // : FloatingActionButton( - // onPressed: () => push(chatbot()), - // // onPressed: openChat, - // child: Icon(Icons.chat), - // ), + floatingActionButton: Responsive.isDesktop(context) + ? null + : FloatingActionButton( + // onPressed: () => push(chatbot()), + onPressed: () => { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => MyWebViewPage( + // url: 'https://venbait.in/nhance/dev/chatbot?employee_id=${empPrimaryId}&emp_code=${empCodeString}&origin=mob&name=${empName}&client_id=${client_id}&client_branch_id=${client_branch_id}', + // ), + // ), + // ) + + Navigator.push( + context, + // MaterialPageRoute(builder: (context) => const BotmanChatPage()), + MaterialPageRoute(builder: (context) => ChatbotWebViewPage( + client_branch_id: client_branch_id, + empCodeString: empCodeString, + empName:empName, + empPrimaryId:empPrimaryId, + client_id:client_id, + ) + ), + ) + }, + child: Icon(Icons.chat), + ), floatingActionButtonLocation: Responsive.isDesktop(context) ? null : FloatingActionButtonLocation.miniEndFloat, diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 35427fa..b723da8 100755 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,6 +9,7 @@ import firebase_app_check import firebase_auth import firebase_core import firebase_messaging +import flutter_inappwebview_macos import google_sign_in_ios import local_auth_darwin import package_info_plus @@ -24,6 +25,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) + InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index c0da322..b442869 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. #version: 1.0.22+22 -version: 1.0.8+9 +version: 1.0.10+11 environment: sdk: '>=3.3.3 <4.0.0' @@ -60,6 +60,7 @@ dependencies: package_info_plus: ^8.3.0 webview_flutter: ^4.13.0 webview_flutter_android: ^4.7.0 + flutter_inappwebview: ^6.1.5 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index b710715..df20d2e 100755 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -16,6 +17,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); + FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi")); LocalAuthPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("LocalAuthPlugin")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index ab79ac5..a9f426e 100755 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,6 +5,7 @@ list(APPEND FLUTTER_PLUGIN_LIST firebase_auth firebase_core + flutter_inappwebview_windows local_auth_windows url_launcher_windows )