From 97759378de340741699003a0d352a4098d101147 Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Fri, 23 Jan 2026 11:10:19 +0530 Subject: [PATCH] policy validation bug fix --- .flutter-plugins-dependencies | 2 +- lib/core/config/env.dart | 4 +- lib/core/services/api_service.dart | 45 +- lib/presentation/layouts/appheader.dart | 200 ++ .../screens/Enquiry/enquiry/enquiry_tab.dart | 2 +- .../screens/UserManagement/Agent/agent.dart | 2 +- .../screens/UserManagement/Staff/staff.dart | 2 +- .../screens/handler/enquiryList.dart | 2 +- .../staff/Enquiry/enquiry_inline_dec1.dart | 2 +- .../staff/Enquiry/enquiry_inline_list.dart | 8 +- .../Enquiry/enquiry_inline_list_dec11.dart | 2 +- .../staff/Enquiry/enquiry_inline_old.dart | 2 +- .../screens/staff/Enquiry/raise_enq_form.dart | 2 +- .../screens/staff/policy/policy_list.dart | 27 +- .../staff/policy/policy_validation.dart | 1952 ++++++++--------- .../widgets/custom_Stdate_EnDate_Filter.dart | 141 ++ macos/Podfile | 2 +- macos/Podfile.lock | 223 +- macos/Runner.xcodeproj/project.pbxproj | 24 +- pubspec.lock | 20 +- web/index.html | 4 +- 21 files changed, 1585 insertions(+), 1083 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 54682a0..f6a47e7 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-01-12 11:05:54.356008","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":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_android-2.2.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.13/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_macos-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_linux-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_windows-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","dependencies":[],"dev_dependency":false},{"name":"firebase_auth_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth_web-6.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core_web-3.3.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_web-31.1.19/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/Users/venbateam/.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-01-21 18:29:17.341335","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/core/config/env.dart b/lib/core/config/env.dart index 98a3dfd..d204ef4 100644 --- a/lib/core/config/env.dart +++ b/lib/core/config/env.dart @@ -5,8 +5,8 @@ class Env { ); static const String apiUrl = String.fromEnvironment( 'API_URL', - // defaultValue: 'https://partner.nhanceindia.in/partner_api/api/', /* Live build (enable index.html line 18) */ - defaultValue: 'https://venbait.in/nhance/partner/dev/api/', /* Test build (enable index.html line 19) */ + defaultValue: 'https://partner.nhanceindia.in/partner_api/api/', /* Live build (enable index.html line 18) */ + // defaultValue: 'https://venbait.in/nhance/partner/dev/api/', /* Test build (enable index.html line 19) */ // defaultValue: 'http://localhost/nhance_partner_be/', /* localhost build (enable index.html line 19) */ ); // static const String baseUrl = String.fromEnvironment( diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index b9b0091..ffe0fdb 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -737,6 +737,26 @@ class ApiService { return response; } + // ----------------------------------- Staff Level Count ------------------------------------------------- + Future> fetchStaffLevelCount(id, userId) async { + // print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url; + + url = Uri.parse('${Env.apiUrl}dashboard/managerDashboard?manager_id=$id&staff_id=$userId'); + + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + 'app-signature': Env.App_Signature, + }; + + final response = await _makeGetRequest(url, headers); + return response; + } + // ----------------------------------- Dashboard ------------------------------------------------- Future> fetchDashboard(int id, role, userId) async { // print(_token); @@ -1372,6 +1392,7 @@ class ApiService { String? fromDate, String? toDate, String? selectedStaffId, + String ? selectedStatus }) async { print( "fetchPolicyDataOnlyListAPI - mangerID- $managerId - id - $id - role -$role ", @@ -1387,9 +1408,10 @@ class ApiService { if (role == 'manager') { query = 'manager_id=$managerId'; } else if (role == 'Accounts') { - query = 'manager_id=$managerId'; - } else if (role == 'Accounts') { - query = 'manager_id=$managerId'; + // query = 'manager_id=$managerId'; + query = selectedStatus != null + ? 'manager_id=$managerId&show_policy_report=${Uri.encodeComponent(selectedStatus)}' + : 'manager_id=$managerId'; } else if (role == 'staff') { query = 'staff_id=$id'; } else if (role == 'handler') { @@ -1573,7 +1595,7 @@ class ApiService { // --------------------------------- MASTER DATA DROPDOWN---------------------------------------------- - Future> fetchMasterDropDown(String val) async { + Future> fetchMasterDropDown(String val ,[String? type]) async { // print(_token); if (_token == null) { await _initializeToken(); @@ -1586,7 +1608,16 @@ class ApiService { if (val == 'staffRole') { url = Uri.parse('${Env.apiUrl}master/getRoleMaster'); } else if (val == 'vehicleType') { - url = Uri.parse('${Env.apiUrl}master/getVehicleTypeMaster'); + // url = Uri.parse('${Env.apiUrl}master/getVehicleTypeMaster'); + if(type == 'dropdown'){ + url = Uri.parse('${Env.apiUrl}master/getVehicleTypeMaster?value_for=dropdown'); + }else{ + url = Uri.parse('${Env.apiUrl}master/getVehicleTypeMaster'); + } + // url = Uri.parse('${Env.apiUrl}master/getVehicleTypeMaster') + // .replace(queryParameters: { + // if (type != null) 'value_for': type, + //}); } else if (val == 'InsuranceType') { url = Uri.parse('${Env.apiUrl}master/getInsurancePlanTypeMaster'); } else if (val == 'Insurers') { @@ -2083,9 +2114,9 @@ class ApiService { } } - Future generatePolicyExcel(managerId, fromDate, toDate, searchValue) async { + Future generatePolicyExcel(managerId, fromDate, toDate, searchValue,flag) async { final url = Uri.parse( - '${Env.apiUrl}reports/policy-excel?manager_id=$managerId&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&search=${searchValue ?? ''}', + '${Env.apiUrl}reports/policy-excel?manager_id=$managerId&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&search=${searchValue ?? ''}&show_policy_report=${flag ?? ''}', ); print('getPdfDownload policy-excel - $url'); await _initializeToken(); diff --git a/lib/presentation/layouts/appheader.dart b/lib/presentation/layouts/appheader.dart index 3d212f4..04a0967 100644 --- a/lib/presentation/layouts/appheader.dart +++ b/lib/presentation/layouts/appheader.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; @@ -32,6 +34,17 @@ class _AppHeaderState extends ConsumerState { OverlayEntry? _overlayEntry; String? _activeMenu; + Timer? _queueTimer; + int totalAssigned = 0; + int totalPending = 0; + int todayAssigned = 0; + int todayPending = 0; + int todayInProgress = 0; + int todayCompleted = 0; + + int queueCount = 0; // badge count + + @override void initState() { super.initState(); @@ -42,6 +55,7 @@ class _AppHeaderState extends ConsumerState { @override void dispose() { + _queueTimer?.cancel(); _hidePopup(); super.dispose(); } @@ -91,8 +105,71 @@ class _AppHeaderState extends ConsumerState { role = prefs.getString('userRole') ?? "Guest"; }); print('AppHeader Role - $role'); + // Initial fetch + auto refresh + WidgetsBinding.instance.addPostFrameCallback((_) { + print('111'); + if (role == 'staff') { + print('staff 111'); + getStaffLevelCount(profileData?['manager_id'], profileData?['id']); + + _queueTimer = Timer.periodic( + const Duration(seconds: 30), + (_) => getStaffLevelCount( + profileData?['manager_id'], + profileData?['id'], + ), + ); + } + }); } + Future getStaffLevelCount(managerId, userId) async { + print('staff 222'); + print('$managerId ,$userId'); + print('staff 333'); + try { + final response = await apiService.fetchStaffLevelCount(managerId, userId); + + if (response['status'] == 'success') { + final List summary = + response['data']['staff_level_pending_summary'] ?? []; + + int _totalAssigned = 0; + int _totalPending = 0; + int _todayAssigned = 0; + int _todayPending = 0; + int _todayInProgress = 0; + int _todayCompleted = 0; + + for (final item in summary) { + _totalAssigned += int.parse(item['total_assigned'] ?? '0'); + _totalPending += int.parse(item['total_pending'] ?? '0'); + _todayAssigned += int.parse(item['today_assigned'] ?? '0'); + _todayPending += int.parse(item['today_pending'] ?? '0'); + _todayInProgress += int.parse(item['today_in_progress'] ?? '0'); + _todayCompleted += int.parse(item['today_completed'] ?? '0'); + } + + if (!mounted) return; + + setState(() { + totalAssigned = _totalAssigned; + totalPending = _totalPending; + todayAssigned = _todayAssigned; + todayPending = _todayPending; + todayInProgress = _todayInProgress; + todayCompleted = _todayCompleted; + + queueCount = totalPending + todayPending + todayInProgress; + }); + } + } catch (e) { + debugPrint('Queue API Exception: $e'); + } + } + + + // Clear dashboard filters Future _clearDashboardFilters() async { final prefs = await SharedPreferences.getInstance(); @@ -408,6 +485,12 @@ class _AppHeaderState extends ConsumerState { ), const SizedBox(width: 16), ], + + if (role == 'staff') ...[ + _buildQueueIcon(), + const SizedBox(width: 12), + ], + // if (role != 'Accounts') ...[ if (!['Accounts', 'agent'].contains(role)) ...[ // Proposal button @@ -564,6 +647,123 @@ class _AppHeaderState extends ConsumerState { ); } + Widget _buildQueueIcon() { + return Builder( + builder: (iconContext) { + return MouseRegion( + onEnter: (_) { + final box = iconContext.findRenderObject() as RenderBox; + _showQueuePopup( + context, + box.localToGlobal(Offset.zero), + box.size, + ); + }, + onExit: (_) => _hidePopup(), + child: Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey.shade200), + ), + child: const Icon(Icons.priority_high, size: 20), + ), + + // 🔴 Badge + // if (queueCount > 0) + Positioned( + right: -6, + top: -6, + child: Container( + padding: const EdgeInsets.all(4), + decoration: const BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + ), + constraints: + const BoxConstraints(minWidth: 18, minHeight: 18), + child: Text( + queueCount.toString(), + textAlign: TextAlign.center, + style: const TextStyle( + color: Colors.white, + fontSize: 10, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ); + }, + ); + } + + void _showQueuePopup(BuildContext context, Offset offset, Size size) { + _hidePopup(); + + _overlayEntry = OverlayEntry( + builder: (_) => Positioned( + left: offset.dx, + top: offset.dy + size.height + 4, + child: MouseRegion( + onExit: (_) => _hidePopup(), + child: Material( + elevation: 10, + borderRadius: BorderRadius.circular(8), + child: Container( + width: 180, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _queueRow('Total Assigned', totalAssigned), + _queueRow('Total Pending', totalPending), + const Divider(), + _queueRow('Today Assigned', todayAssigned), + _queueRow('Today Pending', todayPending), + _queueRow('Today In Progress', todayInProgress), + _queueRow('Today Completed', todayCompleted), + ], + ), + ), + ), + ), + ), + ); + + Overlay.of(context, rootOverlay: true).insert(_overlayEntry!); + } + + Widget _queueRow(String label, int value) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(label, + style: + GoogleFonts.inter(fontSize: 12, color: Colors.grey.shade700)), + Text(value.toString(), + style: GoogleFonts.inter( + fontSize: 12, fontWeight: FontWeight.w600)), + ], + ), + ); + } + + + // Simple menu item widget Widget _buildMenuItem({ required IconData icon, diff --git a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart index 08facd6..57031d0 100644 --- a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart +++ b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart @@ -178,7 +178,7 @@ class EnquiryTabState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/UserManagement/Agent/agent.dart b/lib/presentation/screens/UserManagement/Agent/agent.dart index 115d940..f85b0fc 100644 --- a/lib/presentation/screens/UserManagement/Agent/agent.dart +++ b/lib/presentation/screens/UserManagement/Agent/agent.dart @@ -842,7 +842,7 @@ class AgentState extends ConsumerState { contentPadding: EdgeInsets.all(3), filled: true, fillColor: Colors.white, - hintText: "Search Executive...", + hintText: "Select Executive...", hintStyle: GoogleFonts.inter( fontSize: 12, color: Colors.black, diff --git a/lib/presentation/screens/UserManagement/Staff/staff.dart b/lib/presentation/screens/UserManagement/Staff/staff.dart index 087f04d..0e3c102 100644 --- a/lib/presentation/screens/UserManagement/Staff/staff.dart +++ b/lib/presentation/screens/UserManagement/Staff/staff.dart @@ -713,7 +713,7 @@ class StaffState extends ConsumerState { contentPadding: EdgeInsets.all(3), filled: true, fillColor: Colors.white, - hintText: "Search Role...", + hintText: "Select Role...", hintStyle: GoogleFonts.inter( fontSize: 12, color: Colors.black, diff --git a/lib/presentation/screens/handler/enquiryList.dart b/lib/presentation/screens/handler/enquiryList.dart index 7482757..5e4a8d1 100644 --- a/lib/presentation/screens/handler/enquiryList.dart +++ b/lib/presentation/screens/handler/enquiryList.dart @@ -1082,7 +1082,7 @@ class EnquiryHandlerState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart index e01a084..70d3d5a 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart @@ -1322,7 +1322,7 @@ class EnquiryStaffState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart index 03b61b8..d8f70b9 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart @@ -646,13 +646,13 @@ class EnquiryStaffState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { - // print('EIL 2getVT-Data - ${response['data']}'); + print('EIL 2getVT-Data - ${response['data']}'); setState(() { - // getVehicleTypeData = List>.from(response['data']); - getVehicleTypeData = List>.from(response['data']).where((item) => item['is_active']?.toString() == '1').toList(); + getVehicleTypeData = List>.from(response['data']); + // getVehicleTypeData = List>.from(response['data']).where((item) => item['is_active']?.toString() == '1').toList(); // print('EIL 3getVT-B4filterData : $getVehicleTypeData'); filteredVehicleData = List.from(getVehicleTypeData); diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list_dec11.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list_dec11.dart index 08cdf61..635f171 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list_dec11.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list_dec11.dart @@ -1557,7 +1557,7 @@ class EnquiryStaffState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_old.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_old.dart index b8c9cfb..a1ef58d 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_old.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_old.dart @@ -1132,7 +1132,7 @@ class EnquiryStaffState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart b/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart index de7dce2..87b8248 100644 --- a/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart +++ b/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart @@ -226,7 +226,7 @@ class RaiseEnqFormState extends ConsumerState { }); try { - final response = await apiService.fetchMasterDropDown('vehicleType'); + final response = await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200) { print('getVehicleTypeData - ${response['data']}'); diff --git a/lib/presentation/screens/staff/policy/policy_list.dart b/lib/presentation/screens/staff/policy/policy_list.dart index 94cdffd..4dcb0ea 100644 --- a/lib/presentation/screens/staff/policy/policy_list.dart +++ b/lib/presentation/screens/staff/policy/policy_list.dart @@ -54,7 +54,7 @@ class policylistState extends ConsumerState { @override void initState() { super.initState(); - + SelectedStatus = 'All'; apiService = ApiService(); for (String field in tabHeader) { @@ -68,7 +68,7 @@ class policylistState extends ConsumerState { print("D49 => r : $roleId | mId: $managerId | uId: $userId "); if (userId != null) { - getStaffList(managerId!, userId, roleId); + getStaffList(managerId!, userId, roleId , selectedStatus : SelectedStatus ?? 'All'); } refreshSub = ref.listenManual(policyDataAcurancyRefreshProvider, ( @@ -79,7 +79,7 @@ class policylistState extends ConsumerState { print('refresh triggered Quick Creation'); // callRefresh(); - getStaffList(managerId!, userId, roleId); + getStaffList(managerId!, userId, roleId,selectedStatus : SelectedStatus ?? 'All'); ref.read(policyDataAcurancyRefreshProvider.notifier).state = false; } }); @@ -93,7 +93,7 @@ class policylistState extends ConsumerState { // print("D61 => r : $roleId | mId: $id | uId: $userId"); if (userId != null) { - getStaffList(managerId, userId, roleId); + getStaffList(managerId, userId, roleId,selectedStatus : SelectedStatus ?? 'All'); } } @@ -103,6 +103,7 @@ class policylistState extends ConsumerState { role, { String fromDate = '', String toDate = '', + String selectedStatus = 'All', }) async { print('D68 => Fns called => $managerId | $role'); setState(() { @@ -137,6 +138,7 @@ class policylistState extends ConsumerState { fromDate: fromDt, toDate: toDt, selectedStaffId: SelectedStaffId ?? '', + selectedStatus:selectedStatus ); if (response['status'] == 'success') { @@ -226,7 +228,7 @@ class policylistState extends ConsumerState { print('filterDateRange 1s'); print('manager - $managerId - userID -$userId - roledId -$roleId'); - getStaffList(managerId!, userId, roleId); + getStaffList(managerId!, userId, roleId, selectedStatus : SelectedStatus ?? 'All'); } print('filterDateRange 1'); } @@ -236,13 +238,13 @@ class policylistState extends ConsumerState { SelectedStaffId = null; controllers['startDate']!.clear(); controllers['endDate']!.clear(); - + SelectedStatus ='All'; controllers['startDate']?.text = ''; controllers['endDate']?.text = ''; // Reset the FormField validation _formKey.currentState?.reset(); }); - getStaffList(managerId, userId, roleId); + getStaffList(managerId, userId, roleId, selectedStatus : SelectedStatus ?? 'All'); } void filterData(String query) { @@ -304,6 +306,7 @@ class policylistState extends ConsumerState { fromDate, toDate, searchValue, + SelectedStatus ?? 'All' ); // Map your controllers and IDs to the API parameters // final String fromDate = controllers['startDate']!.text; // "11-01-2025" @@ -429,8 +432,11 @@ class policylistState extends ConsumerState { selectedStaffId: SelectedStaffId, startController: controllers['startDate']!, endController: controllers['endDate']!, + selectedStatusVal: SelectedStatus, onStatusChanged: (val) { - SelectedStatus = val; // update parent + setState(() { + SelectedStatus = val; // update parent + }); }, formKey: _formKey, isMobile: ResponsiveLayout.isMobile(context), @@ -465,8 +471,11 @@ class policylistState extends ConsumerState { selectedStaffId: SelectedStaffId, startController: controllers['startDate']!, endController: controllers['endDate']!, + selectedStatusVal: SelectedStatus, onStatusChanged: (val) { - SelectedStatus = val; // update parent + setState(() { + SelectedStatus = val; // update parent + }); }, formKey: _formKey, isMobile: ResponsiveLayout.isMobile(context), diff --git a/lib/presentation/screens/staff/policy/policy_validation.dart b/lib/presentation/screens/staff/policy/policy_validation.dart index 6afa6a2..1a05fed 100644 --- a/lib/presentation/screens/staff/policy/policy_validation.dart +++ b/lib/presentation/screens/staff/policy/policy_validation.dart @@ -66,9 +66,10 @@ class _policyValidationState extends ConsumerState { 'cgst', 'sgst', 'igst', + 'payment_mode' // Vehicle - 'rcNo', + 'rcNo', 'rtoStateCode', 'rtoCityCode', 'weight', @@ -96,10 +97,10 @@ class _policyValidationState extends ConsumerState { 'insurance_plan_type', ]; late Map controllers; - String? selectedInsurancPlanType; String? selectedInsuranceId; String? selectedAgentRentionRate; String? selectedManagerRentionRate; + String? selectedInsurancePlanTypeId; List getVehicleTypeData = []; List filteredVehicleTypeData = []; @@ -116,12 +117,16 @@ class _policyValidationState extends ConsumerState { List> getVehicleTypeForEnquiryData = []; List> filteredVehicleDataForEnquiryData = []; + List> getPaymentModeData = []; + List> filteredPaymentModeData = []; + final GlobalKey _pdfViewerKey = GlobalKey(); final _formKey = GlobalKey(); String? selectedVehicleTypeForEnquiryID; String? selectedVehicleTypeForEnquiryVAL; String? selectedVehicleType; + String? selectedPaymentMode; String? selectedFuelType; String? selectedBroker; @@ -140,11 +145,16 @@ class _policyValidationState extends ConsumerState { final GlobalKey>> dropDownKeyInsurancPlanType = GlobalKey>>(); + final GlobalKey>> dropDownKeyPaymentMode = + GlobalKey>>(); + bool _hasLoadedInitialData = false; Map dataDetails() { return { - "rc_no": controllers["rcNo"]?.text, + "rc_no": controllers["rcNo"]?.text.trim().isNotEmpty == true + ? controllers["rcNo"]?.text + : controllers["enquiry_reg_no_for_commission"]?.text, "insured_name": controllers["insuredName"]?.text, "issued_date": controllers["issuedDate"]?.text, "start_date": controllers["startDate"]?.text, @@ -196,6 +206,10 @@ class _policyValidationState extends ConsumerState { ? null : controllers["dateOfRegistration"]?.text, + // "date_of_registration": (controllers["dateOfRegistration"]?.text.isNotEmpty ?? false) + // ? DateFormat('yyyy-MM-dd').format( DateFormat('dd-MM-yyyy').parse(controllers["dateOfRegistration"]!.text),) + // : null, + "year_of_manufacture": controllers["yearOfManufacture"]?.text.isEmpty ?? true ? null : controllers["yearOfManufacture"]?.text, @@ -220,29 +234,55 @@ class _policyValidationState extends ConsumerState { ? null : controllers["cubicCapacity"]?.text, - "vehicle_type": controllers["vehicleType"]?.text?.isEmpty ?? true - ? selectedVehicleTypeForEnquiryVAL - : controllers["vehicleType"]?.text, + // "vehicle_type": controllers["vehicleType"]?.text?.isEmpty ?? true + // ? selectedVehicleTypeForEnquiryVAL + // : controllers["vehicleType"]?.text, + + "vehicle_type": + controllers["vehicleType"]?.text.trim().isNotEmpty == true + ? controllers["vehicleType"]?.text + : null, "broker_name": controllers["broker_name"]?.text?.isEmpty ?? true ? null : controllers["broker_name"]?.text, - "enquiry_broker_id_for_commission": controllers["enquiry_broker_id_for_commission"]?.text?.isEmpty ?? true - ? null - : controllers["enquiry_broker_id_for_commission"]?.text, + // "enquiry_broker_id_for_commission": controllers["enquiry_broker_id_for_commission"]?.text?.isEmpty ?? true + // ? null + // : controllers["enquiry_broker_id_for_commission"]?.text, + + "enquiry_broker_id_for_commission": + controllers["enquiry_broker_id_for_commission"]?.text.trim().isNotEmpty == + true + ? controllers["enquiry_broker_id_for_commission"]?.text + : selectedBroker, "enquiry_reg_no_for_commission": controllers["enquiry_reg_no_for_commission"]?.text?.isEmpty ?? true ? null : controllers["enquiry_reg_no_for_commission"]?.text, - "enquiry_vehicle_type_id_for_commission": controllers["enquiry_vehicle_type_id_for_commission"]?.text?.isEmpty ?? true - ? null - : controllers["enquiry_vehicle_type_id_for_commission"]?.text, + // "enquiry_vehicle_type_id_for_commission": controllers["enquiry_vehicle_type_id_for_commission"]?.text?.isEmpty ?? true + // ? null + // : controllers["enquiry_vehicle_type_id_for_commission"]?.text, + + "enquiry_vehicle_type_id_for_commission": + controllers["enquiry_vehicle_type_id_for_commission"] + ?.text + .trim() + .isNotEmpty == + true + ? controllers["enquiry_vehicle_type_id_for_commission"]?.text + : selectedVehicleTypeForEnquiryID, "commission_amount": controllers["commission_amount"]?.text?.isEmpty ?? true ? null : controllers["commission_amount"]?.text, + + "payment_mode": controllers["payment_mode"]?.text.trim().isNotEmpty == true + ? controllers["payment_mode"]?.text + : selectedPaymentMode, + "insurance_plan_type_id": selectedInsurancePlanTypeId, + // "insurance_plan_type": controllers["insurance_plan_type"]?.text.trim().isNotEmpty == true ? controllers['insurance_plan_type']?.text : selectedInsurancPlanType, }; } @@ -250,9 +290,13 @@ class _policyValidationState extends ConsumerState { final data = dataDetails(); final policyId = widget.item?['policy_id']; + final pm = (data["payment_mode"] == null || data["payment_mode"] == 0 || data["payment_mode"] == '0' || data["payment_mode"].toString().isEmpty) + ? selectedPaymentMode + : data["payment_mode"]; + return { - "vehicle_type": data["vehicle_type"] ?? selectedVehicleTypeForEnquiryVAL, - "insurance_plan_type": selectedInsurancPlanType, + "vehicle_type": data["vehicle_type"] ?? selectedVehicleType, + "insurance_plan_type_id": selectedInsurancePlanTypeId, "premium_amount": data["premium_amount"], "od": data["od"], "tp": data["tp"], @@ -275,6 +319,7 @@ class _policyValidationState extends ConsumerState { "enquiry_broker_id_for_commission": selectedBroker, "enquiry_reg_no_for_commission": data["enquiry_reg_no_for_commission"], "enquiry_vehicle_type_id_for_commission": selectedVehicleTypeForEnquiryID, + "payment_mode": pm, }; } @@ -289,28 +334,7 @@ class _policyValidationState extends ConsumerState { }; update(); _loadInitialData(); - // read providers + call APIs - // Future.microtask(() { - // try { - // managerId = ref.read(managerIdProvider); - // } catch (e) { - // managerId = null; - // } - // try { - // userId = ref.read(userIdProvider); - // } catch (e) { - // userId = null; - // } - // - // getVehicleType(); - // getFuelType(); - // getFindPolicy(); - // getPolicyFilePath(); - // }); - // controllers['commission_amount']?.addListener(() { - // setState(() {}); - // }); } Future _loadInitialData() async { @@ -333,6 +357,7 @@ class _policyValidationState extends ConsumerState { getPolicyFilePath(), getBroker(), getInsurancPlanType(), + getPaymentMode(), getEnquiryVehicleTypeForCommission() ]); } @@ -422,12 +447,49 @@ class _policyValidationState extends ConsumerState { } } + Future getPaymentMode() async { + setState(() => isLoading = true); + + try { + final response = await apiService.fetchMasterDropDown('PaymentMode'); + + if (response['status'] == 200 && response['data'] != null) { + final allData = List>.from(response['data']); + final activePaymentMode = + allData.where((item) => item['is_active'] == "1").toList(); + + setState(() { + getPaymentModeData = activePaymentMode; + filteredPaymentModeData = List.from(getPaymentModeData); + + // ✅ IMPORTANT: rebind selected value AFTER list is ready + if (selectedPaymentMode != null && + selectedPaymentMode!.isNotEmpty && + selectedPaymentMode != '0') { + // nothing else needed – rebuild is enough + } + }); + } else { + setState(() { + getPaymentModeData.clear(); + filteredPaymentModeData.clear(); + }); + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() => isLoading = false); + } + } + + + Future getEnquiryVehicleTypeForCommission() async { setState(() => isLoading = true); try { final response = - await apiService.fetchMasterDropDown('vehicleType'); + await apiService.fetchMasterDropDown('vehicleType','dropdown'); if (response['status'] == 200 && response['data'] != null) { final allData = List>.from(response['data']); @@ -453,19 +515,7 @@ class _policyValidationState extends ConsumerState { filteredVehicleTypeData.clear(); } - // if (response['status'] == 200 && response['data'] != null) { - // setState(() { - // getVehicleTypeForEnquiryData = - // List>.from(response['data']); - // - // filteredVehicleDataForEnquiryData = - // List>.from( - // getVehicleTypeForEnquiryData); - // }); - // } else { - // getVehicleTypeForEnquiryData.clear(); - // filteredVehicleDataForEnquiryData.clear(); - // } + } catch (e) { print('Exception occurred: $e'); } finally { @@ -474,23 +524,53 @@ class _policyValidationState extends ConsumerState { } + // Future getVehicleType() async { + // print('getvehicleType called'); + // setState(() => isLoadingVehicleType = true); + // + // try { + // final response = await apiService.fetchPolicyMasterDropDown( + // 'vehicleType', + // ); + // + // if (response['status'] == 'success' && response['data'] != null) { + // print('Vehicle Types: ${response['data']}'); + // setState(() { + // getVehicleTypeData = List.from(response['data']); + // filteredVehicleTypeData = List.from(getVehicleTypeData); + // }); + // + // print('Vehicle Types: $getVehicleTypeData'); + // } else { + // getVehicleTypeData.clear(); + // filteredVehicleTypeData.clear(); + // } + // } catch (e) { + // print('Exception occurred: $e'); + // } finally { + // setState(() => isLoadingVehicleType = false); + // } + // } + Future getVehicleType() async { - print('getvehicleType called'); setState(() => isLoadingVehicleType = true); try { - final response = await apiService.fetchPolicyMasterDropDown( - 'vehicleType', - ); + final response = await apiService.fetchPolicyMasterDropDown('vehicleType'); if (response['status'] == 'success' && response['data'] != null) { - print('Vehicle Types: ${response['data']}'); - setState(() { - getVehicleTypeData = List.from(response['data']); - filteredVehicleTypeData = List.from(getVehicleTypeData); - }); + final list = List.from(response['data']); - print('Vehicle Types: $getVehicleTypeData'); + setState(() { + getVehicleTypeData = list; + filteredVehicleTypeData = List.from(list); + + // ✅ REBIND AFTER LIST IS READY + final apiVehicleType = controllers['vehicleType']?.text; + if (apiVehicleType != null && list.contains(apiVehicleType)) { + controllers['vehicleType']!.text = apiVehicleType; + } + }); } else { getVehicleTypeData.clear(); filteredVehicleTypeData.clear(); @@ -502,21 +582,52 @@ class _policyValidationState extends ConsumerState { } } + + // Future getFuelType() async { + // print('getfuelType called'); + // setState(() => isLoadingFuelType = true); + // + // try { + // final response = await apiService.fetchPolicyMasterDropDown('fuelType'); + // + // if (response['status'] == 'success' && response['data'] != null) { + // print('fuelType Types: ${response['data']}'); + // setState(() { + // getFuelTypeData = List.from(response['data']); + // filteredFuelTypeData = List.from(getFuelTypeData); + // }); + // + // print('fuelType Types: $getFuelTypeData'); + // } else { + // getFuelTypeData.clear(); + // filteredFuelTypeData.clear(); + // } + // } catch (e) { + // print('Exception occurred: $e'); + // } finally { + // setState(() => isLoadingFuelType = false); + // } + // } + Future getFuelType() async { - print('getfuelType called'); setState(() => isLoadingFuelType = true); try { final response = await apiService.fetchPolicyMasterDropDown('fuelType'); if (response['status'] == 'success' && response['data'] != null) { - print('fuelType Types: ${response['data']}'); - setState(() { - getFuelTypeData = List.from(response['data']); - filteredFuelTypeData = List.from(getFuelTypeData); - }); + final list = List.from(response['data']); - print('fuelType Types: $getFuelTypeData'); + setState(() { + getFuelTypeData = list; + filteredFuelTypeData = List.from(list); + + // ✅ REBIND AFTER LIST IS READY + final apiFuel = controllers['fuelType']?.text; + if (apiFuel != null && list.contains(apiFuel)) { + controllers['fuelType']!.text = apiFuel; + } + }); } else { getFuelTypeData.clear(); filteredFuelTypeData.clear(); @@ -528,6 +639,7 @@ class _policyValidationState extends ConsumerState { } } + Future getPolicyFilePath() async { _pdfViewerKey.currentState?.openBookmarkView(); @@ -598,14 +710,16 @@ class _policyValidationState extends ConsumerState { controllers["policyNumber"]?.text = safeText(data['policy_number']); controllers["insuredName"]!.text = safeText(data['insured_name']); controllers["premiumAmount"]!.text = safeText(data['premium_amount']); - controllers["rcNo"]!.text = safeText(data['rc_no']); // controllers["issuedDate"]!.text = safeText(data['issued_date']); // controllers["startDate"]!.text = safeText(data['start_date']); // controllers["endDate"]!.text = safeText(data['end_date']); controllers["issuedDate"]?.text = fixInvalidDate(data['issued_date']); - controllers["startDate"]?.text = fixInvalidDate(data['start_date']); - controllers["endDate"]?.text = fixInvalidDate(data['end_date']); + controllers["startDate"]?.text = fixInvalidDate(data['start_date']); + controllers["endDate"]?.text = fixInvalidDate(data['end_date']); + + print('check for date'); + print(controllers["issuedDate"]?.text); controllers["tp"]!.text = safeText(data['tp']); controllers["od"]!.text = safeText(data['od']); @@ -617,12 +731,17 @@ class _policyValidationState extends ConsumerState { controllers["rtoStateCode"]!.text = safeText(data['rto_state_code']); controllers["rtoCityCode"]!.text = safeText(data['rto_city_code']); controllers["weight"]!.text = safeText(data['weight']); - controllers["dateOfRegistration"]!.text = safeText( - data['date_of_registration'], - ); + // controllers["dateOfRegistration"]!.text = safeText( + // data['date_of_registration'], + // ); + controllers["dateOfRegistration"]!.text = + apiDateToUiDate(data['date_of_registration']); - selectedFuelType = safeText(data['fuel_type']); - selectedVehicleType = safeText(data['vehicle_type']); + // selectedFuelType = safeText(data['fuel_type']); + controllers['fuelType']?.text = safeText(data['fuel_type']); + controllers["vehicleType"]?.text = safeText(data['vehicle_type']); + selectedPaymentMode = safeText(data['payment_mode_id']); + controllers['payment_mode']?.text = selectedPaymentMode ?? ''; controllers["engineNo"]!.text = safeText(data['engine_no']); controllers["chassisNo"]!.text = safeText(data['chassis_no']); controllers["make"]!.text = safeText(data['make']); @@ -634,18 +753,35 @@ class _policyValidationState extends ConsumerState { data['year_of_manufacture'], ); - selectedInsurancPlanType = safeText(data['insurance_plan_type']); + // selectedInsurancPlanType = safeText(data['insurance_plan_type']); + // controllers["insurance_plan_type"]?.text = safeText(data['insurance_plan_type']); + final planName = safeText(data['insurance_plan_type']); + + final matchedPlan = filteredInsurancPlanTypeData.firstWhere( + (item) => + item['insurance_plan_type'] + .toString() + .toLowerCase() == + planName.toLowerCase(), + orElse: () => {}, + ); + + if (matchedPlan.isNotEmpty) { + selectedInsurancePlanTypeId = matchedPlan['id'].toString(); + } + selectedInsuranceId = safeText(data['insurer_id']); selectedAgentRentionRate = safeText(data['agent_retention_rate']); selectedManagerRentionRate = safeText(data['manager_retention_rate']); - // controllers["commission_amount"]?.text = safeText( - // data['commission_amount'], - // ); + controllers["commission_amount"]?.text = safeText( + data['commission_amount'], + ); // FIX: Removed the invalid "data['key'] ? ..." syntax selectedBroker = data['enquiry_broker_id_for_commission']?.toString() ?? ''; selectedVehicleTypeForEnquiryID = data['enquiry_vehicle_type_id_for_commission']?.toString() ?? ''; controllers["enquiry_reg_no_for_commission"]?.text = safeText(data['enquiry_reg_no_for_commission']); + // controllers["rcNo"]!.text = safeText(data['rc_no']); }); debugPrint('findPolicyApi response3:'); @@ -662,6 +798,33 @@ class _policyValidationState extends ConsumerState { } } + String apiDateToUiDate(dynamic value) { + if (value == null) return ''; + final str = value.toString().trim(); + if (str.isEmpty) return ''; + + try { + // API → yyyy-MM-dd + final date = DateFormat('yyyy-MM-dd').parse(str); + // UI → dd-MM-yyyy + return DateFormat('dd-MM-yyyy').format(date); + } catch (_) { + return ''; + } + } + + + String apiToUiDate(String? value) { + if (value == null || value.isEmpty) return ''; + if (value.contains('--')) return ''; + + // API already sends dd-MM-yyyy + return value; + + // return DateFormat('dd-MM-yyyy') + // .format(DateFormat('yyyy-MM-dd').parse(value)); + } + Future _pickDate( TextEditingController controller, BuildContext context, @@ -717,10 +880,10 @@ class _policyValidationState extends ConsumerState { return; } - if (widget.item?['is_data_accuracy_checked'] == "1") { - ToastHelper.showWarningToast(context, "Data already confirmed"); - return; - } + // if (widget.item?['is_data_accuracy_checked'] == "1") { + // ToastHelper.showWarningToast(context, "Data already confirmed"); + // return; + // } final payload = {"id": policyId, ...dataDetails(), "updated_by": userId}; @@ -875,85 +1038,7 @@ class _policyValidationState extends ConsumerState { print('_fetchCommision OUT'); } - // Old Code For Backup purpose - // Future _fetchCommision() async { - // print('_fetchCommision'); - // final policyId = widget.item?['policy_id']; - // final payload = buildCommissionPayload(); - // if (policyId == null) { - // ToastHelper.showWarningToast(context, 'Missing policy id'); - // return; - // } - // - // if (!_formKey.currentState!.validate()) { - // ToastHelper.showWarningToast(context, "Please fill all required fields"); - // return; - // } - // - // // if (widget.item?['is_data_accuracy_checked'] == "1") { - // // ToastHelper.showWarningToast(context, "Data already confirmed"); - // // return; - // // } - // - // // final payload = { - // // "id": policyId, - // // 'insurance_plan_type': controllers['insurance_plan_type'], - // // "updated_by": userId, - // // ...dataDetails(), - // // // "insurance_plan_type": - // // }; - // print('_fetchCommision1'); - // // setState(() { - // // isLoading = true; - // // payload['insurance_plan_type'] = selectedInsurancPlanType; - // // payload['insurer_id'] = selectedInsuranceId; - // // payload['id'] = policyId; - // // payload['updated_by'] = userId; - // // print('payload2 - ${payload['insurance_plan_type']}'); - // // print('payload - $payload'); - // // });// debugPrint('FINAL SAVE PAYLOAD 1=> $payload'); - // final result = await apiService.calculateCommissionRequest(payload); - // debugPrint('updatePolicy result => $result'); - // print('_fetchCommision2'); - // try { - // debugPrint('FINAL SAVE PAYLOAD 1=> $payload'); - // final result = await apiService.calculateCommissionRequest(payload); - // debugPrint('updatePolicy result => $result'); - // - // if (result != null && result['status'] == 'success') { - // if (!mounted) return; - // setState(() => isLoading = false); - // // context.pop(); - // ToastHelper.showSuccessToast(context, "Policy updated successfully"); - // // Extract commission_amount from response - // final commissionAmount = result['data']?['commission_amount']; - // if (commissionAmount != null) { - // controllers["commission_amount"]?.text = commissionAmount - // .toStringAsFixed(2); - // } - // - // // WidgetsBinding.instance.addPostFrameCallback((_) { - // // // Now safe to do navigation + provider updates - // // final container = ProviderScope.containerOf(context); - // // container.read(policyDataAcurancyRefreshProvider.notifier).state = - // // true; - // // }); - // } else { - // if (!mounted) return; - // setState(() => isLoading = false); - // ToastHelper.showErrorToast( - // context, - // result?['message']?.toString() ?? 'Error updating policy', - // ); - // } - // } catch (e, st) { - // debugPrint('Exception in updatePolicy: $e\n$st'); - // if (!mounted) return; - // setState(() => isLoading = false); - // ToastHelper.showWarningToast(context, 'Exception: $e'); - // } - // } Widget buildVehicleType(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -967,8 +1052,8 @@ class _policyValidationState extends ConsumerState { DropdownSearch( key: dropDownKey, - selectedItem: selectedVehicleType?.isNotEmpty == true - ? selectedVehicleType + selectedItem: controllers['vehicleType']!.text.isNotEmpty + ? controllers['vehicleType']!.text : null, items: (filter, infiniteScrollProps) { @@ -1048,10 +1133,10 @@ class _policyValidationState extends ConsumerState { onChanged: (val) { if (val != null) { - // setState(() { - selectedVehicleType = val; + setState(() { + // selectedVehicleType = val; controllers['vehicleType']?.text = val; - // }); + }); // setState(() {}); print("Selected Vehicle Type: $val"); } @@ -1060,6 +1145,7 @@ class _policyValidationState extends ConsumerState { ], ); } + Widget buildFuelType(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1072,8 +1158,8 @@ class _policyValidationState extends ConsumerState { DropdownSearch( key: dropDownKeyFuel, - selectedItem: selectedFuelType?.isNotEmpty == true - ? selectedFuelType + selectedItem: controllers['fuelType']!.text.isNotEmpty + ? controllers['fuelType']!.text : null, items: (filter, infiniteScrollProps) { @@ -1163,10 +1249,10 @@ class _policyValidationState extends ConsumerState { onChanged: (val) { if (val != null) { - // setState(() { - selectedFuelType = val; + setState(() { + // selectedFuelType = val; controllers['fuelType']?.text = val; - // }); + }); // setState(() {}); print("Selected Fuel Type: $val"); } @@ -1175,119 +1261,7 @@ class _policyValidationState extends ConsumerState { ], ); } - // Widget buildInsurancPlanType(BuildContext context) { - // - // final Map? selectedInsurancPlanTypes = - // selectedInsurancPlanType != null - // ? filteredInsurancPlanTypeData.firstWhere( - // (item) => - // item['insurance_plan_type'].toString() == - // selectedInsurancPlanType, - // orElse: () => {}, - // ) - // : null; - // - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Text( - // "Insurance Plan Type ", - // style: GoogleFonts.poppins(fontWeight: FontWeight.w500, fontSize: 11), - // ), - // const SizedBox(height: 6), - // DropdownSearch( - // key: dropDownKeyInsurancPlanType, - // - // selectedItem: selectedInsurancPlanType?.isNotEmpty == true - // ? selectedInsurancPlanType - // : null, - // - // items: (filter, _) => filteredInsurancPlanTypeData, - // - // itemAsString: (val) => val, // 👈 String directly - // - // validator: (val) { - // if (val == null || val.isEmpty) { - // return ""; // 👈 triggers error border, no text - // } - // return null; - // }, - // - // decoratorProps: DropDownDecoratorProps( - // decoration: - // AppInputDecorations.dropdownDecoration( - // label: "Select Plan Type", - // ).copyWith( - // filled: true, - // fillColor: Colors.white, - // isDense: true, - // border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide( - // // color: Color(0xFFE2E8F0), - // width: 0.6, - // ), - // ), - // enabledBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide( - // // color: Color(0xFFE2E8F0), - // width: 0.6, - // ), - // ), - // errorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide(color: Colors.red), - // ), - // focusedErrorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide(color: Colors.red), - // ), - // contentPadding: const EdgeInsets.symmetric( - // horizontal: 8, - // vertical: 10, - // ), - // ), - // ), - // - // popupProps: PopupProps.menu( - // fit: FlexFit.loose, - // constraints: const BoxConstraints(maxHeight: 250), - // menuProps: const MenuProps(backgroundColor: Colors.white), - // showSearchBox: true, - // - // searchFieldProps: TextFieldProps( - // autofocus: true, - // decoration: InputDecoration( - // contentPadding: const EdgeInsets.all(6), - // filled: true, - // fillColor: Colors.white, - // hintText: "Search Plan Type...", - // hintStyle: GoogleFonts.inter(fontSize: 12, color: Colors.black), - // enabledBorder: const OutlineInputBorder( - // borderSide: BorderSide(color: Color(0xFFE2E8F0)), - // ), - // focusedBorder: const OutlineInputBorder( - // borderSide: BorderSide(color: Color(0xFFE2E8F0), width: 1.5), - // ), - // ), - // ), - // ), - // - // onChanged: (val) { - // if (val != null) { - // // setState(() { - // selectedInsurancPlanType = val; - // controllers['insurance_plan_type']?.text = val; - // // }); - // // setState(() {}); - // print("Selected InsurancPlanType: $val"); - // } - // }, - // ), - // ], - // ); - // } + Widget buildBrokerAsPerEnquiry(BuildContext context) { @@ -1417,116 +1391,135 @@ class _policyValidationState extends ConsumerState { ); } - // Map? selectedVehicleTypes = filteredVehicleDataForEnquiryData.firstWhere( - // (item) => item['id'].toString() == selectedVehicleTypeForEnquiry, - // orElse: () => {}, - // ); + Widget buildPaymentMode(BuildContext context) { + final Map? selectedPM = + selectedPaymentMode != null + ? filteredPaymentModeData.firstWhere( + (item) => + item['id'].toString() == + selectedPaymentMode, + orElse: () => {}, + ) + : null; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Payment Mode *", + style: GoogleFonts.poppins( + fontWeight: FontWeight.w500, + fontSize: 11, + ), + ), + const SizedBox(height: 6), + + DropdownSearch>( + key: dropDownKeyPaymentMode, + + items: (filter, _) => filteredPaymentModeData, + // disabledItemFn: (item) => item['is_active'] == "0", + + compareFn: (a, b) => + a['id'].toString() == b['id'].toString(), + + selectedItem: selectedPM != null && selectedPM.isNotEmpty + ? selectedPM + : null, + itemAsString: (item) => item['value'].toString(), + + // 2. Styling for the items in the list + popupProps: PopupProps.menu( + itemBuilder: (context, item, isSelected, isHovered) { + final bool isActive = item['is_active'] == "1"; + return ListTile( + title: Text( + item['value'].toString(), + style: TextStyle( + // Gray out text if inactive + color: isActive ? Colors.black : Colors.grey, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + // Add a "Disabled" subtitle for clarity + subtitle: isActive ? null : const Text("Inactive", style: TextStyle(fontSize: 10, color: Colors.red)), + ); + }, + ), - // Widget (BuildContext context) { - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Text( - // "Broker (as per Enquiry)", - // style: GoogleFonts.poppins(fontWeight: FontWeight.w500, fontSize: 11), - // ), - // const SizedBox(height: 6), - // DropdownSearch( - // key: dropDownKeyBroker, - // - // selectedItem: selectedBroker?.isNotEmpty == true - // ? selectedBroker - // : null, - // - // items: (filter, infiniteScrollProps) { - // return filteredBrokerData; - // }, - // - // itemAsString: (val) => val, // 👈 String directly - // - // validator: (val) { - // if (val == null || val.isEmpty) { - // return ""; // 👈 triggers error border, no text - // } - // return null; - // }, - // - // decoratorProps: DropDownDecoratorProps( - // decoration: - // AppInputDecorations.dropdownDecoration( - // label: "Select Broker as per Enquiry", - // ).copyWith( - // filled: true, - // fillColor: Colors.white, - // isDense: true, - // border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide( - // // color: Color(0xFFE2E8F0), - // width: 0.6, - // ), - // ), - // enabledBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide( - // // color: Color(0xFFE2E8F0), - // width: 0.6, - // ), - // ), - // errorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide(color: Colors.red), - // ), - // focusedErrorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(6), - // borderSide: const BorderSide(color: Colors.red), - // ), - // contentPadding: const EdgeInsets.symmetric( - // horizontal: 8, - // vertical: 10, - // ), - // ), - // ), - // - // popupProps: PopupProps.menu( - // fit: FlexFit.loose, - // constraints: const BoxConstraints(maxHeight: 250), - // menuProps: const MenuProps(backgroundColor: Colors.white), - // showSearchBox: true, - // - // searchFieldProps: TextFieldProps( - // autofocus: true, - // decoration: InputDecoration( - // contentPadding: const EdgeInsets.all(6), - // filled: true, - // fillColor: Colors.white, - // hintText: "Search Broker as per Enquiry...", - // hintStyle: GoogleFonts.inter(fontSize: 12, color: Colors.black), - // enabledBorder: const OutlineInputBorder( - // borderSide: BorderSide(color: Color(0xFFE2E8F0)), - // ), - // focusedBorder: const OutlineInputBorder( - // borderSide: BorderSide(color: Color(0xFFE2E8F0), width: 1.5), - // ), - // ), - // ), - // ), - // - // onChanged: (val) { - // if (val != null) { - // // setState(() { - // selectedBroker = val; - // controllers['enquiry_broker_id_for_commission']?.text = val; - // // }); - // // setState(() {}); - // print("SelectedBrokerAsPerEnquiry: $val"); - // } - // }, - // ), - // ], - // ); - // } + onChanged: (val) { + if (val != null) { + selectedPaymentMode = val['id'].toString(); // ✅ store ID + // ✅ WRITE INTO CONTROLLER (CRITICAL) + controllers['payment_mode']?.text = selectedPaymentMode!; + } + }, + + validator: (val) { + if (val == null) return ""; + return null; + }, + ), + ], + ); + } + + Widget buildInsurancPlanType(BuildContext context) { + final Map? selectedPlan = + selectedInsurancePlanTypeId != null + ? filteredInsurancPlanTypeData.firstWhere( + (item) => + item['id'].toString() == + selectedInsurancePlanTypeId, + orElse: () => {}, + ) + : null; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Insurance Plan Type", + style: GoogleFonts.poppins( + fontWeight: FontWeight.w500, + fontSize: 11, + ), + ), + const SizedBox(height: 6), + DropdownSearch>( + key: dropDownKeyInsurancPlanType, + + items: (filter, _) => filteredInsurancPlanTypeData, + + selectedItem: + selectedPlan != null && selectedPlan.isNotEmpty + ? selectedPlan + : null, + + itemAsString: (item) => + item['insurance_plan_type'].toString(), + + compareFn: (a, b) => + a['id'].toString() == b['id'].toString(), + + onChanged: (val) { + if (val != null) { + // setState(() { + selectedInsurancePlanTypeId = + val['id'].toString(); + // }); + } + }, + + validator: (val) { + if (val == null) return ""; + return null; + }, + ), + ], + ); + } Widget _sectionHeader(String title, {IconData icon = Icons.info}) { @@ -1565,6 +1558,7 @@ class _policyValidationState extends ConsumerState { bool required = false, String? hintText, List? inputFormatters, // 👈 ADD THIS + ValueChanged? onChanged, // 👈 ADD THIS }) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1579,6 +1573,7 @@ class _policyValidationState extends ConsumerState { keyboardType: keyboardType, readOnly: readOnly, onTap: onTap, + onChanged: onChanged, inputFormatters: inputFormatters, // 👈 USE HERE validator: (val) { // if (val == null || val.isEmpty) { @@ -1637,71 +1632,29 @@ class _policyValidationState extends ConsumerState { child: Row( mainAxisAlignment: MainAxisAlignment.end, // 👉 move button to right children: [ - ElevatedButton( - // onPressed: widget.item?['is_data_accuracy_checked'] == '1' - // onPressed: - // widget.item?['is_data_accuracy_checked'] != '1' || - // (controllers['commission_amount']?.text.isEmpty ?? true) - // ? null - // : _save, - onPressed: - (widget.item?['is_data_accuracy_checked']?.toString() == - '0' && - ((double.tryParse( - controllers["commission_amount"]?.text ?? - '0', - ) ?? - 0) - .floor() >= - 1)) - ? _save - : null, - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF2E7D6E), - foregroundColor: Colors.white, - padding: const EdgeInsets.symmetric( - vertical: 10, - horizontal: 20, // 👉 smaller width - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - ), - child: Text( - 'Confirm Data Accuracy ', - // '(${controllers["commission_amount"]?.text ?? '0'} | ' - // '${widget.item?['is_data_accuracy_checked'] ?? '0'})', - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600), - ), - ), - // ElevatedButton( - // onPressed: widget.item?['is_data_accuracy_checked'] == '1' - // ? null - // : _fetchCommision, - // style: ElevatedButton.styleFrom( - // backgroundColor: const Color(0xFF2E7D6E), - // foregroundColor: Colors.white, - // padding: const EdgeInsets.symmetric( - // vertical: 10, - // horizontal: 20, // 👉 smaller width - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(8), - // ), - // ), - // child: const Text( - // 'Fetch Commission', - // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600), - // ), - // ), - // SizedBox(width: 10), // ElevatedButton( // // onPressed: widget.item?['is_data_accuracy_checked'] == '1' - // onPressed: - // widget.item?['is_data_accuracy_checked'] != '1' || - // (controllers['commission_amount']?.text.isEmpty ?? true) - // ? null - // : _save, + // // onPressed: + // // widget.item?['is_data_accuracy_checked'] != '1' || + // // (controllers['commission_amount']?.text.isEmpty ?? true) + // // ? null + // // : _save, + // onPressed: (widget.item?['is_data_accuracy_checked']?.toString() == '0' && + // (controllers['commission_amount']?.text.trim().isNotEmpty ?? false)) + // ? _save + // : null, + // // onPressed: + // // (widget.item?['is_data_accuracy_checked']?.toString() == + // // '0' && + // // ((double.tryParse( + // // controllers["commission_amount"]?.text ?? + // // '0', + // // ) ?? + // // 0) + // // .floor() >= + // // 1)) + // // ? _save + // // : null, // style: ElevatedButton.styleFrom( // backgroundColor: const Color(0xFF2E7D6E), // foregroundColor: Colors.white, @@ -1713,11 +1666,41 @@ class _policyValidationState extends ConsumerState { // borderRadius: BorderRadius.circular(8), // ), // ), - // child: const Text( - // 'Confirm Data Accuracy', + // child: Text( + // 'Confirm Data Accuracy ', + // // '(${controllers["commission_amount"]?.text ?? '0'} | ' + // // '${widget.item?['is_data_accuracy_checked'] ?? '0'})', // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600), // ), // ), + ValueListenableBuilder( + valueListenable: controllers['commission_amount']!, + builder: (context, value, _) { + final bool isEnabled = + widget.item?['is_data_accuracy_checked']?.toString() == '0' && + value.text.trim().isNotEmpty; + + return ElevatedButton( + onPressed: isEnabled ? _save : null, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF2E7D6E), + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric( + vertical: 10, + horizontal: 20, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: const Text( + 'Confirm Data Accuracy', + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600), + ), + ); + }, + ), + ], ), ), @@ -1797,56 +1780,7 @@ class _policyValidationState extends ConsumerState { ), // 👈 Use separate widget ), - // Expanded( - // child: pdfUrl == null - // ? Center(child: CircularProgressIndicator()) - // : FutureBuilder( - // key: ValueKey( - // _cachedPdfUrl, - // ), // 👈 Add this key - // future: loadNetworkPdfBytes( - // _cachedPdfUrl!, - // ), - // // future: loadNetworkPdfBytes(pdfUrl!), - // builder: (context, snapshot) { - // if (!snapshot.hasData) { - // return const Center( - // child: - // CircularProgressIndicator(), - // ); - // } - // - // final pdfBytes = snapshot.data!; - // - // return PdfDocumentLoader.openData( - // pdfBytes, - // documentBuilder: - // ( - // context, - // pdfDocument, - // pageCount, - // ) { - // return ListView.builder( - // itemCount: pageCount, - // itemBuilder: - // (context, index) { - // return Container( - // color: - // Colors.black12, - // child: PdfPageView( - // pdfDocument: - // pdfDocument, - // pageNumber: - // index + 1, - // ), - // ); - // }, - // ); - // }, - // ); - // }, - // ), - // ), + ], ), ), @@ -1854,563 +1788,547 @@ class _policyValidationState extends ConsumerState { // RIGHT - Grouped Form Expanded( flex: 1, - child: SelectionArea( - child: SingleChildScrollView( - child: Form( - key: _formKey, - autovalidateMode: - AutovalidateMode.onUserInteraction, - child: Card( - elevation: 2, - color: Colors.white, - margin: EdgeInsets.zero, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(16), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - // Policy Details - Card( - elevation: 5, - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - _sectionHeader( - 'Policy Details', - icon: Icons.policy, - ), - SizedBox(height: 10), - Row( - children: [ - Expanded( - child: _buildInput( - 'Policy Number *', - controllers['policyNumber']!, - required: true, - ), + child: SingleChildScrollView( + child: Form( + key: _formKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + // autovalidateMode: AutovalidateMode.disabled, + child: Card( + elevation: 2, + color: Colors.white, + margin: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + // Policy Details + Card( + elevation: 5, + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + _sectionHeader( + 'Policy Details', + icon: Icons.policy, + ), + SizedBox(height: 10), + Row( + children: [ + Expanded( + child: _buildInput( + 'Policy Number *', + controllers['policyNumber']!, + required: true, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Insured Name *', - controllers['insuredName']!, - required: true, - ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Insured Name *', + controllers['insuredName']!, + required: true, ), - ], - ), - Row( - children: [ - Expanded( - child: _buildInput( - 'Issued Date *', + ), + ], + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'Issued Date *', + controllers['issuedDate']!, + readOnly: true, + required: true, + onTap: () => _pickDate( controllers['issuedDate']!, - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['issuedDate']!, - context, - ), + context, ), ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Start Date *', + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Start Date *', + controllers['startDate']!, + + readOnly: true, + required: true, + onTap: () => _pickDate( controllers['startDate']!, - - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['startDate']!, - context, - ), + context, ), ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'End Date *', + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'End Date *', + controllers['endDate']!, + readOnly: true, + required: true, + onTap: () => _pickDate( controllers['endDate']!, - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['endDate']!, - context, - ), + context, ), ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Premium Amount *', - controllers['premiumAmount']!, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Premium Amount *', + controllers['premiumAmount']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - ], - ), - // Row( - // children: [ - // Expanded( - // child: _buildInput( - // 'Premium Amount *', - // controllers['premiumAmount']!, - // - // required: true, - // keyboardType: - // TextInputType.numberWithOptions( - // decimal: true, - // ), - // inputFormatters: - // decimalFormatter, - // ), - // ), - // const SizedBox(width: 8), - // // Expanded( - // // child: _buildInput( - // // 'Remarks *', - // // required: false, - // // controllers['remarks']!, - // // ), - // // ), - // ], - // ), - ], - ), + ), + ], + ), + Row( + children: [ + Expanded( + child: buildVehicleTypeAsPerEnquiry( + context, + ), + ), + ], + ) + ], ), ), + ), - const SizedBox(height: 7), + const SizedBox(height: 7), - // Tax Details - Card( - elevation: 5, - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - _sectionHeader( - 'Tax / Cover Details *', - icon: Icons.attach_money, - ), - SizedBox(height: 10), - Row( - children: [ - Expanded( - child: _buildInput( - 'TP *', - controllers['tp']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + // Tax Details + Card( + elevation: 5, + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + _sectionHeader( + 'Tax / Cover Details *', + icon: Icons.attach_money, + ), + SizedBox(height: 10), + Row( + children: [ + Expanded( + child: _buildInput( + 'TP *', + controllers['tp']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'OD *', - controllers['od']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'OD *', + controllers['od']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'PA *', - controllers['pa']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'PA *', + controllers['pa']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - ], - ), - Row( - children: [ - Expanded( - child: _buildInput( - 'CGST *', - controllers['cgst']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + ), + ], + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'CGST *', + controllers['cgst']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'SGST *', - controllers['sgst']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'SGST *', + controllers['sgst']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'IGST *', - controllers['igst']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'IGST *', + controllers['igst']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - ], - ), - ], - ), + ), + ], + ), + Row( + children:[ + Expanded( + child: buildPaymentMode( + context, + ), + ),] + ), + ], ), ), + ), - const SizedBox(height: 7), + const SizedBox(height: 7), - // Vehicle Details - Card( - elevation: 5, - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - _sectionHeader( - 'Vehicle Details', - icon: Icons.directions_car, - ), - SizedBox(height: 10), - Row( - children: [ - Expanded( - child: _buildInput( - 'Reg No *', - controllers['enquiry_reg_no_for_commission']!, - required: true, - ), - ), - ] - ), - Row( + // Vehicle Details + Card( + elevation: 5, + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + _sectionHeader( + 'Vehicle Details', + icon: Icons.directions_car, + ), + SizedBox(height: 10), + Row( children: [ Expanded( child: _buildInput( - 'RTO State Name *', - controllers['rtoStateCode']!, + 'Reg No *', + controllers['enquiry_reg_no_for_commission']!, required: true, ), ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'RTO City Code *', - controllers['rtoCityCode']!, - required: true, - keyboardType: - TextInputType.number, - inputFormatters: - digitsOnlyFormatter, - ), + ] + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'RTO State Name *', + controllers['rtoStateCode']!, + required: true, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Weight *', - controllers['weight']!, - required: true, - keyboardType: - TextInputType.number, - inputFormatters: - digitsOnlyFormatter, - ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'RTO City Code *', + controllers['rtoCityCode']!, + required: true, + keyboardType: + TextInputType.number, + inputFormatters: + digitsOnlyFormatter, ), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - child: buildFuelType(context), - // child: _buildInput( - // 'Fuel Type', - // controllers['fuelType']!, - // required: true, - // ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Weight *', + controllers['weight']!, + required: false, + keyboardType: + TextInputType.number, + inputFormatters: + digitsOnlyFormatter, ), - const SizedBox(width: 8), - // Expanded( - // child: _buildInput( - // 'Date of Registration *', - // controllers['dateOfRegistration']!, - // required: true, - // readOnly: true, - // onTap: () => _pickDate( - // controllers['dateOfRegistration']!, - // context, - // ), - // ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: buildFuelType(context), + // child: _buildInput( + // 'Fuel Type', + // controllers['fuelType']!, + // required: true, // ), - Expanded( - child: _buildInput( - 'Date of Registration *', - controllers['dateOfRegistration']!, - required: true, - keyboardType: TextInputType.number, - hintText: 'DD-MM-YYYY', - inputFormatters: [ - LengthLimitingTextInputFormatter(10), // DD-MM-YYYY - DateInputFormatter(), - ], - ), + ), + const SizedBox(width: 8), + // Expanded( + // child: _buildInput( + // 'Date of Registration *', + // controllers['dateOfRegistration']!, + // required: true, + // readOnly: true, + // onTap: () => _pickDate( + // controllers['dateOfRegistration']!, + // context, + // ), + // ), + // ), + Expanded( + child: _buildInput( + 'Date of Registration *', + controllers['dateOfRegistration']!, + required: true, + keyboardType: TextInputType.number, + hintText: 'DD-MM-YYYY', + inputFormatters: [ + LengthLimitingTextInputFormatter(10), // DD-MM-YYYY + DateInputFormatter(), + ], ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Year of Manufacture *', - controllers['yearOfManufacture']!, - required: true, - keyboardType: - TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter - .digitsOnly, // only numbers - LengthLimitingTextInputFormatter( - 4, - ), // max 4 digits - ], - ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Year of Manufacture *', + controllers['yearOfManufacture']!, + required: true, + keyboardType: + TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly, // only numbers + LengthLimitingTextInputFormatter( + 4, + ), // max 4 digits + ], ), - ], - ), - Row( - children: [ - Expanded( + ), + ], + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'Engine No *', + controllers['engineNo']!, + required: true, + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Chassis No *', + controllers['chassisNo']!, + required: true, + ), + ), + const SizedBox(width: 8), + Expanded( + child: Expanded( child: _buildInput( - 'Engine No *', - controllers['engineNo']!, + 'Make *', + controllers['make']!, required: true, ), ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Chassis No *', - controllers['chassisNo']!, - required: true, - ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: _buildInput( + 'Model *', + controllers['model']!, + required: true, ), - const SizedBox(width: 8), - Expanded( - child: Expanded( - child: _buildInput( - 'Make *', - controllers['make']!, - required: true, - ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Cubic Capacity *', + controllers['cubicCapacity']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, ), + inputFormatters: + decimalFormatter, ), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - child: _buildInput( - 'Model *', - controllers['model']!, - required: true, - ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + // child: _buildInput( + // 'Vehicle Type', + // controllers['vehicleType']!, + // required: true, + // ), + child: buildVehicleType( + context, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Cubic Capacity *', - controllers['cubicCapacity']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, - ), - ), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - // child: _buildInput( - // 'Vehicle Type', - // controllers['vehicleType']!, - // required: true, - // ), - child: buildVehicleType( - context, - ), - ), - const SizedBox(width: 8), - Expanded( - child: buildVehicleTypeAsPerEnquiry( - context, - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), - const SizedBox(height: 7), + ), + const SizedBox(height: 7), - // Broker Details - Card( - elevation: 5, - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - _sectionHeader( - 'Broker / Commission', - icon: Icons.person, - ), - SizedBox(height: 10), - Row( - children: [ - Expanded(child:buildBrokerAsPerEnquiry(context)), - const SizedBox(width: 8), - ], - ), - Row( - children: [ - Expanded( - child: _buildInput( - 'Broker (as per Document) *', - controllers['broker_name']!, - required: true, - ), + // Broker Details + Card( + elevation: 5, + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + _sectionHeader( + 'Broker / Commission', + icon: Icons.person, + ), + SizedBox(height: 10), + Row( + children: [ + Expanded(child:buildBrokerAsPerEnquiry(context)), + const SizedBox(width: 8), + Expanded(child:buildInsurancPlanType(context)), + ], + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'Broker (as per Document) *', + controllers['broker_name']!, + required: true, ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Commission Amount *', - controllers['commission_amount']!, - required: false, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Commission Amount *', + controllers['commission_amount']!, + required: false, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, + ), + inputFormatters: decimalFormatter, + // onChanged: (_) => setState(() {}), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment + .end, // Pushes children to the right + children: [ + TextButton( + onPressed: + (widget.item?['is_data_accuracy_checked'] == + '1' || + isLoading) + ? null // Disable if already checked or currently loading + : _fetchCommision, + child: Text( + isLoading + ? "Calculating..." + : "Calculate", + style: TextStyle( + color: + (widget.item?['is_data_accuracy_checked'] == + '1' || + isLoading) + ? Colors.grey + : const Color( + 0xFF2E7D6E, ), - inputFormatters: - decimalFormatter, + fontWeight: + FontWeight.bold, ), ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment - .end, // Pushes children to the right - children: [ - TextButton( - onPressed: - (widget.item?['is_data_accuracy_checked'] == - '1' || - isLoading) - ? null // Disable if already checked or currently loading - : _fetchCommision, - child: Text( - isLoading - ? "Calculating..." - : "Calculate", - style: TextStyle( - color: - (widget.item?['is_data_accuracy_checked'] == - '1' || - isLoading) - ? Colors.grey - : const Color( - 0xFF2E7D6E, - ), - fontWeight: - FontWeight.bold, - ), - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), + ), - const SizedBox( - height: 20, - ), // spacing above fixed button - ], - ), + const SizedBox( + height: 20, + ), // spacing above fixed button + ], ), ), ), @@ -2433,41 +2351,7 @@ class _policyValidationState extends ConsumerState { fontWeight: FontWeight.w500, ); } -// class DateInputFormatter extends TextInputFormatter { -// @override -// TextEditingValue formatEditUpdate( -// TextEditingValue oldValue, -// TextEditingValue newValue, -// ) { -// // Allow backspace -// if (newValue.text.length < oldValue.text.length) { -// return newValue; -// } -// -// // Allow ONLY digits -// String digits = newValue.text.replaceAll(RegExp(r'[^0-9]'), ''); -// -// if (digits.length > 8) { -// digits = digits.substring(0, 8); -// } -// -// StringBuffer formatted = StringBuffer(); -// -// for (int i = 0; i < digits.length; i++) { -// if (i == 2 || i == 4) { -// formatted.write('-'); -// } -// formatted.write(digits[i]); -// } -// -// return TextEditingValue( -// text: formatted.toString(), -// selection: TextSelection.collapsed( -// offset: formatted.length, -// ), -// ); -// } -// } + class DateInputFormatter extends TextInputFormatter { @override TextEditingValue formatEditUpdate( diff --git a/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart b/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart index e704fe8..2f30808 100644 --- a/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart +++ b/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart @@ -187,6 +187,11 @@ class _DateFilterRowState extends ConsumerState { buildSelectStaffMem(context), SizedBox(width: spacing), ], + if (widget.role == 'Accounts' && widget.dataFrom == 'Policy') ...[ + buildPolicyReportFlagSearch(context), + SizedBox(width: spacing), + ], + ]; final buttons = [ @@ -480,6 +485,142 @@ class _DateFilterRowState extends ConsumerState { ); } + Widget buildPolicyReportFlagSearch(BuildContext context) { + + final List> policyReportStatusOptions; + + policyReportStatusOptions = [ + {'id': 'All', 'status': 'All'}, + {'id': 'Verified', 'status': 'Verified'}, + {'id': 'Not Verified', 'status': 'Not Verified'}, + ]; + + Map? selectedPolicyReportStatusMap = policyReportStatusOptions + .where((element) => element['status'] == widget.selectedStatusVal) + .cast>() + .toList() + .firstOrNull; + + Map? selectedItem = policyReportStatusOptions + .cast>() + .firstWhere( + (e) => e['status'] == widget.selectedStatusVal, + orElse: () => {}, // return empty map + ); + + if (selectedItem.isEmpty) selectedItem = null; + // Map? selectedStatus; // ✅ Default: no selection + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Text('Status', style: _textStyle), + // SizedBox(height: 5), + SizedBox( + height: 35, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all(color: Color(0xFFE2E8F0)), + // color: Colors.black, + ), + width: ResponsiveLayout.isMobile(context) + ? null + : MediaQuery.of(context).size.width * 0.14, + child: DropdownSearch>( + // selectedItem: selectedStatus, + selectedItem: selectedPolicyReportStatusMap, + // selectedItem: policyReportStatusOptions.firstWhere( + // (element) => element['status'] == selectedStatusVal, + // orElse: () => null, // ✅ return null if not found + // ), + items: (filter, infiniteScrollProps) => policyReportStatusOptions, + + itemAsString: (val) => val['status'].toString(), + compareFn: (item, selectedItem) => + item['status'] == selectedItem['status'], + + dropdownBuilder: (context, selectedItem) => Align( + alignment: Alignment.centerLeft, + + child: Text( + selectedItem != null ? selectedItem['status'].toString() : "", + style: GoogleFonts.poppins(fontSize: 11, color: Colors.black), + overflow: TextOverflow.ellipsis, + maxLines: 1, + softWrap: false, + ), + ), + + // validator: (val) { + // if (val == null) { + // return "Please select a status"; + // } + // return null; + // }, + decoratorProps: DropDownDecoratorProps( + decoration: + AppInputDecorations.dropdownDecoration( + label: "Select Policy Status", + ).copyWith( + filled: true, + fillColor: Colors.white, + isDense: true, // 👈 reduces built-in vertical padding + + contentPadding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 1, // 👈 adjust this to make the field shorter + ), + ), + ), + // popupProps: PopupProps.menu( + // fit: FlexFit.loose, + // constraints: BoxConstraints(maxHeight: 200), + // menuProps: MenuProps(backgroundColor: Colors.white), + // showSearchBox: false, // 👈 no search box since it's static + // + // ), + popupProps: PopupProps.menu( + fit: FlexFit.loose, + constraints: const BoxConstraints(maxHeight: 200), + menuProps: const MenuProps(backgroundColor: Colors.white), + showSearchBox: false, + + itemBuilder: (context, item, isDisabled, isSelected) { + // ✅ 4 parameters + return Container( + // color: isSelected ? Colors.blue.withOpacity(0.1) : null, + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + child: Text( + item['status'].toString(), + style: GoogleFonts.inter( + fontSize: 13, + color: Colors.black, + ), + ), + ); + }, + ), + + onChanged: (val) { + if (val != null) { + print("Selected Status: ${val['status']}"); + if (widget.onStatusChanged != null) + widget.onStatusChanged!(val['status']); + + Future.microtask(() => widget.onFilter()); + } + }, + ), + ), + ), + ], + ); + } + Widget buildSelectStaffMem(BuildContext context) { // Map? selectedVehicle = filteredStaffData.firstWhere( // (item) => item['id'].toString() == selectedStaff, diff --git a/macos/Podfile b/macos/Podfile index 29c8eb3..ff5ddb3 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.14' +platform :osx, '10.15' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 325793d..442dc25 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,42 +1,261 @@ PODS: + - AppAuth (2.0.0): + - AppAuth/Core (= 2.0.0) + - AppAuth/ExternalUserAgent (= 2.0.0) + - AppAuth/Core (2.0.0) + - AppAuth/ExternalUserAgent (2.0.0): + - AppAuth/Core + - AppCheckCore (11.2.0): + - GoogleUtilities/Environment (~> 8.0) + - GoogleUtilities/UserDefaults (~> 8.0) + - PromisesObjC (~> 2.4) - connectivity_plus (0.0.1): - FlutterMacOS + - device_info_plus (0.0.1): + - FlutterMacOS + - file_picker (0.0.1): + - FlutterMacOS + - Firebase/Auth (12.4.0): + - Firebase/CoreOnly + - FirebaseAuth (~> 12.4.0) + - Firebase/CoreOnly (12.4.0): + - FirebaseCore (~> 12.4.0) + - Firebase/Messaging (12.4.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 12.4.0) + - firebase_auth (6.1.2): + - Firebase/Auth (~> 12.4.0) + - Firebase/CoreOnly (~> 12.4.0) + - firebase_core + - FlutterMacOS + - firebase_core (4.2.1): + - Firebase/CoreOnly (~> 12.4.0) + - FlutterMacOS + - firebase_messaging (16.0.4): + - Firebase/CoreOnly (~> 12.4.0) + - Firebase/Messaging (~> 12.4.0) + - firebase_core + - FlutterMacOS + - FirebaseAppCheckInterop (12.4.0) + - FirebaseAuth (12.4.0): + - FirebaseAppCheckInterop (~> 12.4.0) + - FirebaseAuthInterop (~> 12.4.0) + - FirebaseCore (~> 12.4.0) + - FirebaseCoreExtension (~> 12.4.0) + - GoogleUtilities/AppDelegateSwizzler (~> 8.1) + - GoogleUtilities/Environment (~> 8.1) + - GTMSessionFetcher/Core (< 6.0, >= 3.4) + - RecaptchaInterop (~> 101.0) + - FirebaseAuthInterop (12.4.0) + - FirebaseCore (12.4.0): + - FirebaseCoreInternal (~> 12.4.0) + - GoogleUtilities/Environment (~> 8.1) + - GoogleUtilities/Logger (~> 8.1) + - FirebaseCoreExtension (12.4.0): + - FirebaseCore (~> 12.4.0) + - FirebaseCoreInternal (12.4.0): + - "GoogleUtilities/NSData+zlib (~> 8.1)" + - FirebaseInstallations (12.4.0): + - FirebaseCore (~> 12.4.0) + - GoogleUtilities/Environment (~> 8.1) + - GoogleUtilities/UserDefaults (~> 8.1) + - PromisesObjC (~> 2.4) + - FirebaseMessaging (12.4.0): + - FirebaseCore (~> 12.4.0) + - FirebaseInstallations (~> 12.4.0) + - GoogleDataTransport (~> 10.1) + - GoogleUtilities/AppDelegateSwizzler (~> 8.1) + - GoogleUtilities/Environment (~> 8.1) + - GoogleUtilities/Reachability (~> 8.1) + - GoogleUtilities/UserDefaults (~> 8.1) + - nanopb (~> 3.30910.0) - flutter_secure_storage_macos (6.1.3): - FlutterMacOS - FlutterMacOS (1.0.0) + - google_sign_in_ios (0.0.1): + - Flutter + - FlutterMacOS + - GoogleSignIn (~> 9.0) + - GTMSessionFetcher (>= 3.4.0) + - GoogleDataTransport (10.1.0): + - nanopb (~> 3.30910.0) + - PromisesObjC (~> 2.4) + - GoogleSignIn (9.0.0): + - AppAuth (~> 2.0) + - AppCheckCore (~> 11.0) + - GTMAppAuth (~> 5.0) + - GTMSessionFetcher/Core (~> 3.3) + - GoogleUtilities/AppDelegateSwizzler (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Privacy + - GoogleUtilities/Environment (8.1.0): + - GoogleUtilities/Privacy + - GoogleUtilities/Logger (8.1.0): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - GoogleUtilities/Network (8.1.0): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Privacy + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (8.1.0)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (8.1.0) + - GoogleUtilities/Reachability (8.1.0): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GoogleUtilities/UserDefaults (8.1.0): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GTMAppAuth (5.0.0): + - AppAuth/Core (~> 2.0) + - GTMSessionFetcher/Core (< 4.0, >= 3.3) + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): + - GTMSessionFetcher/Core + - local_auth_darwin (0.0.1): + - Flutter + - FlutterMacOS + - nanopb (3.30910.0): + - nanopb/decode (= 3.30910.0) + - nanopb/encode (= 3.30910.0) + - nanopb/decode (3.30910.0) + - nanopb/encode (3.30910.0) + - open_file_mac (0.0.1): + - FlutterMacOS + - package_info_plus (0.0.1): + - FlutterMacOS - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS + - pdf_render (0.0.1): + - FlutterMacOS + - PromisesObjC (2.4.0) - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - syncfusion_pdfviewer_macos (0.0.1): + - FlutterMacOS + - url_launcher_macos (0.0.1): + - FlutterMacOS DEPENDENCIES: - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) + - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) + - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) + - firebase_auth (from `Flutter/ephemeral/.symlinks/plugins/firebase_auth/macos`) + - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) + - firebase_messaging (from `Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos`) - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) + - google_sign_in_ios (from `Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin`) + - local_auth_darwin (from `Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin`) + - open_file_mac (from `Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos`) + - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - pdf_render (from `Flutter/ephemeral/.symlinks/plugins/pdf_render/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) + - syncfusion_pdfviewer_macos (from `Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos`) + - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) + +SPEC REPOS: + trunk: + - AppAuth + - AppCheckCore + - Firebase + - FirebaseAppCheckInterop + - FirebaseAuth + - FirebaseAuthInterop + - FirebaseCore + - FirebaseCoreExtension + - FirebaseCoreInternal + - FirebaseInstallations + - FirebaseMessaging + - GoogleDataTransport + - GoogleSignIn + - GoogleUtilities + - GTMAppAuth + - GTMSessionFetcher + - nanopb + - PromisesObjC EXTERNAL SOURCES: connectivity_plus: :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos + device_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos + file_picker: + :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos + firebase_auth: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_auth/macos + firebase_core: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos + firebase_messaging: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos flutter_secure_storage_macos: :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos FlutterMacOS: :path: Flutter/ephemeral + google_sign_in_ios: + :path: Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin + local_auth_darwin: + :path: Flutter/ephemeral/.symlinks/plugins/local_auth_darwin/darwin + open_file_mac: + :path: Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos + package_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + pdf_render: + :path: Flutter/ephemeral/.symlinks/plugins/pdf_render/macos shared_preferences_foundation: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin + syncfusion_pdfviewer_macos: + :path: Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos + url_launcher_macos: + :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: + AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063 + AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f connectivity_plus: 4adf20a405e25b42b9c9f87feff8f4b6fde18a4e + device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 + file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a + Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e + firebase_auth: 87ea88759d0282ccf1e2afe96f88ff3c07547938 + firebase_core: e054894ab56033ef9bcbe2d9eac9395e5306e2fc + firebase_messaging: 373ac3a56e5aa37bb9aff4127f700aa5973c1168 + FirebaseAppCheckInterop: f734c802f21fe1da0837708f0f9a27218c8a4ed0 + FirebaseAuth: 4a2aed737c84114a9d9b33d11ae1b147d6b94889 + FirebaseAuthInterop: 858e6b754966e70740a4370dd1503dfffe6dbb49 + FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3 + FirebaseCoreExtension: 7e1f7118ee970e001a8013719fb90950ee5e0018 + FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6 + FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2 + FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5 flutter_secure_storage_macos: 7f45e30f838cf2659862a4e4e3ee1c347c2b3b54 - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + google_sign_in_ios: 205742c688aea0e64db9da03c33121694a365109 + GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 + GoogleSignIn: c7f09cfbc85a1abf69187be091997c317cc33b77 + GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 + GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238 + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19 + nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 + open_file_mac: 01874b6d6a2c1485ac9b126d7105b99102dea2cf + package_info_plus: f0052d280d17aa382b932f399edf32507174e870 path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + pdf_render: 97e703cf7cd7122ab240825e8c99dc0616c5123c + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 + syncfusion_pdfviewer_macos: b3b110c68039178ca4105dd03ef38761eca3b36b + url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673 -PODFILE CHECKSUM: 7eb978b976557c8c1cd717d8185ec483fd090a82 +PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 COCOAPODS: 1.16.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 355b0f9..1833296 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -241,6 +241,7 @@ 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, 67721E8F298A2F647E244CBA /* [CP] Embed Pods Frameworks */, + 82AA3A8A3181F6A9D1E2499E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -378,6 +379,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 82AA3A8A3181F6A9D1E2499E /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; E94A1CE8DCEF40365836C7DF /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -557,7 +575,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -639,7 +657,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -689,7 +707,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/pubspec.lock b/pubspec.lock index d77ec7b..abbeba9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -700,26 +700,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -1297,10 +1297,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" toastification: dependency: "direct main" description: @@ -1417,10 +1417,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: diff --git a/web/index.html b/web/index.html index 3975e71..5a7d254 100644 --- a/web/index.html +++ b/web/index.html @@ -15,8 +15,8 @@ the `--base-href` argument provided to `flutter build`. --> - - + +