From dc87e4b81852da722e711fa9e365a015c829cf25 Mon Sep 17 00:00:00 2001 From: venbaittech Date: Thu, 9 Oct 2025 17:23:52 +0530 Subject: [PATCH] UI_DASHBOARD_Insurer --- .flutter-plugins-dependencies | 2 +- lib/core/services/api_service.dart | 2 +- .../screens/Enquiry/enquiry/enquiry_tab.dart | 19 +- .../screens/dashboard/dashboard.dart | 776 ++++++++++++++---- .../screens/staff/Enquiry/enquiry_list.dart | 2 +- .../screens/staff/policy/policy.dart | 88 +- .../quotations/createQuotationPopUp.dart | 135 +++ .../screens/staff/quotations/quotation.dart | 143 ++-- 8 files changed, 932 insertions(+), 235 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index d923b52..084c5cc 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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","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":"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":"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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.30/","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":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.0.5/","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.18/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.12/","native_build":true,"dependencies":[],"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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.1.0/","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":"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":"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","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":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","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":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","dependencies":[],"dev_dependency":false},{"name":"firebase_app_check_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check_web-0.2.0+16/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.0.2/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.1.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.0.1/","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":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.0.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":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","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":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_app_check","dependencies":["firebase_app_check_web","firebase_core"]},{"name":"firebase_app_check_web","dependencies":["firebase_core","firebase_core_web"]},{"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":"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":"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":"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":"2025-09-30 16:16:12.329115","version":"3.32.1","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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","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":"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":"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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.30/","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":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.0.5/","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.18/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.12/","native_build":true,"dependencies":[],"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","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.1.0/","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":"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":"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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","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":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","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":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","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":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","dependencies":[],"dev_dependency":false},{"name":"firebase_app_check_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check_web-0.2.0+16/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.0.2/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.1.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.0.1/","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":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.0.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":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","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":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_app_check","dependencies":["firebase_app_check_web","firebase_core"]},{"name":"firebase_app_check_web","dependencies":["firebase_core","firebase_core_web"]},{"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":"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":"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":"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":"2025-10-09 10:21:48.029573","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index 295bd62..8df807c 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -555,7 +555,7 @@ class ApiService { } Future> findEnqQuotePolicyView(id) async { - // print(_token); + print('findEnqQuotePolicyView - $id'); if (_token == null) { await _initializeToken(); } diff --git a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart index 2727411..fe6817d 100644 --- a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart +++ b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart @@ -99,7 +99,7 @@ class EnquiryTabState extends ConsumerState { "email": controllers["email"]?.text, "reg_no": controllers["regNo"]?.text, "vehicle_type_id": selectedVehicleType, - "insurer_id": selectedInsurer, + // "insurer_id": selectedInsurer, // "rc_file_name": "rc_doc.pdf", // "id_proof_file_name": "id_proof.pdf", // "previous_policy_file_name": "previous_policy.pdf", @@ -596,21 +596,24 @@ class EnquiryTabState extends ConsumerState { _buildResponsiveRow( context, buildVehicleType(context), - buildInsurer(context), - ), - isMobile ? SizedBox(height: 5) : SizedBox(height: 20), - - _buildResponsiveRow( - context, + // buildInsurer(context), buildUploadRCDocument(context), + ), + isMobile ? SizedBox(height: 5) : SizedBox(height: 20), + + _buildResponsiveRow( + context, + // buildUploadRCDocument(context), buildUploadIDDocument(context), + buildUploadPolicyDocument(context), ), isMobile ? SizedBox(height: 5) : SizedBox(height: 20), _buildResponsiveRow( context, - buildUploadPolicyDocument(context), + // buildUploadPolicyDocument(context), buildRemarks(context), + SizedBox.shrink(), ), ], ), diff --git a/lib/presentation/screens/dashboard/dashboard.dart b/lib/presentation/screens/dashboard/dashboard.dart index b9641ad..04134c4 100644 --- a/lib/presentation/screens/dashboard/dashboard.dart +++ b/lib/presentation/screens/dashboard/dashboard.dart @@ -11,10 +11,10 @@ import '../../providers/userRoleProvider.dart'; final enquiriesProvider = Provider>>((ref) { return List.generate(5, (i) { return { - "reg": "TN64V4387", - "company": "New India", - "date": "09/09/2025", - "time": "11:30 AM", + "reg": "rrTN64V4387", + "company": "rrNew India", + "date": "rr09/09/2025", + "time": "rr11:30 AM", }; }); }); @@ -54,14 +54,19 @@ class _DashboardScreenState extends ConsumerState { String? earningsMonth; String? earningsYear; String? quotationsPendingCounts; // cross verify + String? currentKey; // cross verify // List> dataVal = []; List> getStaffData = []; List> originalData = []; List> filteredData = []; + int selectedTabIndex = 0; + List> currentList = []; List> quotationsPendingList = []; // cross verify List> policiesPendingList = []; // cross verify + List> awaitingApprovalList = []; // cross verify + List> unAssignedEnqList = []; // cross verify List> agentsPerformanceList = []; // cross verify List> nonAgentsPerformanceList = []; // cross verify @@ -98,15 +103,53 @@ class _DashboardScreenState extends ConsumerState { final data = response['data']; print('B99 => getStaffListData => ${response['data']}'); setState(() { - policiesIssuedToday = data['policies_issued']['today'].toString(); - policiesIssuedYear = data['policies_issued']['year'].toString(); - policiesIssuedMonth = data['policies_issued']['month'].toString(); - premiumValueToday = data['premium_value']['today'].toString(); - premiumValueYear = data['premium_value']['year'].toString(); - premiumValueMonth = data['premium_value']['month'].toString(); - earningsToday = data['earnings']['today'].toString(); - earningsYear = data['earnings']['year'].toString(); - earningsMonth = data['earnings']['month'].toString(); + // policiesIssuedToday = data['policies_issued']['today'].toString(); + // policiesIssuedYear = data['policies_issued']['year'].toString(); + // policiesIssuedMonth = data['policies_issued']['month'].toString(); + // premiumValueToday = data['premium_value']['today'].toString(); + // premiumValueYear = data['premium_value']['year'].toString(); + // premiumValueMonth = data['premium_value']['month'].toString(); + // earningsToday = data['earnings']['today'].toString(); + // earningsYear = data['earnings']['year'].toString(); + // earningsMonth = data['earnings']['month'].toString(); + + // Policies Issued + if (data['policies_issued'] != null) { + policiesIssuedToday = + data['policies_issued']['today']?.toString() ?? "0"; + policiesIssuedYear = + data['policies_issued']['year']?.toString() ?? "0"; + policiesIssuedMonth = + data['policies_issued']['month']?.toString() ?? "0"; + } else { + policiesIssuedToday = "0"; + policiesIssuedYear = "0"; + policiesIssuedMonth = "0"; + } + + // Premium Value + if (data['premium_value'] != null) { + premiumValueToday = + data['premium_value']['today']?.toString() ?? "0"; + premiumValueYear = data['premium_value']['year']?.toString() ?? "0"; + premiumValueMonth = + data['premium_value']['month']?.toString() ?? "0"; + } else { + premiumValueToday = "0"; + premiumValueYear = "0"; + premiumValueMonth = "0"; + } + + // Earnings + if (data['earnings'] != null) { + earningsToday = data['earnings']['today']?.toString() ?? "0"; + earningsYear = data['earnings']['year']?.toString() ?? "0"; + earningsMonth = data['earnings']['month']?.toString() ?? "0"; + } else { + earningsToday = "0"; + earningsYear = "0"; + earningsMonth = "0"; + } // agents_performance if (data['agents_performance'] != null) { @@ -115,6 +158,7 @@ class _DashboardScreenState extends ConsumerState { (item) => Map.from(item), ), ); + agentsPerformanceList.sort((a, b) { int aValue = a['total_policis_pending'] ?? 0; int bValue = b['total_policis_pending'] ?? 0; @@ -138,6 +182,21 @@ class _DashboardScreenState extends ConsumerState { }); } + if (data['quotations_pending'] != null) { + quotationsPendingList = List>.from( + (data['quotations_pending'] as List).map( + (item) => Map.from(item), + ), + ); + } + + if (data['quotations_approval_pending'] != null) { + awaitingApprovalList = List>.from( + (data['quotations_approval_pending'] as List).map( + (item) => Map.from(item), + ), + ); + } if (data['policies_pending'] != null) { policiesPendingList = List>.from( (data['policies_pending'] as List).map( @@ -146,9 +205,9 @@ class _DashboardScreenState extends ConsumerState { ); } - if (data['quotations_pending'] != null) { - quotationsPendingList = List>.from( - (data['quotations_pending'] as List).map( + if (data['unassigned_enquiry'] != null) { + unAssignedEnqList = List>.from( + (data['unassigned_enquiry'] as List).map( (item) => Map.from(item), ), ); @@ -177,7 +236,9 @@ class _DashboardScreenState extends ConsumerState { return MainLayout( title: "Home", body: ResponsiveBuilder.isMobile(context) - ? Expanded( + ? Container( + // color: Colors.redAccent, + // height: MediaQuery.of(context).size.height, // ✅ take available space child: SingleChildScrollView( scrollDirection: Axis.vertical, @@ -238,16 +299,27 @@ class _DashboardScreenState extends ConsumerState { borderRadius: BorderRadius.circular(25), ), padding: const EdgeInsets.all(6), - child: Row( - children: [ - Expanded( - child: buildTab("Enquiries Pending", 0), - ), - const SizedBox(width: 10), - Expanded( - child: buildTab("Quotation Pending", 1), - ), - ], + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: buildTab("Awaiting Quotation", 0), + ), + const SizedBox(width: 10), + Padding( + padding: const EdgeInsets.all(8.0), + child: buildTab("Awaiting Approval", 1), + ), + + const SizedBox(width: 10), + Padding( + padding: const EdgeInsets.all(8.0), + child: buildTab("Awaiting Policy", 2), + ), + ], + ), ), ), @@ -255,12 +327,29 @@ class _DashboardScreenState extends ConsumerState { // 🔹 Scrollable list ListView.builder( - itemCount: enquiries.length, + itemCount: currentList.length, shrinkWrap: true, - physics: - const NeverScrollableScrollPhysics(), // disable inner scroll + physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, index) { - final item = enquiries[index]; + final item = currentList[index]; + + // Split date & time from created_on + String date = ""; + String time = ""; + if ((item['created_on'] ?? "").isNotEmpty) { + final parts = item['created_on'].split(' '); + date = parts[0]; + if (parts.isNotEmpty) { + DateTime parsedDate = DateTime.parse( + parts[0], + ); + date = DateFormat( + 'dd/MM/yyyy', + ).format(parsedDate); // 19/09/2025 + } + time = parts.length > 1 ? parts[1] : ""; + } + return Card( elevation: 2, margin: const EdgeInsets.symmetric(vertical: 8), @@ -270,30 +359,33 @@ class _DashboardScreenState extends ConsumerState { color: Colors.white, child: ListTile( title: Text( - item["reg"]!, + item["reg_no"] ?? "-", // from API style: GoogleFonts.inter( fontWeight: FontWeight.bold, fontSize: 12, ), ), - subtitle: Text( - item["company"]!, - style: GoogleFonts.inter( - fontSize: 12, - fontWeight: FontWeight.bold, - ), - ), + + subtitle: (currentKey == 'policies') + ? Text( + item["insurer_name"] ?? "-", + style: GoogleFonts.inter( + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ) + : SizedBox.shrink(), trailing: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - item["date"]!, - style: GoogleFonts.inter(fontSize: 12), - ), - Text( - item["time"]!, + '$date ${time}', style: GoogleFonts.inter(fontSize: 12), ), + // Text( + // (time ?? "").toString().split(" ").last, + // style: GoogleFonts.inter(fontSize: 12), + // ), ], ), ), @@ -348,50 +440,37 @@ class _DashboardScreenState extends ConsumerState { ), ], ), - if (role == 'manager') - SizedBox( - // ✅ replace Expanded - height: 350, // adjust height as needed - child: Row( - children: [ - Expanded( - child: Performance( - title: "Top Agent Performance", - data: agentsPerformanceList, - ), - ), - SizedBox(width: 16), - Expanded( - child: Performance( - title: "Bottom Non-Performing Agents", - data: nonAgentsPerformanceList, - ), - ), - ], - ), - ), + const SizedBox(height: 10), SizedBox( // ✅ replace Expanded height: (role == 'agent') ? MediaQuery.of(context).size.height * 0.69 //400 + : (role == 'manager') + ? MediaQuery.of(context).size.height * 0.5 : MediaQuery.of(context).size.height * - 0.5, // 350 adjust height as needed + 0.85, // 350 adjust height as needed child: Row( children: [ Expanded( child: (role == 'agent') ? agentPendings( title: - "Enquiries Pending (${policiesPendingList.length})", - data: policiesPendingList, + "Awaiting Quotation (${quotationsPendingList.length})", + data: quotationsPendingList, ) - : othersPendings( + : (role == 'manager') + ? othersPendings( title: - "Quotations Pending (${quotationsPendingList.length})", + "Awaiting Quotation (${quotationsPendingList.length})", data: quotationsPendingList, stringFlag: "Quotation", + ) + : agentPendings( + title: + "Awaiting Quotation (${quotationsPendingList.length})", + data: quotationsPendingList, ), ), const SizedBox(width: 16), @@ -399,12 +478,41 @@ class _DashboardScreenState extends ConsumerState { child: (role == 'agent') ? agentPendings( title: - "Quotations Pending (${quotationsPendingList.length})", - data: quotationsPendingList, + "Awaiting Approval (${awaitingApprovalList.length})", + data: awaitingApprovalList, ) - : othersPendings( + : (role == 'manager') + ? awaitingApproval( title: - "Policies Pending (${policiesPendingList.length})", + "Awaiting Approval (${awaitingApprovalList.length})", + data: awaitingApprovalList, + stringFlag: "Quotation", + ) + : agentPendings( + title: + "Awaiting Approval (${awaitingApprovalList.length})", + data: awaitingApprovalList, + ), + ), + const SizedBox(width: 16), + Expanded( + child: (role == 'agent') + ? agentPendings( + title: + "Awaiting Policy (${policiesPendingList.length})", + data: policiesPendingList, + stringFlag: "Policies", + ) + : (role == 'manager') + ? othersPendings( + title: + "Awaiting Policy (${policiesPendingList.length})", + data: policiesPendingList, + stringFlag: "Policies", + ) + : agentPendings( + title: + "Awaiting Policy (${policiesPendingList.length})", data: policiesPendingList, stringFlag: "Policies", ), @@ -412,6 +520,36 @@ class _DashboardScreenState extends ConsumerState { ], ), ), + const SizedBox(height: 10), + if (role == 'manager') + SizedBox( + // ✅ replace Expanded + height: 350, // adjust height as needed + child: Row( + children: [ + Expanded( + child: UnassignedEnq( + title: "Unassigned Enquires", + data: unAssignedEnqList, + ), + ), + SizedBox(width: 16), + Expanded( + child: Performance( + title: "Performing Agents", + data: agentsPerformanceList, + ), + ), + SizedBox(width: 16), + Expanded( + child: Performance( + title: "Non-Performing Agents", + data: nonAgentsPerformanceList, + ), + ), + ], + ), + ), ], ), ), @@ -465,14 +603,14 @@ class _DashboardScreenState extends ConsumerState { // children: [ // Expanded( // child: Performance( - // title: "Top Agent Performance", + // title: "Performing Agents", // data: agentsPerformanceList, // ), // ), // SizedBox(width: 16), // Expanded( // child: Performance( - // title: "Bottom Non-Performing Agents", + // title: "Non-Performing Agents", // data: nonAgentsPerformanceList, // ), // ), @@ -528,38 +666,78 @@ class _DashboardScreenState extends ConsumerState { ); } + // Widget buildTab(String title, int index) { + // final isSelected = selectedIndex == index + 1; + // return GestureDetector( + // onTap: () { + // print('buildTab - $index'); + // + // setState(() { + // selectedIndex = index + 1; + // print('buildTab1 - $selectedIndex'); + // if (selectedIndex == 2) { + // switcherStatus = 0; + // } else { + // switcherStatus = 1; + // } + // }); + // }, + // child: SizedBox( + // child: Container( + // padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10), + // decoration: BoxDecoration( + // color: isSelected ? const Color(0xFFFFFFFF) : Colors.transparent, + // borderRadius: BorderRadius.circular(16), + // ), + // child: Center( + // child: Text( + // title, + // style: GoogleFonts.poppins( + // fontSize: 12, + // + // color: isSelected ? Colors.black : Colors.white, + // fontWeight: FontWeight.w500, + // ), + // maxLines: 2, + // softWrap: true, + // ), + // ), + // ), + // ), + // ); + // } + Widget buildTab(String title, int index) { - final isSelected = selectedIndex == index + 1; + final isSelected = selectedTabIndex == index; + if (selectedTabIndex == 0) { + currentList = quotationsPendingList; + currentKey = 'pending'; + } else if (selectedTabIndex == 1) { + currentList = awaitingApprovalList; + currentKey = 'approval'; + } else if (selectedTabIndex == 2) { + currentList = policiesPendingList; + currentKey = 'policies'; + } + return GestureDetector( onTap: () { setState(() { - selectedIndex = index + 1; - if (selectedIndex == 2) { - switcherStatus = 0; - } else { - switcherStatus = 1; - } + selectedTabIndex = index; }); }, - child: SizedBox( - child: Container( - padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10), - decoration: BoxDecoration( - color: isSelected ? const Color(0xFFFFFFFF) : Colors.transparent, - borderRadius: BorderRadius.circular(16), - ), - child: Center( - child: Text( - title, - style: GoogleFonts.poppins( - fontSize: 12, - - color: isSelected ? Colors.black : Colors.white, - fontWeight: FontWeight.w500, - ), - maxLines: 2, - softWrap: true, - ), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: isSelected ? Colors.white : Colors.transparent, + borderRadius: BorderRadius.circular(20), + ), + child: Text( + title, + style: GoogleFonts.inter( + fontSize: 14, + fontWeight: FontWeight.bold, + color: isSelected ? const Color(0xFF425B5B) : Colors.white, ), ), ), @@ -682,9 +860,14 @@ class StatCard extends StatelessWidget { class agentPendings extends StatelessWidget { final String title; + final String? stringFlag; final List> data; - const agentPendings({Key? key, required this.title, required this.data}) - : super(key: key); + const agentPendings({ + Key? key, + required this.title, + required this.data, + this.stringFlag, + }) : super(key: key); @override Widget build(BuildContext context) { @@ -865,6 +1048,15 @@ class agentPendings extends StatelessWidget { child: Row( children: [ Expanded( + flex: 1, + child: Text( + "S.No", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + Expanded( + flex: 1, child: Text( "Date & Time", textAlign: TextAlign.center, @@ -872,19 +1064,23 @@ class agentPendings extends StatelessWidget { ), ), Expanded( + flex: 2, child: Text( "Registration number", textAlign: TextAlign.center, style: _headerStyle, ), ), - Expanded( - child: Text( - "Insurer Company", - textAlign: TextAlign.center, - style: _headerStyle, + if (stringFlag == "Policies") ...[ + Expanded( + flex: 2, + child: Text( + "Insurer Company", + textAlign: TextAlign.center, + style: _headerStyle, + ), ), - ), + ], ], ), ), @@ -924,8 +1120,17 @@ class agentPendings extends StatelessWidget { ), child: Row( children: [ + Expanded( + flex: 1, + child: Text( + (index + 1).toString(), + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), // Date & Time Expanded( + flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -937,21 +1142,24 @@ class agentPendings extends StatelessWidget { // Registration number Expanded( + flex: 2, child: Text( row['reg_no'] ?? "", textAlign: TextAlign.center, style: _tableDataStyle, ), ), - - // Insurer company - Expanded( - child: Text( - row['insurer_name'] ?? "", - textAlign: TextAlign.center, - style: _tableDataStyle, + if (stringFlag == "Policies") ...[ + // Insurer company + Expanded( + flex: 2, + child: Text( + row['insurer_short_name'] ?? "", + textAlign: TextAlign.center, + style: _tableDataStyle, + ), ), - ), + ], ], ), ); @@ -1022,21 +1230,22 @@ class othersPendings extends StatelessWidget { Expanded( flex: 2, child: Text( - stringFlag + " Issued", + // stringFlag + " Issued", + 'Pending Count', textAlign: TextAlign.center, style: _headerStyle, ), ), - (stringFlag == "Policies") - ? Expanded( - flex: 2, - child: Text( - "Total Premium Value", - textAlign: TextAlign.center, - style: _headerStyle, - ), - ) - : const SizedBox.shrink(), + // (stringFlag == "Policies") + // ? Expanded( + // flex: 2, + // child: Text( + // "Total Premium Value", + // textAlign: TextAlign.center, + // style: _headerStyle, + // ), + // ) + // : const SizedBox.shrink(), ], ), ), @@ -1081,6 +1290,7 @@ class othersPendings extends StatelessWidget { flex: 2, child: Text( row['staff_name'] ?? "", + textAlign: TextAlign.center, style: _tableDataStyle, ), @@ -1090,23 +1300,182 @@ class othersPendings extends StatelessWidget { flex: 2, child: Text( issuedCount, + // row['total_approval_pending'] ?? "", textAlign: TextAlign.center, style: _tableDataStyle, ), ), - stringFlag == "Policies" - ? Expanded( - flex: 2, - child: Text( - formatToCroresLakhsAndThousands(permiumValue), - textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 14, - fontWeight: FontWeight.w500, - ), - ), - ) - : const SizedBox.shrink(), + // stringFlag == "Policies" + // ? Expanded( + // flex: 2, + // child: Text( + // formatToCroresLakhsAndThousands(permiumValue), + // textAlign: TextAlign.center, + // style: GoogleFonts.inter( + // fontSize: 14, + // fontWeight: FontWeight.w500, + // ), + // ), + // ) + // : const SizedBox.shrink(), + ], + ), + ); + }, + ), + ), + ], + ), + ), + ); + } +} + +class awaitingApproval extends StatelessWidget { + final String title; + final String stringFlag; + final List> data; + + awaitingApproval({ + Key? key, + required this.title, + required this.data, + required this.stringFlag, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + print(' Data: $data'); + + return Card( + color: const Color(0xFFEAF6F4), + elevation: 0, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Title + Text(title, style: _title), + const SizedBox(height: 10), + + // Header row + Container( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), + decoration: BoxDecoration( + color: const Color(0xFF3E5B56), + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: Text( + "S.No", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + Expanded( + flex: 2, + child: Text( + "Staff Name", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + Expanded( + flex: 2, + child: Text( + // stringFlag + " Issued", + 'Pending Count', + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + // (stringFlag == "Policies") + // ? Expanded( + // flex: 2, + // child: Text( + // "Total Premium Value", + // textAlign: TextAlign.center, + // style: _headerStyle, + // ), + // ) + // : const SizedBox.shrink(), + ], + ), + ), + const SizedBox(height: 8), + + // List of rows + Flexible( + child: ListView.builder( + itemCount: data.length, + itemBuilder: (context, index) { + final row = data[index]; + + 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: 5), + padding: const EdgeInsets.symmetric( + vertical: 5, + horizontal: 12, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: Text( + (index + 1).toString(), + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + Expanded( + flex: 2, + child: Text( + row['staff_name'] ?? "", + + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + + Expanded( + flex: 2, + child: Text( + // issuedCount, + (row['total_approval_pending'] ?? 0).toString(), + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + // stringFlag == "Policies" + // ? Expanded( + // flex: 2, + // child: Text( + // formatToCroresLakhsAndThousands(permiumValue), + // textAlign: TextAlign.center, + // style: GoogleFonts.inter( + // fontSize: 14, + // fontWeight: FontWeight.w500, + // ), + // ), + // ) + // : const SizedBox.shrink(), ], ), ); @@ -1174,9 +1543,7 @@ class Performance extends StatelessWidget { ), Expanded( child: Text( - title == "Top Agent Performance" - ? "Premium Value" - : "Status", + title == "Performing Agents" ? "Premium Value" : "Status", textAlign: TextAlign.center, style: _headerStyle, ), @@ -1232,7 +1599,7 @@ class Performance extends StatelessWidget { Expanded( child: Text( - title == "Top Agent Performance" + title == "Performing Agents" ? formatToCroresLakhsAndThousands( row['total_premium_value'] ?? 0, ) @@ -1241,7 +1608,7 @@ class Performance extends StatelessWidget { style: GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w500, - color: title == "Top Agent Performance" + color: title == "Performing Agents" ? Colors.black : (row['status']?.toString().toLowerCase() == "active" @@ -1263,6 +1630,119 @@ class Performance extends StatelessWidget { } } +class UnassignedEnq extends StatelessWidget { + final String title; + final List> data; + + UnassignedEnq({Key? key, required this.title, required this.data}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Card( + color: const Color(0xFFEAF6F4), + elevation: 0, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Title + Text(title, style: _title), + const SizedBox(height: 10), + + // Header row + Container( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), + decoration: BoxDecoration( + color: const Color(0xFF3E5B56), + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Expanded( + child: Text( + "S.No", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + Expanded( + child: Text( + "Registration number", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + Expanded( + child: Text( + "Date", + textAlign: TextAlign.center, + style: _headerStyle, + ), + ), + ], + ), + ), + const SizedBox(height: 8), + + // List of rows + Flexible( + child: ListView.builder( + itemCount: data.length, + itemBuilder: (context, index) { + final row = data[index]; + + return Container( + // height: 5200, + margin: const EdgeInsets.symmetric(vertical: 5), + padding: const EdgeInsets.symmetric( + vertical: 5, + horizontal: 12, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Expanded( + child: Text( + (index + 1).toString(), // convert int to string + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + + Expanded( + child: Text( + row['reg_no'] ?? "", + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + + Expanded( + child: Text( + row['created_on'] ?? "", + textAlign: TextAlign.center, + style: _tableDataStyle, + ), + ), + ], + ), + ); + }, + ), + ), + ], + ), + ), + ); + } +} + final _headerStyle = GoogleFonts.inter( fontWeight: FontWeight.w600, fontSize: 14, diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_list.dart b/lib/presentation/screens/staff/Enquiry/enquiry_list.dart index 8103052..64f5190 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_list.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_list.dart @@ -287,7 +287,7 @@ class EnquiryStaffState extends ConsumerState { regNum, ) { return [ - if (roleId == 'manager' && data['status'] != 'Quotation Created') ...[ + if (roleId == 'manager' && data['status'] == 'Awaiting Quotation') ...[ Material( color: Colors.transparent, child: InkWell( diff --git a/lib/presentation/screens/staff/policy/policy.dart b/lib/presentation/screens/staff/policy/policy.dart index b5e6a33..903979e 100644 --- a/lib/presentation/screens/staff/policy/policy.dart +++ b/lib/presentation/screens/staff/policy/policy.dart @@ -250,7 +250,7 @@ class PolicyScreenState extends ConsumerState { selectedEnquiryId = enquiryData['id']; print('selectedEnquiryId- $selectedEnquiryId'); controllers["regNum"]?.text = enquiryData['reg_no']; - controllers["insurer"]?.text = enquiryData['insurer_name']; + // controllers["insurer"]?.text = enquiryData['insurer_name']; }); } @@ -266,6 +266,7 @@ class PolicyScreenState extends ConsumerState { if (quotationAcceptedData != null) { if (!mounted) return; setState(() { + controllers["insurer"]?.text = quotationAcceptedData?['insurer_name']; acceptedQuotationId = quotationAcceptedData?['id']?.toString() ?? ''; controllers["idv"]?.text = quotationAcceptedData?['insured_declared_value']?.toString() ?? @@ -757,7 +758,7 @@ class PolicyScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -798,7 +799,7 @@ class PolicyScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -835,7 +836,7 @@ class PolicyScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -875,7 +876,7 @@ class PolicyScreenState extends ConsumerState { final path = 'api/quotation/downloadAdditionalUploadedFile?id=$acceptedQuotationId'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -1200,6 +1201,19 @@ class PolicyScreenState extends ConsumerState { controllers['startDate']?.text = DateFormat( 'dd-MM-yyyy', ).format(date); + + // auto set end date (1 year later - 1 day if needed) + final endDate = DateTime( + date.year + 1, + date.month, + date.day, + ).subtract(const Duration(days: 1)); // optional: subtract 1 day + + controllers['endDate']?.text = DateFormat( + 'dd-MM-yyyy', + ).format(endDate); + + print("Auto-set End Date: $endDate"); // controllers['date']?.text = date as String; }, ), @@ -1220,13 +1234,75 @@ class PolicyScreenState extends ConsumerState { : MediaQuery.of(context).size.width * 0.26, txtheight: 50, // backgroundColor: const Color(0xFFECECEC), - validator: (value) => Validators.requiredField(value, "date"), + // validator: (value) => Validators.requiredField(value, "date"), + validator: (value) { + if (value == null || value.isEmpty) { + return "Required"; + } + + final startDateControllerText = controllers['startDate']?.text; + if (startDateControllerText == null || + startDateControllerText.isEmpty) { + return "Select start date first"; + } + + final startDate = DateFormat( + 'dd-MM-yyyy', + ).parse(startDateControllerText); + final endDate = DateFormat('dd-MM-yyyy').parse(value); + + if (endDate.isBefore(startDate)) { + return "End date cannot be before start date"; + } + + // Minimum end date = start date + 1 year - 1 day (or just +1 year) + final minEndDate = DateTime( + startDate.year + 1, + startDate.month, + startDate.day, + ); + + if (endDate.isBefore(minEndDate)) { + return "End date must be at least 1 year from start date"; + } + + return null; + + // final startDateControllerText = controllers['startDate']?.text; + // if (startDateControllerText == null || + // startDateControllerText.isEmpty) { + // return "Select start date first"; + // } + // + // final startDate = DateFormat( + // 'dd-MM-yyyy', + // ).parse(startDateControllerText); + // final endDate = DateFormat('dd-MM-yyyy').parse(value); + // + // if (endDate.isBefore(startDate)) { + // return "End date cannot be before start date"; + // } + // + // final expectedEndDate = DateTime( + // startDate.year + 1, + // startDate.month, + // startDate.day, + // ).subtract(const Duration(days: 1)); + // + // if (endDate != expectedEndDate) { + // return "End date must be exactly 1 year from start date"; + // } + // + // return null; // valid + }, controller: controllers['endDate']!, onDateSelected: (date) { print("Picked Date: $date"); + controllers['endDate']?.text = DateFormat( 'dd-MM-yyyy', ).format(date); + _formKey.currentState?.validate(); // controllers['date']?.text = date as String; }, ), diff --git a/lib/presentation/screens/staff/quotations/createQuotationPopUp.dart b/lib/presentation/screens/staff/quotations/createQuotationPopUp.dart index f011ff2..85c7b94 100644 --- a/lib/presentation/screens/staff/quotations/createQuotationPopUp.dart +++ b/lib/presentation/screens/staff/quotations/createQuotationPopUp.dart @@ -46,6 +46,10 @@ class createQuotatDialogState extends State { String? selectedFileNames; + List> getInsurersData = []; + List> filteredInsurersData = []; + String? selectedInsurer; + bool isLoading = false; late TextEditingController controller; Map controllers = {}; @@ -59,6 +63,9 @@ class createQuotatDialogState extends State { final GlobalKey>> dropDownKey = GlobalKey>>(); + final GlobalKey>> + dropDownKeyInsurer = GlobalKey>>(); + List tabHeader = ['idv', 'premium_Amount']; List> getInsuranceTypeData = []; @@ -71,6 +78,7 @@ class createQuotatDialogState extends State { final data = { "enquiry_id": widget.selectedEnquiryId, "insured_declared_value": controllers["idv"]?.text, + "insurer_id": selectedInsurer, "premium_amount": controllers["premium_Amount"]?.text, "insurance_plan_type_id": selectedInsPlanType, // "additional_uploaded_file_name": "extra_doc.pdf", @@ -91,6 +99,7 @@ class createQuotatDialogState extends State { // 🔹 Init logic here (API calls, token fetch, etc.) _initializeToken(); getInsuranceType(); + getInsurers(); updateData(); } @@ -126,6 +135,9 @@ class createQuotatDialogState extends State { .selectedQuotationFrmListdata!['insurance_plan_type_id'] ?.toString(); + selectedInsurer = + widget.selectedQuotationFrmListdata!['insurer_id']?.toString() ?? ''; + String? apiDocPath = widget.selectedQuotationFrmListdata!["additional_uploaded_file_name"]; if (apiDocPath != null && apiDocPath.isNotEmpty) { @@ -143,6 +155,37 @@ class createQuotatDialogState extends State { } } + Future getInsurers() async { + print('Insurers called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.fetchMasterDropDown('Insurers'); + + if (response['status'] == 200) { + print('getInsurers - ${response['data']}'); + setState(() { + getInsurersData = List>.from(response['data']); + print('API Data - $getInsurersData'); + + filteredInsurersData = List.from(getInsurersData); + print('originalData - $filteredInsurersData'); + }); + } else { + getInsurersData = []; + filteredInsurersData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + Future getInsuranceType() async { print('getClaimList called'); setState(() { @@ -380,6 +423,7 @@ class createQuotatDialogState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ buildIdv(context), + buildInsurer(context), buildInsurancePlanType(context), buildPremiumAmnt(context), buildDocuments(context), @@ -417,6 +461,97 @@ class createQuotatDialogState extends State { ); } + Widget buildInsurer(BuildContext context) { + Map? selectedInsurerd = filteredInsurersData.firstWhere( + (item) => item['id'].toString() == selectedInsurer, + orElse: () => {}, + ); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Insurer *', style: _textStyle), + SizedBox(height: 10), + Container( + decoration: BoxDecoration( + // color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + width: ResponsiveLayout.isMobile(context) + ? null + : MediaQuery.of(context).size.width * 0.26, + // height: 40, + child: DropdownSearch>( + key: dropDownKeyInsurer, + selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null, + items: (filter, infiniteScrollProps) { + return filteredInsurersData; + }, + + itemAsString: (val) => val['name'].toString(), // what to show + compareFn: (item, selectedItem) => + item['id'] == selectedItem['id'], // ✅ compare by id + validator: (val) { + if (val == null) { + return "Required"; // ✅ error message + } + return null; + }, + decoratorProps: DropDownDecoratorProps( + decoration: + AppInputDecorations.dropdownDecoration( + label: "Select Insurer", + ).copyWith( + filled: true, + fillColor: Color( + 0xFFEDF6F5, + ), // 👈 makes the dropdown input white + ), + ), + + popupProps: PopupProps.menu( + fit: FlexFit.loose, + constraints: BoxConstraints(maxHeight: 250), + menuProps: MenuProps( + backgroundColor: + Colors.white, // 👈 sets dropdown background to white + ), + showSearchBox: true, + searchFieldProps: TextFieldProps( + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Search Insurer...", + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.white, + ), // 👈 Normal border + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.white, + width: 1.5, + ), // 👈 Focused border + ), + ), + ), + // constraints: BoxConstraints(), + ), + + onChanged: (val) { + if (val != null) { + print("Selected Insurer : ${val['name']}"); + print("Id: ${val['id']}"); + selectedInsurer = val['id']; + // controllers['agentId']?.text = val['agent_code']; + // agentId = agent['id']; + } + }, + ), + ), + ], + ); + } + Widget buildPremiumAmnt(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/screens/staff/quotations/quotation.dart b/lib/presentation/screens/staff/quotations/quotation.dart index ad07c74..cf063f4 100644 --- a/lib/presentation/screens/staff/quotations/quotation.dart +++ b/lib/presentation/screens/staff/quotations/quotation.dart @@ -159,7 +159,7 @@ class QuotationScreenState extends ConsumerState { selectedEnquiryId = enquiryData['id']; print('selectedEnquiryId- $selectedEnquiryId'); controllers["regNum"]?.text = enquiryData['reg_no']; - controllers["insurer"]?.text = enquiryData['insurer_name']; + // controllers["insurer"]?.text = enquiryData['insurer_name']; }); } @@ -194,7 +194,9 @@ class QuotationScreenState extends ConsumerState { originalData = getQuotationData; filteredData = List.from(originalData); - blockKey = getQuotationData.any((item) => item['status'] == 'Accepted'); + blockKey = getQuotationData.any( + (item) => item['status'] == 'Accepted', + ); print('blockKey- $blockKey'); // print('originalData - $getClaimPolicies'); }); @@ -332,8 +334,8 @@ class QuotationScreenState extends ConsumerState { ), SizedBox(height: 15), registerNumber(context), - SizedBox(height: 16), - insurer(context), + // SizedBox(height: 16), + // insurer(context), SizedBox(height: 16), buildDocRC(context, isMobile), @@ -369,13 +371,13 @@ class QuotationScreenState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.end, children: [ registerNumber(context), - Spacer(), - insurer(context), - Spacer(), + SizedBox(width: 10), + // insurer(context), + // Spacer(), buildDocRC(context, isMobile), - Spacer(), + SizedBox(width: 10), buildDocIdProof(context, isMobile), - Spacer(), + SizedBox(width: 10), buildDocPrevPolicy(context, isMobile), ], ), @@ -385,72 +387,73 @@ class QuotationScreenState extends ConsumerState { ], const SizedBox(height: 20), - if(!blockKey)...[ - Container( - padding: EdgeInsets.only(right: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - GestureDetector( - onTap: () { - // print('Export'); - setState(() { - selectedQuotationFrmListId = null; - selectedQuotationFrmListData = null; - }); + if (!blockKey) ...[ + Container( + padding: EdgeInsets.only(right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + GestureDetector( + onTap: () { + // print('Export'); + setState(() { + selectedQuotationFrmListId = null; + selectedQuotationFrmListData = null; + }); - showDialog( - context: context, - builder: (ctx) => createQuotatDialog( - userId: userId, - selectedQuotationFrmListdata: - selectedQuotationFrmListData, - selectedQuotationFrmListId: - selectedQuotationFrmListId, - managerId: managerId, - selectedEnquiryId: selectedEnquiryId, - onSubmit: (value) { - debugPrint("New Endorsement: $value"); - // enrollKey.currentState?.getEndrosmentList(selectedPolicyNumber); + showDialog( + context: context, + builder: (ctx) => createQuotatDialog( + userId: userId, + selectedQuotationFrmListdata: + selectedQuotationFrmListData, + selectedQuotationFrmListId: + selectedQuotationFrmListId, + managerId: managerId, + selectedEnquiryId: selectedEnquiryId, + onSubmit: (value) { + debugPrint("New Endorsement: $value"); + // enrollKey.currentState?.getEndrosmentList(selectedPolicyNumber); - print(value); - if (value == 'Success') { - refresh(); - } + print(value); + if (value == 'Success') { + refresh(); + } - // Update claim list or call API - }, - ), - ); - }, - child: Container( - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Color(0xFF425B5B), - borderRadius: BorderRadius.circular(8.0), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.add, color: Colors.white), - SizedBox(width: 10), - Text( - 'Create New Quotation', - style: GoogleFonts.inter( - color: Colors.white, - fontWeight: FontWeight.w500, - fontSize: 13, - ), + // Update claim list or call API + }, ), - ], + ); + }, + child: Container( + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Color(0xFF425B5B), + borderRadius: BorderRadius.circular(8.0), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.add, color: Colors.white), + SizedBox(width: 10), + Text( + 'Create New Quotation', + style: GoogleFonts.inter( + color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 13, + ), + ), + ], + ), ), ), - ), - ], + ], + ), ), - ), - const SizedBox(height: 20),], + const SizedBox(height: 20), + ], //3RD SECTION (TABLE) Container( @@ -522,7 +525,7 @@ class QuotationScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -563,7 +566,7 @@ class QuotationScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8), @@ -600,7 +603,7 @@ class QuotationScreenState extends ConsumerState { // 'api/agent/downloadAgentIncentiveFile?id=$selectedId'; final path = 'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy'; - apiService.getPdfDownload(context,path, selectedId); + apiService.getPdfDownload(context, path, selectedId); }, child: Container( padding: const EdgeInsets.all(8),