diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 7dd2a82..54682a0 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-09 12:30:20.384299","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"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 diff --git a/lib/presentation/screens/UserManagement/Agent/agent.dart b/lib/presentation/screens/UserManagement/Agent/agent.dart index 2311bb0..115d940 100644 --- a/lib/presentation/screens/UserManagement/Agent/agent.dart +++ b/lib/presentation/screens/UserManagement/Agent/agent.dart @@ -607,7 +607,7 @@ class AgentState extends ConsumerState { validator: (value) => Validators.requiredField(value, "name"), inputFormatters: [ // This line now allows letters, numbers, hyphens, and underscores - FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z0-9\-_]')), + FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z0-9\-_ ]')), ], borderColor: Color(0xFFE2E8F0), highlightColor: Color(0xFF50A398), diff --git a/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart b/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart index 69b3954..de7dce2 100644 --- a/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart +++ b/lib/presentation/screens/staff/Enquiry/raise_enq_form.dart @@ -55,7 +55,7 @@ class RaiseEnqFormState extends ConsumerState { ]; List> getVehicleTypeData = []; - List> filteredVechicleData = []; + List> filteredVehicleData = []; List> getAgentListData = []; List> filteredAgentData = []; @@ -73,6 +73,10 @@ class RaiseEnqFormState extends ConsumerState { dropDownSelectStaffKey = GlobalKey>>(); + final GlobalKey>> + dropDownSelectVehicleTypeKey = + GlobalKey>>(); + final GlobalKey>> dropDownKey = GlobalKey>>(); final GlobalKey>> @@ -232,12 +236,12 @@ class RaiseEnqFormState extends ConsumerState { ); print('API Data - $getVehicleTypeData'); - filteredVechicleData = List.from(getVehicleTypeData); - print('originalData - $filteredVechicleData'); + filteredVehicleData = List.from(getVehicleTypeData); + print('originalData - $filteredVehicleData'); }); } else { getVehicleTypeData = []; - filteredVechicleData = []; + filteredVehicleData = []; } } catch (e) { print('Exception occurred: $e'); @@ -310,6 +314,7 @@ class RaiseEnqFormState extends ConsumerState { } } + Future getAgentList(id) async { print('getAgentListData called'); setState(() { @@ -419,7 +424,7 @@ class RaiseEnqFormState extends ConsumerState { buildAgentName(context, fromHeader: true), buildBroker(context), buildInsurer(context, fromHeader: true), - + buildVehicleType(context), // buildInsuredName(context, fromHeader: true), buildVehicleNumber(context), Row( @@ -1242,6 +1247,153 @@ class RaiseEnqFormState extends ConsumerState { ); } + Widget buildVehicleType(BuildContext context) { + Map? selectedVehicleTypes = filteredVehicleData.firstWhere( + (item) => item['id'].toString() == selectedVehicleType, + orElse: () => {}, + ); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Vehicle Type *', style: _subLabelTimeStyle), + SizedBox(height: 5), + SizedBox( + // height: 30, + width: MediaQuery.of(context).size.width * 0.12, + child: DropdownSearch>( + key: dropDownSelectVehicleTypeKey, + selectedItem: selectedVehicleTypes.isNotEmpty ? selectedVehicleTypes : null, + items: (filter, infiniteScrollProps) { + return filteredVehicleData; + }, + + itemAsString: (val) => val['vehicle_type'].toString(), // what to show + compareFn: (item, selectedItem) => + item['vehicle_type'].toString() == selectedItem['vehicle_type'].toString(), + validator: (val) { + if (val == null) { + return "Required"; // ✅ error message + } + return null; + }, + suffixProps: DropdownSuffixProps( + // make sure the dropdown button is visible + dropdownButtonProps: DropdownButtonProps( + isVisible: true, + padding: EdgeInsets.zero, // remove default padding + constraints: const BoxConstraints( + // shrink icon tap area + minWidth: 12, + minHeight: 12, + ), + iconSize: 15, // smaller icon + // icon: const Icon(Icons.arrow_drop_down), + ), + ), + dropdownBuilder: (context, selectedItem) => Align( + alignment: Alignment.centerLeft, + child: Text( + selectedItem != null ? selectedItem['vehicle_type'].toString() : "", + style: GoogleFonts.poppins(fontSize: 11, color: Colors.black), + overflow: TextOverflow.ellipsis, + maxLines: 1, + softWrap: false, + ), + ), + decoratorProps: DropDownDecoratorProps( + decoration: + AppInputDecorations.dropdownDecoration( + label: "Select Vehicle Type", + ).copyWith( + filled: true, + fillColor: + Colors.white, // 👈 makes the dropdown input white + isDense: true, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(5), + borderSide: const BorderSide( + color: Color(0xFFE2E8F0), + width: 0.5, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(5), + borderSide: const BorderSide( + color: Color(0xFFE2E8F0), + width: 0.5, + ), + ), + contentPadding: EdgeInsets.symmetric( + horizontal: 8, + vertical: 6, + ), + ), + ), + + popupProps: PopupProps.menu( + fit: FlexFit.loose, + constraints: BoxConstraints(maxHeight: 250), + menuProps: MenuProps( + backgroundColor: + Colors.white, // 👈 sets dropdown background to white + ), + showSearchBox: true, + searchFieldProps: TextFieldProps( + autofocus: true, + style: GoogleFonts.inter(fontSize: 11, color: Colors.black), + decoration: InputDecoration( + contentPadding: EdgeInsets.all(1), + filled: true, + fillColor: Colors.white, + hintText: "Search Vehicle Type...", + hintStyle: GoogleFonts.inter( + fontSize: 12, + color: Colors.black, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.white, + ), // 👈 Normal border + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.white, + width: 1.5, + ), // 👈 Focused border + ), + ), + ), + + itemBuilder: (context, item, isDisabled, isSelected) { + return Container( + // color: isSelected ? Colors.blue.withOpacity(0.1) : null, + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 3, + ), + child: Text( + item['vehicle_type'].toString(), + style: GoogleFonts.inter(fontSize: 12, color: Colors.black), + ), + ); + }, + // constraints: BoxConstraints(), + ), + + onChanged: (val) { + if (val != null) { + // print("Selected vehicletype : ${val['vehicle_type']}"); + // print("Id: ${val['id']}"); + // print("Value: ${val}"); + selectedVehicleType = val['id']; + } + }, + ), + ), + ], + ); + } + Widget buildSave(context) { return InkWell( onTap: () { @@ -1303,6 +1455,7 @@ class RaiseEnqFormState extends ConsumerState { dropDownKeyAgent.currentState?.clear(); dropDownKeyInsurerEnqAsgn.currentState?.clear(); dropDownSelectStaffKey.currentState?.clear(); + dropDownSelectVehicleTypeKey.currentState?.clear(); dropDownKeyInsurer.currentState?.clear(); dropDownKey.currentState?.clear(); dropDownKeyBroker.currentState?.clear(); diff --git a/lib/presentation/screens/staff/Enquiry/tabs/policyTab.dart b/lib/presentation/screens/staff/Enquiry/tabs/policyTab.dart index 2f345a1..a9e59a8 100644 --- a/lib/presentation/screens/staff/Enquiry/tabs/policyTab.dart +++ b/lib/presentation/screens/staff/Enquiry/tabs/policyTab.dart @@ -1331,7 +1331,7 @@ class PolicyStaffTabState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('Vehicle Number*', style: _textStyle), + Text('Vehicle Number *', style: _textStyle), SizedBox(height: 10), ThemedFormField( controller: controllers['regNum']!, diff --git a/lib/presentation/screens/staff/policy/policy.dart b/lib/presentation/screens/staff/policy/policy.dart index 2d3d7cd..79d406c 100644 --- a/lib/presentation/screens/staff/policy/policy.dart +++ b/lib/presentation/screens/staff/policy/policy.dart @@ -973,7 +973,7 @@ class PolicyScreenState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('Vehicle Number*', style: _textStyle), + Text('Vehicle Number *', style: _textStyle), SizedBox(height: 10), ThemedFormField( controller: controllers['regNum']!, diff --git a/lib/presentation/screens/staff/policy/policy_validation.dart b/lib/presentation/screens/staff/policy/policy_validation.dart index 2111cde..6afa6a2 100644 --- a/lib/presentation/screens/staff/policy/policy_validation.dart +++ b/lib/presentation/screens/staff/policy/policy_validation.dart @@ -79,6 +79,7 @@ class _policyValidationState extends ConsumerState { 'chassisNo', 'make', 'model', + // 'cubic_capacity', // Ensure this matches your dataDetails call 'cubicCapacity', 'vehicleType', @@ -86,6 +87,11 @@ class _policyValidationState extends ConsumerState { 'broker_name', 'commission_amount', + // Enquiry + 'enquiry_broker_id_for_commission', + 'enquiry_reg_no_for_commission', + 'enquiry_vehicle_type_id_for_commission', + //find Policy 'insurance_plan_type', ]; @@ -101,17 +107,38 @@ class _policyValidationState extends ConsumerState { List getFuelTypeData = []; List filteredFuelTypeData = []; + List> getBrokerData = []; + List> filteredBrokerData = []; + + List> getInsurancPlanTypeData = []; + List> filteredInsurancPlanTypeData = []; + + List> getVehicleTypeForEnquiryData = []; + List> filteredVehicleDataForEnquiryData = []; + final GlobalKey _pdfViewerKey = GlobalKey(); final _formKey = GlobalKey(); + String? selectedVehicleTypeForEnquiryID; + String? selectedVehicleTypeForEnquiryVAL; String? selectedVehicleType; String? selectedFuelType; + String? selectedBroker; final GlobalKey>> dropDownKey = - GlobalKey>>(); + GlobalKey>>(); final GlobalKey>> dropDownKeyFuel = - GlobalKey>>(); + GlobalKey>>(); + + final GlobalKey>> dropDownKeyBroker = + GlobalKey>>(); + + final GlobalKey>> dropDownKeyVehicleTypeForEnquiry = + GlobalKey>>(); + + final GlobalKey>> dropDownKeyInsurancPlanType = + GlobalKey>>(); bool _hasLoadedInitialData = false; @@ -165,13 +192,11 @@ class _policyValidationState extends ConsumerState { ? null : controllers["fuelType"]?.text, - "date_of_registration": - controllers["dateOfRegistration"]?.text?.isEmpty ?? true + "date_of_registration": controllers["dateOfRegistration"]?.text?.isEmpty ?? true ? null : controllers["dateOfRegistration"]?.text, - "year_of_manufacture": - controllers["yearOfManufacture"]?.text.isEmpty ?? true + "year_of_manufacture": controllers["yearOfManufacture"]?.text.isEmpty ?? true ? null : controllers["yearOfManufacture"]?.text, @@ -196,15 +221,26 @@ class _policyValidationState extends ConsumerState { : controllers["cubicCapacity"]?.text, "vehicle_type": controllers["vehicleType"]?.text?.isEmpty ?? true - ? null + ? selectedVehicleTypeForEnquiryVAL : controllers["vehicleType"]?.text, "broker_name": controllers["broker_name"]?.text?.isEmpty ?? true ? null : controllers["broker_name"]?.text, - "commission_amount": - controllers["commission_amount"]?.text?.isEmpty ?? true + "enquiry_broker_id_for_commission": controllers["enquiry_broker_id_for_commission"]?.text?.isEmpty ?? true + ? null + : controllers["enquiry_broker_id_for_commission"]?.text, + + "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, + + "commission_amount": controllers["commission_amount"]?.text?.isEmpty ?? true ? null : controllers["commission_amount"]?.text, }; @@ -215,7 +251,7 @@ class _policyValidationState extends ConsumerState { final policyId = widget.item?['policy_id']; return { - "vehicle_type": data["vehicle_type"], + "vehicle_type": data["vehicle_type"] ?? selectedVehicleTypeForEnquiryVAL, "insurance_plan_type": selectedInsurancPlanType, "premium_amount": data["premium_amount"], "od": data["od"], @@ -236,6 +272,9 @@ class _policyValidationState extends ConsumerState { "manager_retention_rate": selectedManagerRentionRate, "id": policyId, "updated_by": userId, + "enquiry_broker_id_for_commission": selectedBroker, + "enquiry_reg_no_for_commission": data["enquiry_reg_no_for_commission"], + "enquiry_vehicle_type_id_for_commission": selectedVehicleTypeForEnquiryID, }; } @@ -292,6 +331,9 @@ class _policyValidationState extends ConsumerState { getVehicleType(), getFuelType(), getPolicyFilePath(), + getBroker(), + getInsurancPlanType(), + getEnquiryVehicleTypeForCommission() ]); } @@ -315,6 +357,123 @@ class _policyValidationState extends ConsumerState { }); } + Future getBroker() async { + print('getBroker called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.fetchMasterDropDown('Broker'); + + if (response['status'] == 200) { + print('getBroker - ${response['data']}'); + setState(() { + getBrokerData = List>.from(response['data']); + print('API Data - $getBrokerData'); + + filteredBrokerData = List.from(getBrokerData); + print('originalData - $filteredBrokerData'); + }); + } else { + getBrokerData = []; + filteredBrokerData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + Future getInsurancPlanType() async { + print('getInsurancPlanType called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.fetchMasterDropDown('InsuranceType'); + + if (response['status'] == 200) { + print('getPlanType - ${response['data']}'); + setState(() { + getInsurancPlanTypeData = + List>.from(response['data']); + print('API Data - $getInsurancPlanTypeData'); + + filteredInsurancPlanTypeData = + List>.from(getInsurancPlanTypeData); + + print('originalData - $filteredInsurancPlanTypeData'); + }); + } else { + getInsurancPlanTypeData = []; + filteredInsurancPlanTypeData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + Future getEnquiryVehicleTypeForCommission() async { + setState(() => isLoading = true); + + try { + final response = + await apiService.fetchMasterDropDown('vehicleType'); + + if (response['status'] == 200 && response['data'] != null) { + final allData = List>.from(response['data']); + final activeVehicles = allData.where((item) => item['is_active'] == "1").toList(); + + setState(() { + // 2. Assign the full objects + getVehicleTypeForEnquiryData = allData; + filteredVehicleDataForEnquiryData = List.from(activeVehicles); + + // 3. Extract just the names for your String list + getVehicleTypeData = activeVehicles + .map((item) => item['vehicle_type'].toString()) + .toList(); + filteredVehicleTypeData = List.from(getVehicleTypeData); + }); + } else { + + getVehicleTypeForEnquiryData.clear(); + filteredVehicleDataForEnquiryData.clear(); + + getVehicleTypeData.clear(); + 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 { + setState(() => isLoading = false); + } + } + + Future getVehicleType() async { print('getvehicleType called'); setState(() => isLoadingVehicleType = true); @@ -432,11 +591,11 @@ class _policyValidationState extends ConsumerState { if (response != null && response['status'] == 'success') { final data = (response['data'] ?? {}) as Map; - debugPrint('findPolicyApi response1:'); + debugPrint('findPolicyApi response1: '); if (!mounted) return; debugPrint('findPolicyApi response2:'); setState(() { - controllers["policyNumber"]!.text = safeText(data['policy_number']); + 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']); @@ -480,9 +639,13 @@ class _policyValidationState extends ConsumerState { 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']); }); debugPrint('findPolicyApi response3:'); @@ -500,9 +663,9 @@ class _policyValidationState extends ConsumerState { } Future _pickDate( - TextEditingController controller, - BuildContext context, - ) async { + TextEditingController controller, + BuildContext context, + ) async { DateTime initial = DateTime.now(); try { if (controller.text.isNotEmpty) { @@ -524,7 +687,7 @@ class _policyValidationState extends ConsumerState { ); if (picked != null) { controller.text = - "${picked.day.toString().padLeft(2, '0')}-${picked.month.toString().padLeft(2, '0')}-${picked.year}"; + "${picked.day.toString().padLeft(2, '0')}-${picked.month.toString().padLeft(2, '0')}-${picked.year}"; } } @@ -579,7 +742,7 @@ class _policyValidationState extends ConsumerState { // Now safe to do navigation + provider updates final container = ProviderScope.containerOf(context); container.read(policyDataAcurancyRefreshProvider.notifier).state = - true; + true; }); } else { if (!mounted) return; @@ -791,14 +954,13 @@ class _policyValidationState extends ConsumerState { // ToastHelper.showWarningToast(context, 'Exception: $e'); // } // } - Widget buildVehicleType(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Vehicle Type", + "Product (as per Document)", style: GoogleFonts.poppins(fontWeight: FontWeight.w500, fontSize: 11), ), const SizedBox(height: 6), @@ -824,40 +986,40 @@ class _policyValidationState extends ConsumerState { decoratorProps: DropDownDecoratorProps( decoration: - AppInputDecorations.dropdownDecoration( - label: "Select Vehicle Type", - ).copyWith( - filled: true, - fillColor: Colors.white, - isDense: true, + AppInputDecorations.dropdownDecoration( + label: "Select Product", + ).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, - ), + 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( @@ -872,7 +1034,7 @@ class _policyValidationState extends ConsumerState { contentPadding: const EdgeInsets.all(6), filled: true, fillColor: Colors.white, - hintText: "Search Vehicle Type...", + hintText: "Search Product...", hintStyle: GoogleFonts.inter(fontSize: 12, color: Colors.black), enabledBorder: const OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFE2E8F0)), @@ -898,13 +1060,12 @@ class _policyValidationState extends ConsumerState { ], ); } - Widget buildFuelType(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Fuel Type ", + "Fuel Type *", style: GoogleFonts.poppins(fontWeight: FontWeight.w500, fontSize: 11), ), const SizedBox(height: 6), @@ -921,48 +1082,59 @@ class _policyValidationState extends ConsumerState { itemAsString: (val) => val, // 👈 String directly + // validator: (val) { + // if (val == null || val.isEmpty) { + // return ""; // 👈 triggers error border, no text + // } + // return null; + // }, + validator: (val) { if (val == null || val.isEmpty) { - return ""; // 👈 triggers error border, no text + return ""; // Triggers red border for empty + } + // NEW: Also return error if it's a junk value + if (val.startsWith('UN_') || val.toLowerCase().contains('undefined')) { + return "Invalid Selection"; } return null; }, decoratorProps: DropDownDecoratorProps( decoration: - AppInputDecorations.dropdownDecoration( - label: "Select Fuel 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, - ), + AppInputDecorations.dropdownDecoration( + label: "Select Fuel 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( @@ -1003,6 +1175,359 @@ 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) { + final Map? selectedBrokers = + selectedBroker != null + ? filteredBrokerData.firstWhere( + (item) => item['id'].toString() == selectedBroker, + orElse: () => {}, + ) + : null; + + 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, + + items: (filter, _) => filteredBrokerData, + + selectedItem: + selectedBrokers != null && selectedBrokers.isNotEmpty + ? selectedBrokers + : null, + + itemAsString: (item) => item['name'].toString(), + + compareFn: (item1, item2) => + item1['id'].toString() == item2['id'].toString(), + + onChanged: (val) { + if (val != null) { + selectedBroker = val['id'].toString(); + controllers['enquiry_broker_id_for_commission']?.text = + val['id'].toString(); + } + }, + + validator: (val) { + if (val == null) return ""; + return null; + }, + ), + ], + ); + } + Widget buildVehicleTypeAsPerEnquiry(BuildContext context) { + final Map? selectedVehicle = + selectedVehicleTypeForEnquiryID != null + ? filteredVehicleDataForEnquiryData.firstWhere( + (item) => + item['id'].toString() == + selectedVehicleTypeForEnquiryID, + orElse: () => {}, + ) + : null; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Product (as per Enquiry) *", + style: GoogleFonts.poppins( + fontWeight: FontWeight.w500, + fontSize: 11, + ), + ), + const SizedBox(height: 6), + + DropdownSearch>( + key: dropDownKeyVehicleTypeForEnquiry, + + items: (filter, _) => filteredVehicleDataForEnquiryData, + // disabledItemFn: (item) => item['is_active'] == "0", + + compareFn: (a, b) => + a['id'].toString() == b['id'].toString(), + + selectedItem: selectedVehicle != null && selectedVehicle.isNotEmpty + ? selectedVehicle + : null, + itemAsString: (item) => item['vehicle_type'].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['vehicle_type'].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)), + ); + }, + ), + + + onChanged: (val) { + if (val != null) { + selectedVehicleTypeForEnquiryID = val['id'].toString(); // ✅ store ID + selectedVehicleTypeForEnquiryVAL = val['vehicle_type'].toString(); + controllers['enquiry_vehicle_type_id_for_commission']?.text = + val['id'].toString(); + } + }, + + validator: (val) { + if (val == null) return ""; + return null; + }, + ), + ], + ); + } + + // Map? selectedVehicleTypes = filteredVehicleDataForEnquiryData.firstWhere( + // (item) => item['id'].toString() == selectedVehicleTypeForEnquiry, + // orElse: () => {}, + // ); + + + // 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"); + // } + // }, + // ), + // ], + // ); + // } + Widget _sectionHeader(String title, {IconData icon = Icons.info}) { return Container( @@ -1032,14 +1557,15 @@ class _policyValidationState extends ConsumerState { } Widget _buildInput( - String label, - TextEditingController controller, { - TextInputType keyboardType = TextInputType.text, - bool readOnly = false, - VoidCallback? onTap, - bool required = false, - List? inputFormatters, // 👈 ADD THIS - }) { + String label, + TextEditingController controller, { + TextInputType keyboardType = TextInputType.text, + bool readOnly = false, + VoidCallback? onTap, + bool required = false, + String? hintText, + List? inputFormatters, // 👈 ADD THIS + }) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1071,7 +1597,13 @@ class _policyValidationState extends ConsumerState { decoration: InputDecoration( border: OutlineInputBorder(borderRadius: BorderRadius.circular(6)), isDense: true, - + hintText: hintText, + hintStyle: hintText == null + ? null + : GoogleFonts.poppins( + fontSize: 12, + color: Colors.grey, + ), // alignment fix helperText: ' ', helperStyle: const TextStyle(height: 1), @@ -1113,15 +1645,15 @@ class _policyValidationState extends ConsumerState { // ? null // : _save, onPressed: - (widget.item?['is_data_accuracy_checked']?.toString() == - '0' && - ((double.tryParse( - controllers["commission_amount"]?.text ?? - '0', - ) ?? - 0) - .floor() >= - 1)) + (widget.item?['is_data_accuracy_checked']?.toString() == + '0' && + ((double.tryParse( + controllers["commission_amount"]?.text ?? + '0', + ) ?? + 0) + .floor() >= + 1)) ? _save : null, style: ElevatedButton.styleFrom( @@ -1322,521 +1854,563 @@ class _policyValidationState extends ConsumerState { // RIGHT - Grouped Form Expanded( flex: 1, - 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, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Insured Name *', - controllers['insuredName']!, - required: true, - ), - ), - ], - ), - Row( - children: [ - Expanded( - child: _buildInput( - 'Issued Date *', - controllers['issuedDate']!, - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['issuedDate']!, - context, - ), - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Start Date *', - controllers['startDate']!, - - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['startDate']!, - context, - ), - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'End Date *', - controllers['endDate']!, - readOnly: true, - required: true, - onTap: () => _pickDate( - controllers['endDate']!, - context, - ), - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Premium Amount *', - controllers['premiumAmount']!, - - 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']!, - // // ), - // // ), - // ], - // ), - ], + 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), ), - ), - ), - - 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, - ), - ), - 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, - ), - ), - ], - ), - 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( - 'IGST *', - controllers['igst']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, - ), - ), - ], - ), - ], - ), - ), - ), - - 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( - 'RTO State Name *', - controllers['rtoStateCode']!, - required: true, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'RTO City Code *', - controllers['rtoCityCode']!, - required: true, - keyboardType: - TextInputType.number, - inputFormatters: - digitsOnlyFormatter, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Weight *', - controllers['weight']!, - 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( - 'Date of Registration *', - controllers['dateOfRegistration']!, - required: true, - readOnly: true, - onTap: () => _pickDate( - controllers['dateOfRegistration']!, - context, - ), - ), - ), - 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( - 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: 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( - 'Make *', - controllers['make']!, + 'Policy Number *', + controllers['policyNumber']!, required: true, ), ), - ), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - child: _buildInput( - 'Model *', - controllers['model']!, - required: true, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Cubic Capacity *', - controllers['cubicCapacity']!, - required: true, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, - ), - ), - const SizedBox(width: 8), - Expanded( - // child: _buildInput( - // 'Vehicle Type', - // controllers['vehicleType']!, - // required: true, - // ), - child: buildVehicleType( - context, - ), - ), - ], - ), - ], - ), - ), - ), - 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: _buildInput( - 'Broker Name *', - controllers['broker_name']!, - required: true, - ), - ), - const SizedBox(width: 8), - Expanded( - child: _buildInput( - 'Commission Amount *', - controllers['commission_amount']!, - required: false, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, - ), - inputFormatters: - decimalFormatter, - ), - ), - ], - ), - 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(width: 8), + Expanded( + child: _buildInput( + 'Insured Name *', + controllers['insuredName']!, + required: true, ), ), - ), - ], - ), - ], + ], + ), + Row( + children: [ + Expanded( + child: _buildInput( + 'Issued Date *', + controllers['issuedDate']!, + readOnly: true, + required: true, + onTap: () => _pickDate( + controllers['issuedDate']!, + context, + ), + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Start Date *', + controllers['startDate']!, + + readOnly: true, + required: true, + onTap: () => _pickDate( + controllers['startDate']!, + context, + ), + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'End Date *', + controllers['endDate']!, + readOnly: true, + required: true, + onTap: () => _pickDate( + controllers['endDate']!, + context, + ), + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Premium Amount *', + controllers['premiumAmount']!, + + 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']!, + // // ), + // // ), + // ], + // ), + ], + ), ), ), - ), - const SizedBox( - height: 20, - ), // spacing above fixed button - ], + 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, + ), + ), + 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, + ), + ), + ], + ), + 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( + 'IGST *', + controllers['igst']!, + required: true, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, + ), + inputFormatters: + decimalFormatter, + ), + ), + ], + ), + ], + ), + ), + ), + + 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( + children: [ + Expanded( + child: _buildInput( + 'RTO State Name *', + controllers['rtoStateCode']!, + required: true, + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'RTO City Code *', + controllers['rtoCityCode']!, + required: true, + keyboardType: + TextInputType.number, + inputFormatters: + digitsOnlyFormatter, + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Weight *', + controllers['weight']!, + 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( + // '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 + ], + ), + ), + ], + ), + 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( + 'Make *', + controllers['make']!, + required: true, + ), + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: _buildInput( + 'Model *', + controllers['model']!, + 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( + // 'Vehicle Type', + // controllers['vehicleType']!, + // required: true, + // ), + child: buildVehicleType( + context, + ), + ), + const SizedBox(width: 8), + Expanded( + child: buildVehicleTypeAsPerEnquiry( + context, + ), + ), + ], + ), + ], + ), + ), + ), + 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, + ), + ), + const SizedBox(width: 8), + Expanded( + child: _buildInput( + 'Commission Amount *', + controllers['commission_amount']!, + required: false, + keyboardType: + TextInputType.numberWithOptions( + decimal: true, + ), + inputFormatters: + decimalFormatter, + ), + ), + ], + ), + 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 + ], + ), ), ), ), @@ -1859,3 +2433,77 @@ 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( + TextEditingValue oldValue, + TextEditingValue newValue, + ) { + // Backspace allowed + if (newValue.text.length < oldValue.text.length) { + return newValue; + } + + String digits = newValue.text.replaceAll(RegExp(r'[^0-9]'), ''); + + if (digits.length > 8) { + digits = digits.substring(0, 8); + } + + String formatted = ''; + + if (digits.isNotEmpty) { + formatted += digits.substring(0, digits.length.clamp(0, 2)); + } + + if (digits.length >= 2) { + formatted += '-'; + formatted += digits.substring(2, digits.length.clamp(2, 4)); + } + + if (digits.length >= 4) { + formatted += '-'; + formatted += digits.substring(4); + } + + return TextEditingValue( + text: formatted, + selection: TextSelection.collapsed(offset: formatted.length), + ); + } +} \ No newline at end of file