From ae1abb3243b34805b87303b03614a1bbb58b2416 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Wed, 11 Mar 2026 12:17:08 +0530 Subject: [PATCH] FIX_BUG_Solved --- .flutter-plugins-dependencies | 2 +- lib/data/utils/toastNotification.dart | 8 +- .../endorsomentUpdateValidation.dart | 235 ++++++- .../policy_claims_endros/endrosment.dart | 6 +- .../screens/dashboard/tabs/live.dart | 574 ++++-------------- .../staff/Enquiry/enquiry_inline_list.dart | 408 +++++++------ web/index.html | 4 +- 7 files changed, 573 insertions(+), 664 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index a23dc3a..f2b995f 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.13/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_macos-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_linux-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_windows-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","dependencies":[],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.3.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_web","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_web-31.1.19/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"device_info_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"pdf_render","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"syncfusion_flutter_pdfviewer","dependencies":["url_launcher","device_info_plus","syncfusion_pdfviewer_web","syncfusion_pdfviewer_macos","syncfusion_pdfviewer_windows","syncfusion_pdfviewer_linux"]},{"name":"syncfusion_pdfviewer_linux","dependencies":[]},{"name":"syncfusion_pdfviewer_macos","dependencies":[]},{"name":"syncfusion_pdfviewer_web","dependencies":[]},{"name":"syncfusion_pdfviewer_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2026-03-09 14:21:45.416716","version":"3.41.4","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.13/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_macos-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_linux-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_windows-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","dependencies":[],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.3.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_web","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_web-31.1.19/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"device_info_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"pdf_render","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"syncfusion_flutter_pdfviewer","dependencies":["url_launcher","device_info_plus","syncfusion_pdfviewer_web","syncfusion_pdfviewer_macos","syncfusion_pdfviewer_windows","syncfusion_pdfviewer_linux"]},{"name":"syncfusion_pdfviewer_linux","dependencies":[]},{"name":"syncfusion_pdfviewer_macos","dependencies":[]},{"name":"syncfusion_pdfviewer_web","dependencies":[]},{"name":"syncfusion_pdfviewer_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2026-03-11 12:15:52.672417","version":"3.41.4","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/data/utils/toastNotification.dart b/lib/data/utils/toastNotification.dart index 55e1278..d8f0faa 100644 --- a/lib/data/utils/toastNotification.dart +++ b/lib/data/utils/toastNotification.dart @@ -40,7 +40,7 @@ class ToastHelper { showProgressBar: true, closeButtonShowType: CloseButtonShowType.onHover, closeOnClick: false, - pauseOnHover: true, + pauseOnHover: false, dragToClose: true, applyBlurEffect: true, callbacks: ToastificationCallbacks( @@ -88,7 +88,7 @@ class ToastHelper { showProgressBar: true, closeButtonShowType: CloseButtonShowType.onHover, closeOnClick: false, - pauseOnHover: true, + pauseOnHover: false, dragToClose: true, applyBlurEffect: true, callbacks: ToastificationCallbacks( @@ -136,7 +136,7 @@ class ToastHelper { showProgressBar: true, closeButtonShowType: CloseButtonShowType.onHover, closeOnClick: false, - pauseOnHover: true, + pauseOnHover: false, dragToClose: true, applyBlurEffect: true, callbacks: ToastificationCallbacks( @@ -185,7 +185,7 @@ class ToastHelper { showProgressBar: true, closeButtonShowType: CloseButtonShowType.onHover, closeOnClick: false, - pauseOnHover: true, + pauseOnHover: false, dragToClose: true, applyBlurEffect: true, callbacks: ToastificationCallbacks( diff --git a/lib/presentation/screens/Enquiry/policy_claims_endros/endorsomentUpdateValidation.dart b/lib/presentation/screens/Enquiry/policy_claims_endros/endorsomentUpdateValidation.dart index 21c1e1c..ddd3cb2 100644 --- a/lib/presentation/screens/Enquiry/policy_claims_endros/endorsomentUpdateValidation.dart +++ b/lib/presentation/screens/Enquiry/policy_claims_endros/endorsomentUpdateValidation.dart @@ -237,6 +237,10 @@ class _endorsomentValidationState extends ConsumerState { bool showExistingFile = false; String? existingFileName; + bool showEndorsementExistingFile = false; + String? existingEndorsementFileName; + PlatformFile? docUploadedEndorsementEndorsFile; + @override void initState() { super.initState(); @@ -248,6 +252,9 @@ class _endorsomentValidationState extends ConsumerState { showExistingFile = existingFileName != null && existingFileName.toString().isNotEmpty; + existingEndorsementFileName = widget.item?['endorsement_completion_file']; + showEndorsementExistingFile = existingEndorsementFileName != null && existingEndorsementFileName.toString().isNotEmpty; + // ✅ INITIALIZE CONTROLLERS MAP controllers = { 'policyNum': TextEditingController(), @@ -664,6 +671,22 @@ class _endorsomentValidationState extends ConsumerState { } } + if (docUploadedEndorsementEndorsFile != null) { + try { + if (docUploadedEndorsementEndorsFile!.bytes != null) { + final multipartFile = http.MultipartFile.fromBytes( + 'endorsement_completion_file', // ✅ Endorsement file field key + docUploadedEndorsementEndorsFile!.bytes!, + filename: docUploadedEndorsementEndorsFile!.name, + ); + request.files.add(multipartFile); + } + print("📎 Endorsement file attached: ${docUploadedEndorsementEndorsFile!.name}"); + } catch (e) { + print("❌ Failed to attach Endorsement file: $e"); + } + } + print(" Sending request with fields: ${request.fields}"); try { @@ -702,6 +725,16 @@ class _endorsomentValidationState extends ConsumerState { } } + String get pdfDocumentTitle { + if (existingEndorsementFileName != null && existingEndorsementFileName!.isNotEmpty) { + return 'Endorsement Document'; + } else if (existingFileName != null && existingFileName!.isNotEmpty) { + return 'Policy Document'; + } else { + return 'Document'; + } + } + // ================= UI ================= @override @@ -781,9 +814,9 @@ class _endorsomentValidationState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - const Text( - 'Original Endorsement Document', - style: TextStyle( + Text( + pdfDocumentTitle, + style: const TextStyle( fontSize: 13, fontWeight: FontWeight.w500, ), @@ -1280,6 +1313,16 @@ class _endorsomentValidationState extends ConsumerState { ], ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: buildEndorsementUploadBox()), + const SizedBox(width: 25), + const Expanded(child: SizedBox()), // ✅ empty spacer + ], + ), + + Divider( color: Color(0xFFe5e7eb), thickness: 1, @@ -1721,7 +1764,7 @@ class _endorsomentValidationState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: const [ Text( - "Upload Document", + "Upload Policy Document", style: TextStyle( fontSize: 12, fontWeight: FontWeight.w500, @@ -1749,30 +1792,45 @@ class _endorsomentValidationState extends ConsumerState { child: Row( children: [ const Icon(Icons.insert_drive_file, color: Color(0xFF0F766E)), - const SizedBox(width: 12), - Expanded( child: Text( existingFileName!, overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w400, - ), + style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w400), ), ), + /// ⬇️ DOWNLOAD BUTTON + Tooltip( + message: "Download", + child: GestureDetector( + onTap: () { + final id = widget.item?['id']; + apiService.downloadFile( + apiUrl: 'endorsement/downloadEndorsementCompletionFile?id=$id', + apiId: id, + localFile: null, + fileName: existingFileName!, + ); + }, + child: const Icon(Icons.download, color: Color(0xFF0F766E)), + ), + ), + const SizedBox(width: 8), /// ❌ REMOVE BUTTON - GestureDetector( - onTap: () { - setState(() { - showExistingFile = false; - existingFileName = null; - docUploadedEndorsFile = null; - }); - }, - child: const Icon(Icons.close, color: Colors.red), + Tooltip( + message: "Remove", + child: GestureDetector( + onTap: () { + setState(() { + showExistingFile = false; + existingFileName = null; + docUploadedEndorsFile = null; + }); + }, + child: const Icon(Icons.close, color: Colors.red), + ), ), ], ), @@ -1845,6 +1903,145 @@ class _endorsomentValidationState extends ConsumerState { ); } + Widget buildEndorsementUploadBox() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + /// Label Row + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: const [ + Text( + "Upload Endorsement Document", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w500, + color: Color(0xFF374151), + ), + ), + Text("PDF",style: TextStyle(fontSize: 10, color: Color(0xFF6B7280)),), + ], + ), + const SizedBox(height: 10), + + /// 🔹 IF Endorsement EXISTING FILE (EDIT MODE) + if (showEndorsementExistingFile && existingEndorsementFileName != null) + Container( + height: 70, + padding: const EdgeInsets.symmetric(horizontal: 14), + decoration: BoxDecoration( + color: const Color(0xFFF8FAFC), + borderRadius: BorderRadius.circular(14), + border: Border.all(color: const Color(0xFF0F766E), width: 1.5), + ), + child: Row( + children: [ + const Icon(Icons.insert_drive_file, color: Color(0xFF0F766E)), + const SizedBox(width: 12), + Expanded( + child: Text( + existingEndorsementFileName!, + overflow: TextOverflow.ellipsis, + style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w400), + ), + ), + + /// ⬇️ DOWNLOAD BUTTON + Tooltip( + message: "Download", + child: GestureDetector( + onTap: () { + final id = widget.item?['id']; + apiService.downloadFile( + apiUrl: 'endorsement/downloadEndorsementCompletionFile?id=$id&type=completion', + apiId: id, + localFile: null, + fileName: existingEndorsementFileName!, + ); + }, + child: const Icon(Icons.download, color: Color(0xFF0F766E)), + ),), + const SizedBox(width: 8), + /// ❌ REMOVE Endorsement BUTTON + Tooltip( + message: "Remove", + child: GestureDetector( + onTap: () { + setState(() { + showEndorsementExistingFile = false; + existingEndorsementFileName = null; + docUploadedEndorsementEndorsFile = null; + }); + }, + child: const Icon(Icons.close, color: Colors.red), + ),), + ], + ), + ) + /// 🔹 ELSE SHOW Endorsement UPLOAD BOX + else + GestureDetector( + onTap: () async { + FilePickerResult? result = await FilePicker.platform.pickFiles( + type: FileType.custom, + allowedExtensions: ['pdf'], + ); + + if (result != null) { + setState(() { + docUploadedEndorsementEndorsFile = result.files.first; + }); + } + }, + child: Container( + height: 160, + decoration: BoxDecoration( + color: const Color(0xFFF8FAFC), + borderRadius: BorderRadius.circular(14), + border: Border.all(color: const Color(0xFF0F766E), width: 1.5), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + Icons.attach_file, + size: 34, + color: Color(0xFF9CA3AF), + ), + const SizedBox(height: 12), + Text( + docUploadedEndorsementEndorsFile != null + ? docUploadedEndorsementEndorsFile!.name + : "Click to upload or drag & drop", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w400, + color: Color(0xFF374151), + ), + ), + const SizedBox(height: 6), + const Text( + "Endorsement document, endorsement copy", + style: TextStyle(fontSize: 11, color: Color(0xFF6B7280)), + ), + const SizedBox(height: 10), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + buildFileChip("PDF"), + const SizedBox(width: 8), + buildFileChip("Max 5MB"), + ], + ), + ], + ), + ), + ), + ], + ); + } + // Widget buildUploadBox() { // return Column( // crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart b/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart index c0ebeca..ff4e28c 100644 --- a/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart +++ b/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart @@ -2210,7 +2210,7 @@ class endosementState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Text('Upload Endorsement PDF', style: _dataBold), + Text('Upload Revised Endorsement Document (PDF)', style: _dataBold), const SizedBox(height: 10), _buildEndorsementUploadField(item), ], @@ -2233,12 +2233,12 @@ class endosementState extends ConsumerState { mainAxisSize: MainAxisSize.min, children: [ // ── UPLOAD LABEL ────────────────────────────── - Text('Upload', style: GoogleFonts.poppins(fontSize: 11, fontWeight: FontWeight.w500)), + Text('Upload Revised Document', style: GoogleFonts.poppins(fontSize: 11, fontWeight: FontWeight.w500)), const SizedBox(height: 6), // ── UPLOAD FIELD ────────────────────────────── ThemedUploadField( - hintText: selectedFileNames ?? "Upload Document", + hintText: selectedFileNames ?? "Upload Revised Document", padHorizontal: 4, padVertical: 5, fontSZ: 11, diff --git a/lib/presentation/screens/dashboard/tabs/live.dart b/lib/presentation/screens/dashboard/tabs/live.dart index eff7c77..a1dcbb2 100644 --- a/lib/presentation/screens/dashboard/tabs/live.dart +++ b/lib/presentation/screens/dashboard/tabs/live.dart @@ -1212,7 +1212,6 @@ class othersPendings extends StatelessWidget { final List> data; final VoidCallback? onRefresh; VoidCallback? onExportExcel; - // final Future Function(String status, String staffId)? onCallExport; othersPendings({ Key? key, @@ -1222,50 +1221,31 @@ class othersPendings extends StatelessWidget { required this.stringFlag, required this.onRefresh, this.onExportExcel, - // this.onCallExport, }) : super(key: key); @override Widget build(BuildContext context) { - print(' Data: $data'); - - // Compute totals + // ── Compute totals ────────────────────────────────────── int totalTodayAssigned = 0; int totalPending = 0; int totalInProgress = 0; int totalCompleted = 0; int totalPrevPending = 0; - int totalPendingAll = 0; for (var row in data) { totalTodayAssigned += int.tryParse(row['today_assigned'] ?? '0') ?? 0; - totalPending += int.tryParse(row['today_pending'] ?? '0') ?? 0; - totalInProgress += int.tryParse(row['today_in_progress'] ?? '0') ?? 0; - totalCompleted += int.tryParse(row['today_completed'] ?? '0') ?? 0; - totalPrevPending += int.tryParse(row['total_completed'] ?? '0') ?? 0; - - int totalPendingdata = - int.tryParse(row['total_pending']?.toString() ?? '0') ?? 0; - int todayAssigned = - int.tryParse(row['today_assigned']?.toString() ?? '0') ?? 0; - - // totalTodayAssigned += todayAssigned; - totalPendingAll += totalPendingdata; - - int staffPending = totalPendingdata - todayAssigned; - - // totalPrevPending += staffPending; + totalPending += int.tryParse(row['today_pending'] ?? '0') ?? 0; + totalInProgress += int.tryParse(row['today_in_progress'] ?? '0') ?? 0; + totalCompleted += int.tryParse(row['today_completed'] ?? '0') ?? 0; final rowPrevPending = (int.tryParse(row['total_pending'] ?? '0') ?? 0) - - (int.tryParse(row['today_assigned'] ?? '0') ?? 0); - + (int.tryParse(row['today_assigned'] ?? '0') ?? 0); totalPrevPending += rowPrevPending < 0 ? 0 : rowPrevPending; } return Card( color: Colors.white, - // color: const Color(0xFFEAF6F4), elevation: 1, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), child: Padding( @@ -1273,470 +1253,115 @@ class othersPendings extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Title + + // ── Title Row ─────────────────────────────────── Row( - mainAxisAlignment: MainAxisAlignment.start, children: [ Text(title, style: _chartHeader), - Spacer(), + const Spacer(), InkWell( - onTap: () { - onRefresh!(); - }, - child: Icon(Icons.refresh, size: 18), + onTap: () => onRefresh?.call(), + child: const Icon(Icons.refresh, size: 18), ), const SizedBox(width: 12), - InkWell( - onTap: () => onExportExcel?.call(), - child: Tooltip( - message: 'Export Excel', - child: Container( - padding: const EdgeInsets.all(5.0), - decoration: BoxDecoration( - color: const Color(0xFF2E7D6E), - borderRadius: BorderRadius.circular(2.0), - ), - child: Image.asset( - "assets/miscellaneous/export.png", - height: 11, - width: 11, - ), + InkWell( + onTap: () => onExportExcel?.call(), + child: Tooltip( + message: 'Export Excel', + child: Container( + padding: const EdgeInsets.all(5.0), + decoration: BoxDecoration( + color: const Color(0xFF2E7D6E), + borderRadius: BorderRadius.circular(2.0), + ), + child: Image.asset( + "assets/miscellaneous/export.png", + height: 11, + width: 11, ), ), ), + ), ], ), const SizedBox(height: 10), - // Header row + // ── Header Row ────────────────────────────────── Container( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12), decoration: BoxDecoration( - color: Color(0xFFE3F9F8), - // color: const Color(0xFF3E5B56), + color: const Color(0xFFE3F9F8), borderRadius: BorderRadius.circular(10), ), child: Row( children: [ - // Expanded( - // flex: 1, - // child: Text( - // "S.No", - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), - // if (role == 'manager') ...[ - // Expanded( - // flex: 2, - // child: Text( - // "Handler Name", - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), - // ], - Expanded( - flex: 2, - child: Text( - "Staff Name", - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - - // Expanded( - // flex: 2, - // child: Text( - // // stringFlag + " Issued", - // 'Total Assigned', - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), - // Expanded( - // flex: 2, - // child: Text( - // 'To be assigned', - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), - // Expanded( - // flex: 2, - // child: Text( - // 'Total Assigned', - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), - Expanded( - flex: 2, - child: Text( - 'Today Assigned', - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - - Expanded( - flex: 2, - child: Text( - 'Pending', - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - 'In Progress', - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - 'Completed', - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - 'Prev Pending', - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - // Expanded( - // flex: 2, - // child: Text( - // // stringFlag + " Issued", - // 'Policy Created', - // textAlign: TextAlign.center, - // style: _headerStyle, - // ), - // ), + Expanded(flex: 2, child: Text("Staff Name", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text("Today Assigned", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text("Pending", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text("In Progress", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text("Completed", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text("Prev Pending", textAlign: TextAlign.center, style: _headerStyle)), ], ), ), - const SizedBox(height: 8), + const SizedBox(height: 6), - // List of rows + // ── Data Rows ─────────────────────────────────── Flexible( child: ListView.builder( itemCount: data.length, itemBuilder: (context, index) { final row = data[index]; - final totalPending = - int.tryParse(row['total_pending']?.toString() ?? '0') ?? - 0; - final todayAssigned = - int.tryParse(row['today_assigned']?.toString() ?? '0') ?? - 0; + final totalPendingVal = + int.tryParse(row['total_pending']?.toString() ?? '0') ?? 0; + final todayAssignedVal = + int.tryParse(row['today_assigned']?.toString() ?? '0') ?? 0; + final safePending = + (totalPendingVal - todayAssignedVal).clamp(0, 99999); - final staffPending = (totalPending - todayAssigned); - final safePending = staffPending < 0 ? 0 : staffPending; - - // final staffPending = totalPending - todayAssigned; - - final issuedCount = stringFlag == "Policies" - ? (row['total_policis_pending'] ?? 0).toString() - : (row['total_quotation_pending'] ?? 0).toString(); - - final permiumValue = row['total_premium_value'] == null - ? '0' - : row['total_premium_value']; - - return Container( - margin: const EdgeInsets.symmetric(vertical: 3), - padding: const EdgeInsets.symmetric( - vertical: 4, - horizontal: 12, - ), - decoration: BoxDecoration( - color: Colors.white, - border: Border( - bottom: BorderSide( - color: Colors.blueGrey.shade100, - width: 0.3, - ), - ), - // borderRadius: BorderRadius.circular(10), + return _HoverableRow( + onTap: () => handleDashboardNavigation( + context, + status: '', + staffId: row['staff_id'] ?? '', + role: role, ), child: Row( children: [ - Expanded( - flex: 2, - child: Text( - row['staff_name'] ?? "", - textAlign: TextAlign.left, - // textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - - Expanded( - flex: 2, - child: Material( - color: Colors.white, - child: Center( - child: InkWell( - hoverColor: Color(0xFFEAF6F4), - onTap: () async { - print( - 'total_assigned_today : ${row['total_assigned']}', - ); - - handleDashboardNavigation( - context, - status: '', - // status: "Assigned", - staffId: row['staff_id'] ?? '', - role: role, - ); - // if (onCallExport != null) { - // await onCallExport!( - // "TodayAssigned", - // row['staff_id'].toString(), - // ); - // } - }, - child: Text( - row['today_assigned'] ?? "", - // row['total_approval_pending'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - ), - ), - ), - Expanded( - flex: 2, - child: Material( - color: Colors.white, - child: Center( - child: InkWell( - hoverColor: Color(0xFFEAF6F4), - onTap: () async { - print( - 'total_assigned : ${row['total_assigned']}', - ); - - handleDashboardNavigation( - context, - status: "Assigned", - staffId: row['staff_id'] ?? '', - role: role, - ); - // if (onCallExport != null) { - // await onCallExport!( - // "Assigned", - // row['staff_id'].toString(), - // ); - // } - }, - child: Text( - row['today_pending'] ?? "", - // row['total_approval_pending'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - ), - ), - ), - Expanded( - flex: 2, - child: Material( - color: Colors.white, - child: Center( - child: InkWell( - // hoverColor: Color(0xFFEAF6F4), - onTap: () async { - print( - 'Awaiting Proposal : ${row['total_in_progress']}', - ); - - handleDashboardNavigation( - context, - status: "In progress", - staffId: row['staff_id'] ?? '', - role: role, - ); - // if (onCallExport != null) { - // await onCallExport!( - // 'InProgress', - // row['staff_id'].toString(), - // ); - // } - - }, - - child: Text( - row['today_in_progress'] ?? "", - // row['total_approval_pending'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - ), - ), - ), - Expanded( - flex: 2, - child: Material( - color: Colors.white, - child: Center( - child: InkWell( - hoverColor: Color(0xFFEAF6F4), - onTap: () async { - print( - 'Awaiting Approval : ${row['total_completed']} - ${row['staff_id']}', - ); - handleDashboardNavigation( - context, - status: "Completed", - staffId: row['staff_id'] ?? '', - role: role, - ); - // if (onCallExport != null) { - // await onCallExport!( - // 'Completed', - // row['staff_id'].toString(), - // ); - // } - }, - child: Text( - row['today_completed'] ?? "", - // row['total_approval_pending'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - ), - ), - ), - Expanded( - flex: 2, - child: Material( - color: Colors.white, - child: Center( - child: InkWell( - hoverColor: Color(0xFFEAF6F4), - onTap: () async { - print( - 'Awaiting Approval : ${row['total_completed']} - ${row['staff_id']}', - ); - handleDashboardNavigation( - context, - status: 'PrevPending', - staffId: row['staff_id'] ?? '', - role: role, - ); - // 2. Call the Export function - // We use await here so the 'isLoading' state is respected - // and errors are caught properly. - // if (onCallExport != null) { - // await onCallExport!( - // 'PrevPending', - // row['staff_id'].toString(), - // ); - // } - }, - child: Text( - safePending.toString() ?? "", - // row['total_approval_pending'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, - ), - ), - ), - ), - ), - - // Expanded( - // flex: 2, - // child: Text( - // row['policy_created'] ?? "", - // // row['total_approval_pending'] ?? "", - // textAlign: TextAlign.center, - // style: _tableDataStyle, - // ), - // ), + _dataCell(row['staff_name'] ?? '', flex: 2), + _dataCell(row['today_assigned'] ?? '', flex: 2), + _dataCell(row['today_pending'] ?? '', flex: 2), + _dataCell(row['today_in_progress'] ?? '', flex: 2), + _dataCell(row['today_completed'] ?? '', flex: 2), + _dataCell(safePending.toString(), flex: 2), ], ), ); }, ), ), - const SizedBox(height: 8), - // Header row + const SizedBox(height: 6), + + // ── Footer Total Row ──────────────────────────── Container( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12), decoration: BoxDecoration( - color: Color(0xFFF1F5F9), - // color: Color(0xFFE3F9F8), + color: const Color(0xFFF1F5F9), borderRadius: BorderRadius.circular(10), ), child: Row( children: [ - Expanded( - flex: 2, - child: Text( - "Total", - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - totalTodayAssigned.toString(), - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - totalPending.toString(), - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - totalInProgress.toString(), - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - totalCompleted.toString(), - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), - Expanded( - flex: 2, - child: Text( - totalPrevPending.toString(), - textAlign: TextAlign.center, - style: _headerStyle, - ), - ), + Expanded(flex: 2, child: Text("Total", textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text(totalTodayAssigned.toString(), textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text(totalPending.toString(), textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text(totalInProgress.toString(), textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text(totalCompleted.toString(), textAlign: TextAlign.center, style: _headerStyle)), + Expanded(flex: 2, child: Text(totalPrevPending.toString(), textAlign: TextAlign.center, style: _headerStyle)), ], ), ), + ], ), ), @@ -2383,3 +2008,74 @@ final _chartHeader = GoogleFonts.poppins( color: Colors.black, fontWeight: FontWeight.w500, ); + +// ─── Helper Widgets ────────────────────────────────────────────────────────── + +Widget _dataCell(String text, {int flex = 2}) { + return Expanded( + flex: flex, + child: Text( + text, + textAlign: TextAlign.center, + style: GoogleFonts.inter( + fontSize: 11, + fontWeight: FontWeight.w500, + color: const Color(0xFF2C3E3D), + ), + ), + ); +} +// ─── Hoverable Row Widget ─────────────────────────────────────────────────── + +class _HoverableRow extends StatefulWidget { + final Widget child; + final VoidCallback onTap; + + const _HoverableRow({ + required this.child, + required this.onTap, + }); + + @override + State<_HoverableRow> createState() => _HoverableRowState(); +} + +class _HoverableRowState extends State<_HoverableRow> { + bool _isHovered = false; + + @override + Widget build(BuildContext context) { + return MouseRegion( + onEnter: (_) => setState(() => _isHovered = true), + onExit: (_) => setState(() => _isHovered = false), + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: widget.onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 180), + curve: Curves.easeInOut, + margin: const EdgeInsets.symmetric(vertical: 2, horizontal: 4), + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), + decoration: BoxDecoration( + color: _isHovered ? const Color(0xFFD4F3EF) : Colors.white, + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: _isHovered ? const Color(0xFF4ABFB5) : Colors.transparent, + width: 1.2, + ), + boxShadow: _isHovered + ? [ + BoxShadow( + color: const Color(0xFF4ABFB5).withOpacity(0.18), + blurRadius: 8, + offset: const Offset(0, 3), + ), + ] + : [], + ), + child: widget.child, + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart index e9aa5d3..3119e49 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart @@ -298,23 +298,53 @@ class EnquiryStaffState extends ConsumerState { print('dashboardStatus - $dashboardStatus'); print('dashboardStaffId - $dashboardStaffId'); - if (managerId != null && - dashboardKey != null && - dashboardStatus != null && - dashboardStaffId != null) { - print("DASHBOARD STATus-$dashboardStatus -- $dashboardStaffId -"); - SelectedStatus = dashboardStatus; - SelectedStaffId = dashboardStaffId; - getStaffList( - managerId, - roleId, - SelectedStatus: dashboardStatus, - SelectedStaffId: dashboardStaffId, - ); - } else { - print('ELSE'); - getStaffList(managerId, roleId); - } + // if (managerId != null && + // dashboardKey != null && + // dashboardStatus != null && + // dashboardStaffId != null) { + // print("DASHBOARD STATus-$dashboardStatus -- $dashboardStaffId -"); + // SelectedStatus = dashboardStatus; + // SelectedStaffId = dashboardStaffId; + // getStaffList( + // managerId, + // roleId, + // SelectedStatus: dashboardStatus, + // SelectedStaffId: dashboardStaffId, + // ); + // } else { + // print('ELSE'); + // getStaffList(managerId, roleId); + // } + + // AFTER — clear dashboardKey from prefs immediately after reading it: +if (managerId != null && + dashboardKey != null && + dashboardStatus != null && + dashboardStaffId != null) { + print("DASHBOARD STATus-$dashboardStatus -- $dashboardStaffId -"); + SelectedStatus = dashboardStatus; + SelectedStaffId = dashboardStaffId; + + // ✅ FIX: Clear dashboard keys from SharedPreferences RIGHT NOW + // so that auto-refresh (30s timer) never re-applies dashboard dates + await prefs.remove('dashboardKeyProvider'); + await prefs.remove('dashboardStatusProvider'); + await prefs.remove('dashboardStaffIdProvider'); + + getStaffList( + managerId, + roleId, + SelectedStatus: dashboardStatus, + SelectedStaffId: dashboardStaffId, + ); + + // ✅ FIX: After first load, clear dashboardKey in memory too + // so getStaffList's date logic uses normal path on next call + dashboardKey = null; +} else { + print('ELSE'); + getStaffList(managerId, roleId); +} ref.listen(enquiryRefreshProvider, (prev, next) { print('quickQuotationKey1'); @@ -519,24 +549,27 @@ class EnquiryStaffState extends ConsumerState { Future autoRefrshfilterDateRange() async { print('autorefrshfilterDateRange'); - // setState(() async { final prefs = await SharedPreferences.getInstance(); - // _formKey.currentState?.reset(); + // ✅ FIX: Always clear dashboard keys before auto-refresh + // This is a safety net — ensures stale dashboardKey never leaks into timer calls + if (dashboardKey == 'fromDashboard') { + dashboardKey = null; + _dashboardInitHandled = false; + await prefs.remove('dashboardKeyProvider'); + await prefs.remove('dashboardStatusProvider'); + await prefs.remove('dashboardStaffIdProvider'); + } final int parsedManagerId = int.tryParse(managerId.toString()) ?? 0; - print('autorefrshfilterDateRange 1'); getStaffList( - // managerId, parsedManagerId, roleId, SelectedStatus: SelectedStatus ?? '', SelectedStaffId: SelectedStaffId ?? '', ); autoRefreshIndex = selectedIndex; - print('autoRefreshIndex - $autoRefreshIndex'); _searchStaffController.clear(); - print('refrshfilterDateRange 2'); } Future refrshfilterDateRange() async { @@ -674,196 +707,179 @@ class EnquiryStaffState extends ConsumerState { } Future getStaffList(int managerId, - role, { - String fromDate = '', - String toDate = '', - String SelectedStatus = '', - String SelectedStaffId = '', - }) async { - print('A613 => Fns called => $managerId | $role'); + role, { + String fromDate = '', + String toDate = '', + String SelectedStatus = '', + String SelectedStaffId = '', + }) async { + print('A613 => Fns called => $managerId | $role'); + setState(() { + isLoadingStaffList = true; + }); + print('A713 => Fns called => $managerId | $role'); + + dynamic fromDt; + dynamic toDt; + + final fromDateVal = controllers['startDate']?.text ?? ''; + final toDateVal = controllers['endDate']?.text ?? ''; + final dateFormat = DateFormat('dd-MM-yyyy'); + + if (dashboardKey == 'fromDashboard' && SelectedStatus == "PrevPending") { setState(() { - isLoadingStaffList = true; + _dashboardInitHandled = true; }); - print('A713 => Fns called => $managerId | $role'); + final today = DateTime.now(); + final DateTime yesterday = today.subtract(const Duration(days: 1)); + final DateTime fromDate = DateTime(2025, 10, 1); + controllers['startDate']?.text = dateFormat.format(fromDate); + controllers['endDate']?.text = dateFormat.format(yesterday); + print('UnA813 => Fns called => $managerId | $role'); - dynamic fromDt; - dynamic toDt; + fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; + toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; - final fromDateVal = controllers['startDate']?.text ?? ''; - final toDateVal = controllers['endDate']?.text ?? ''; + print('PrevPending FROM TO - $fromDt - $toDt'); + } else if (dashboardKey == 'fromDashboard' && + SelectedStatus != "PrevPending" && + SelectedStatus != '') { + final today = DateTime.now(); + print('A913 => Fns called => $managerId | $role'); final dateFormat = DateFormat('dd-MM-yyyy'); - if (dashboardKey == 'fromDashboard' && SelectedStatus == "PrevPending") { - setState(() { - _dashboardInitHandled = true; - }); - final today = DateTime.now(); - final DateTime yesterday = today.subtract(const Duration(days: 1)); - final DateTime fromDate = DateTime(2025, 10, 1); // hardcoded Date - controllers['startDate']?.text = dateFormat.format(fromDate); - controllers['endDate']?.text = dateFormat.format(yesterday); - print('UnA813 => Fns called => $managerId | $role'); + fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; + toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; + print('End Date: ${controllers['endDate']?.text}'); + print('STT Date: ${controllers['startDate']?.text}'); - // For PREV PENDING → set date range until yesterday - // Change to dd-MM-yyyy - // final dateFormat = DateFormat('dd-MM-yyyy'); - // final yesterday = today.subtract(Duration(days: 1)); + print('PrevPending FROM TO - $fromDt - $toDt'); + } else if (dashboardKey != 'fromDashboard' && + fromDateVal == '' && + toDateVal == '') { + print("ENQ LIST PAGE"); + print('A1013 => Fns called => $managerId | $role'); - fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; - toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; - // fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15))); - // toDt = dateFormat.format(yesterday); + final today = DateTime.now(); + fromDt = dateFormat.format(today.subtract(Duration(days: 4))); + toDt = dateFormat.format(today); - print('PrevPending FROM TO - $fromDt - $toDt'); - } else if (dashboardKey == 'fromDashboard' && - SelectedStatus != "PrevPending" && - SelectedStatus != '') { - // For PREV PENDING → set date range until yesterday - final today = DateTime.now(); - print('A913 => Fns called => $managerId | $role'); - // Change to dd-MM-yyyy + print('Enq FROM TO - $fromDt - $toDt'); + } else { + print('A1113 => Fns called => $managerId | $role'); + print('Pre Date its User Choosen Enq Inline list - $fromDt - $toDt'); + + if (_resetKeyEnable) { + print('A12131 => Fns called => $managerId | $role'); final dateFormat = DateFormat('dd-MM-yyyy'); - - // fromDt = dateFormat.format(today); - // toDt = dateFormat.format(today); - - fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; - toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; - print('End Date: ${controllers['endDate']?.text}'); - print('STT Date: ${controllers['startDate']?.text}'); - - print('PrevPending FROM TO - $fromDt - $toDt'); - } else if (dashboardKey != 'fromDashboard' && - fromDateVal == '' && - toDateVal == '') { - print("ENQ LIST PAGE"); - print('A1013 => Fns called => $managerId | $role'); - final today = DateTime.now(); - fromDt = dateFormat.format(today.subtract(Duration(days: 4))); - // fromDt = dateFormat.format(today); + fromDt = dateFormat.format(today.subtract(const Duration(days: 4))); toDt = dateFormat.format(today); - print('Enq FROM TO - $fromDt - $toDt'); - } else { - print('A1113 => Fns called => $managerId | $role'); - print('Pre Date its User Choosen Enq Inline list - $fromDt - $toDt'); - - if (_resetKeyEnable) { - print('A12131 => Fns called => $managerId | $role'); - final dateFormat = DateFormat('dd-MM-yyyy'); - final today = DateTime.now(); - // final yesterday = today.subtract(Duration(days: 1)); - // fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15))); // Dont Delete any doubt Ref Suren - fromDt = dateFormat.format(today.subtract(const Duration(days: 4))); - toDt = dateFormat.format(today); - - setState(() { - controllers['startDate']?.text = fromDt; - controllers['endDate']?.text = toDt; - _resetKeyEnable = false; // ask suren Never forgot - }); - } else { - print('A13131 => Fns called => $managerId | $role'); - fromDt = fromDateVal; - toDt = toDateVal; - } - } - print('Enq 2- $fromDt - $toDt'); - String finalStatus = SelectedStatus; - print('finalStatus1 - $finalStatus'); - - print('A1213 => Fns called => $managerId | $role'); - - try { - final response = await apiService.fetchEnquiryList( - managerId, - userId, - role, - fromDate: _dashboardInitHandled - ? controllers['startDate']?.text - : fromDt, - toDate: _dashboardInitHandled ? controllers['endDate']?.text : toDt, - // selectedStatus: (finalStatus != '' && finalStatus != 'PrevPending') - // ? finalStatus - // : '', - selectedStatus: - (SelectedStatus != '' && SelectedStatus != 'PrevPending') - ? SelectedStatus - : '', - selectedStaffId: SelectedStaffId ?? '', - ); - - if (response['status'] == 'success') { - final data = response['data']; - final fromDate = response['from_date'] ?? ''; - final toDate = response['to_date'] ?? ''; - - print('FromDate : $fromDate'); - print('ToDate : $toDate'); - print('A1213 => Fns called => $managerId | $role'); - - setState(() { - _resetKeyEnable = false; - - controllers['startDate']?.text = fromDate; - controllers['endDate']?.text = toDate; - - - if (data is List) { - getStaffData = List>.from(data); - - originalData = List>.from(data); - - // Split data immediately after fetching - inProgressData = originalData - .where((item) => item['enquiry_status'] != 'Completed') - .toList(); - - print('inProgressData - $inProgressData'); - - completedData = originalData - .where((item) => item['enquiry_status'] == 'Completed') - .toList(); - print('completedData - $completedData'); - - // filteredData now holds the currently displayed tab's data (without search) - // filteredData = (selectedIndex == 0) - // ? inProgressData - // : completedData; - - // 👇 IMPORTANT: Set filteredData based on current tab - filteredData = (selectedIndex == 0) - ? List.from(inProgressData) - : List.from(completedData); - - if (SelectedStatus == 'Completed') { - selectedIndex = 1; - } - - print('filteredData count: ${filteredData.length}'); - print('inProgressData count: ${inProgressData.length}'); - print('completedData count: ${completedData.length}'); - } else if (data is Map) { - getStaffData = [Map.from(data)]; - } else { - getStaffData = []; - } - originalData = getStaffData; - filteredData = List.from(originalData); - }); - } else { - getStaffData = []; - originalData = []; - } - } catch (e) { - print('Exception occurred: $e'); - } finally { setState(() { - isLoadingStaffList = false; + controllers['startDate']?.text = fromDt; + controllers['endDate']?.text = toDt; + _resetKeyEnable = false; }); + } else { + print('A13131 => Fns called => $managerId | $role'); + fromDt = fromDateVal; + toDt = toDateVal; } } + print('Enq 2- $fromDt - $toDt'); + String finalStatus = SelectedStatus; + print('finalStatus1 - $finalStatus'); + + print('A1213 => Fns called => $managerId | $role'); + + try { + final response = await apiService.fetchEnquiryList( + managerId, + userId, + role, + fromDate: _dashboardInitHandled + ? controllers['startDate']?.text + : fromDt, + toDate: _dashboardInitHandled ? controllers['endDate']?.text : toDt, + selectedStatus: + (SelectedStatus != '' && SelectedStatus != 'PrevPending') + ? SelectedStatus + : '', + selectedStaffId: SelectedStaffId ?? '', + ); + + if (response['status'] == 'success') { + final data = response['data']; + final fromDate = response['from_date'] ?? ''; + final toDate = response['to_date'] ?? ''; + + print('FromDate : $fromDate'); + print('ToDate : $toDate'); + print('A1213 => Fns called => $managerId | $role'); + + setState(() { + _resetKeyEnable = false; + + controllers['startDate']?.text = fromDate; + controllers['endDate']?.text = toDate; + + if (data is List) { + getStaffData = List>.from(data); + originalData = List>.from(data); + + inProgressData = originalData + .where((item) => item['enquiry_status'] != 'Completed') + .toList(); + + print('inProgressData - $inProgressData'); + + completedData = originalData + .where((item) => item['enquiry_status'] == 'Completed') + .toList(); + print('completedData - $completedData'); + + filteredData = (selectedIndex == 0) + ? List.from(inProgressData) + : List.from(completedData); + + if (SelectedStatus == 'Completed') { + selectedIndex = 1; + } + + print('filteredData count: ${filteredData.length}'); + print('inProgressData count: ${inProgressData.length}'); + print('completedData count: ${completedData.length}'); + } else if (data is Map) { + getStaffData = [Map.from(data)]; + } else { + getStaffData = []; + } + originalData = getStaffData; + filteredData = List.from(originalData); + }); + + // ✅ FIX CHANGE 2: Clear dashboardKey AFTER first successful load + // so all subsequent auto-refresh timer calls (every 30s) use + // normal date logic instead of re-applying dashboard dates + if (dashboardKey == 'fromDashboard') { + dashboardKey = null; + _dashboardInitHandled = false; + print('✅ dashboardKey cleared after first successful load'); + } + + } else { + getStaffData = []; + originalData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoadingStaffList = false; + }); + } +} String safeString(dynamic value) { if (value == null) return ''; diff --git a/web/index.html b/web/index.html index 725e5f9..7a13bbf 100644 --- a/web/index.html +++ b/web/index.html @@ -15,8 +15,8 @@ the `--base-href` argument provided to `flutter build`. --> - - + +