diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index da172c1..02d4352 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.30/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.18/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","dependencies":[],"dev_dependency":false},{"name":"firebase_app_check_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check_web-0.2.0+16/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.0.2/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.1.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.0.1/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.0.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_app_check","dependencies":["firebase_app_check_web","firebase_core"]},{"name":"firebase_app_check_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2025-09-27 12:50:32.972743","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.30/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.18/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check-0.4.0+1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","dependencies":[],"dev_dependency":false},{"name":"firebase_app_check_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_app_check_web-0.2.0+16/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.0.2/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.1.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.0.1/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.0.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_app_check","dependencies":["firebase_app_check_web","firebase_core"]},{"name":"firebase_app_check_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2025-09-30 10:13:26.383609","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/assets/drawer/drawerImg1_light.png b/assets/drawer/drawerImg1_light.png new file mode 100644 index 0000000..c66d6fc Binary files /dev/null and b/assets/drawer/drawerImg1_light.png differ diff --git a/assets/drawer/drawerImg2_light.png b/assets/drawer/drawerImg2_light.png new file mode 100644 index 0000000..b26a0b5 Binary files /dev/null and b/assets/drawer/drawerImg2_light.png differ diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index ccae27a..785a1c4 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -543,7 +543,7 @@ class ApiService { if (_token == null) { await _initializeToken(); } - final url = Uri.parse('${Env.apiUrl}/quotation/findQuotation?id=1=$id'); + final url = Uri.parse('${Env.apiUrl}quotation/findQuotation?id=$id'); final headers = { 'Authorization': 'Bearer $_token' ?? '', 'App-Signature': 'nhance-partner-2025-signature-35468846JRhH551HK', diff --git a/lib/data/services/auth_service.dart b/lib/data/services/auth_service.dart index ef0a769..1f5a336 100644 --- a/lib/data/services/auth_service.dart +++ b/lib/data/services/auth_service.dart @@ -1,4 +1,5 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class AuthService { static const _tokenKey = 'auth_token'; @@ -18,6 +19,8 @@ class AuthService { // Delete token (logout) static Future clearToken() async { print('ClearToken'); + final prefs = await SharedPreferences.getInstance(); + prefs.clear(); await _storage.delete(key: _tokenKey); } diff --git a/lib/presentation/layouts/main_layout.dart b/lib/presentation/layouts/main_layout.dart index 50fe643..75639b8 100644 --- a/lib/presentation/layouts/main_layout.dart +++ b/lib/presentation/layouts/main_layout.dart @@ -33,6 +33,12 @@ class MainLayout extends StatelessWidget { onNotifications: () { debugPrint("Notifications tapped"); }, + + onLogout: () { + debugPrint("Logout tapped"); + AuthService.clearToken(); + context.go(AppRoutes.login); + }, ), drawer: const DrawerMenu(), body: body, diff --git a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart index a9cfd0d..cd22dd8 100644 --- a/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart +++ b/lib/presentation/screens/Enquiry/enquiry/enquiry_tab.dart @@ -699,7 +699,7 @@ class EnquiryTabState extends ConsumerState { label: "Vehicle Type *", field: Container( decoration: BoxDecoration( - color: Colors.white, + // color: Colors.white, borderRadius: BorderRadius.circular(10.0), ), width: ResponsiveLayout.isMobile(context) @@ -732,6 +732,7 @@ class EnquiryTabState extends ConsumerState { ), ), + popupProps: PopupProps.menu( fit: FlexFit.loose, constraints: BoxConstraints(maxHeight: 250), @@ -784,7 +785,7 @@ class EnquiryTabState extends ConsumerState { label: "Insurer *", field: Container( decoration: BoxDecoration( - color: Colors.white, + // color: Colors.white, borderRadius: BorderRadius.circular(10.0), ), width: ResponsiveLayout.isMobile(context) diff --git a/lib/presentation/screens/Enquiry/enquiry/policy_tab.dart b/lib/presentation/screens/Enquiry/enquiry/policy_tab.dart index 3f156f7..597cd75 100644 --- a/lib/presentation/screens/Enquiry/enquiry/policy_tab.dart +++ b/lib/presentation/screens/Enquiry/enquiry/policy_tab.dart @@ -105,7 +105,17 @@ class PolicyTabState extends ConsumerState { // final response = await apiService.fetchQuotationList(managerId); if (widget.data != null) { - final data = List>.from(widget.data as Iterable); + // final data = List>.from(widget.data as Iterable); + + List> data; + + if (widget.data is List) { + data = List>.from(widget.data as List); + } else if (widget.data is Map) { + data = [Map.from(widget.data as Map)]; + } else { + data = []; + } print('policyListData - ${widget.data}'); setState(() { diff --git a/lib/presentation/screens/Enquiry/enquiry/quotation_tab.dart b/lib/presentation/screens/Enquiry/enquiry/quotation_tab.dart index 356a2fa..a3995cb 100644 --- a/lib/presentation/screens/Enquiry/enquiry/quotation_tab.dart +++ b/lib/presentation/screens/Enquiry/enquiry/quotation_tab.dart @@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:http/http.dart' as http; +import 'package:nhance_partner/presentation/screens/Enquiry/enquiry/tabs.dart'; import '../../../../core/config/env.dart'; import '../../../../core/services/api_service.dart'; import '../../../../data/services/auth_service.dart'; @@ -23,7 +24,8 @@ class QuotationTab extends ConsumerStatefulWidget { // final Map? data; final List>? data; String? id; - QuotationTab({super.key, this.data, this.id}); + final Future Function()? onRefresh; + QuotationTab({super.key, this.data, this.id, this.onRefresh}); @override ConsumerState createState() => QuotationTabState(); } @@ -41,6 +43,11 @@ class QuotationTabState extends ConsumerState { final GlobalKey>> dropDownKey = GlobalKey>>(); + final GlobalKey tabKey = + GlobalKey(); + + bool blockKey = false; + List tabHeader = [ 'regNum', 'insurer', @@ -110,7 +117,7 @@ class QuotationTabState extends ConsumerState { managerId = ref.watch(managerIdProvider); userId = ref.watch(userIdProvider); - getQuotationList(managerId); + getQuotationList(); }); } @@ -120,7 +127,7 @@ class QuotationTabState extends ConsumerState { } void refresh() { - getQuotationList(managerId); + getQuotationList(); } @override @@ -132,8 +139,8 @@ class QuotationTabState extends ConsumerState { super.dispose(); } - Future getQuotationList(managerId) async { - print('getClaimList called MagId - $managerId'); + Future getQuotationList() async { + print('getClaimList called MagId - '); setState(() { isLoading = true; }); @@ -143,38 +150,48 @@ class QuotationTabState extends ConsumerState { if (widget.data != null && widget.id != null) { final data = List>.from(widget.data as Iterable); - response = await apiService.findSingleQuotationData(widget.id); + // response = await apiService.findSingleQuotationData(widget.id); // print('quoationListData - ${widget.data}'); - // setState(() { - // getQuotationData = data; - // // getQuotationData = List>.from(response['data']); - // originalData = getQuotationData; - // filteredData = List.from(originalData); - // // print('originalData - $getClaimPolicies'); - // }); + setState(() { + getQuotationData = data; + // getQuotationData = List>.from(response['data']); + originalData = getQuotationData; + filteredData = List.from(originalData); + print('quoationListData - $getQuotationData'); - if (response['status'] == 'success') { - final rawData = response['data']; - print('quoationListData1 - ${response['data']}'); - setState(() { - if (rawData is List) { - // already a list - getQuotationData = List>.from(rawData); - } else if (rawData is Map) { - // single object, wrap into a list - getQuotationData = [Map.from(rawData)]; - } else { - getQuotationData = []; - } - // getQuotationData = List>.from(response['data']); - originalData = getQuotationData; - filteredData = List.from(originalData); - // print('originalData - $getClaimPolicies'); - }); - } else { - getQuotationData = []; - originalData = []; - } + blockKey = getQuotationData.any((item) => item['status'] == 'Accepted'); + print('blockKey- $blockKey'); + + + // blockKey = getQuotationData.any( + // (item) => (item['status']?.toString().toLowerCase() ?? '') == 'approved', + // ); + + // print('originalData - $getClaimPolicies'); + }); + + // if (response['status'] == 'success') { + // final rawData = response['data']; + // print('quoationListData1 - ${response['data']}'); + // setState(() { + // if (rawData is List) { + // // already a list + // getQuotationData = List>.from(rawData); + // } else if (rawData is Map) { + // // single object, wrap into a list + // getQuotationData = [Map.from(rawData)]; + // } else { + // getQuotationData = []; + // } + // // getQuotationData = List>.from(response['data']); + // originalData = getQuotationData; + // filteredData = List.from(originalData); + // // print('originalData - $getClaimPolicies'); + // }); + // } else { + // getQuotationData = []; + // originalData = []; + // } } } catch (e) { print('Exception occurred: $e'); @@ -263,7 +280,7 @@ class QuotationTabState extends ConsumerState { // data['id'] = selectedId; // Add plan_id for update // data['status'] = val; - print("data------- $data}"); + print("data------- $data"); try { final response = await http.post( @@ -280,11 +297,21 @@ class QuotationTabState extends ConsumerState { print("Response: ${response.body}"); ToastHelper.showSuccessToast(context, 'Status Updated'); - + print("tre1"); selectedId = null; // just update field isquotation = false; - refresh(); + print("tre11"); + // 🔄 Refresh parent + if (widget.onRefresh != null) { + await widget.onRefresh!(); + } + + + // refresh(); + // WidgetsBinding.instance.addPostFrameCallback((_) { + // tabKey.currentState?.loadQuotationTab(widget.id ?? ""); + // }); // context.go(AppRoutes.staffLst); } else { final responseBody = jsonDecode(response.body); @@ -368,6 +395,10 @@ class QuotationTabState extends ConsumerState { ToastHelper.showSuccessToast(context, 'Document Uploaded'); print("Response: ${response.body}"); + + if (widget.onRefresh != null) { + await widget.onRefresh!(); + } // context.go(AppRoutes.agentLst); } else { final responseBody = jsonDecode(response.body); @@ -383,6 +414,8 @@ class QuotationTabState extends ConsumerState { Color _getStatusColor(String? status) { switch (status) { + case 'Pending': + return Colors.yellow; case 'Accepted': return Colors.green; case 'Rejected': @@ -443,7 +476,7 @@ class QuotationTabState extends ConsumerState { const SizedBox(height: 20), - if (showAction) + if (!blockKey) Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -976,7 +1009,8 @@ class QuotationTabState extends ConsumerState { fontSize: 14, fontWeight: FontWeight.w400, - color: item['status'] == 'Accepted' ? Colors.green : Colors.red, + color: _getStatusColor(item['status']), + // color: item['status'] == 'Accepted' ? Colors.green : Colors.red, ), ), ), diff --git a/lib/presentation/screens/Enquiry/enquiry/tabs.dart b/lib/presentation/screens/Enquiry/enquiry/tabs.dart index a7c1ac2..814edf4 100644 --- a/lib/presentation/screens/Enquiry/enquiry/tabs.dart +++ b/lib/presentation/screens/Enquiry/enquiry/tabs.dart @@ -1,7 +1,9 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/routing/routes.dart'; import '../../../../core/services/api_service.dart'; @@ -26,11 +28,16 @@ class TabEnquiryListState extends ConsumerState { bool isLoading = true; late ApiService apiService; ScrollController _scrollController = ScrollController(); + @override void initState() { super.initState(); apiService = ApiService(); + if (kIsWeb) { + Future.microtask(() => _restoreId(ref)); + } + Future.microtask(() { final id = ref.read(enquiryIdProvider); @@ -49,7 +56,21 @@ class TabEnquiryListState extends ConsumerState { // fetch immediately } - Future _loadData(id) async { + Future _restoreId(WidgetRef ref) async { + final prefs = await SharedPreferences.getInstance(); + + final String? savedId = prefs.getString( + 'enqAgentDataId', + ); // already a string + if (savedId != null) { + ref.read(enquiryIdProvider.notifier).state = savedId; + print("savedenqStaffDataId ID restored: $savedId"); + + _loadData(savedId); + } + } + + Future _loadData1(id) async { print('Load Data'); setState(() => isLoading = true); final response = await apiService.findEnqQuotePolicyView(id); @@ -65,20 +86,37 @@ class TabEnquiryListState extends ConsumerState { TabItem( "Quotation", QuotationTab( - data: (enquiryData?["quotations"] as List?)! - .map((e) => Map.from(e as Map)) - .toList(), + data: + (enquiryData?["quotations"] as List?) + ?.map((e) => Map.from(e as Map)) + .toList() ?? + [], id: id ?? "", ), + // QuotationTab( + // data: (enquiryData?["quotations"] as List?)! + // .map((e) => Map.from(e as Map)) + // .toList(), + // id: id ?? "", + // ), ), TabItem( "Policy", + PolicyTab( - data: (enquiryData?["policies"] as List?)! - .map((e) => Map.from(e as Map)) - .toList(), + data: + (enquiryData?["policies"] as List?) + ?.map((e) => Map.from(e as Map)) + .toList() ?? + [], // fallback to empty list id: id ?? "", ), + // PolicyTab( + // data: (enquiryData?["policies"] as List?)! + // .map((e) => Map.from(e as Map)) + // .toList(), + // id: id ?? "", + // ), ), // TabItem("Quotation", QuotationTab(data: enquiryData?["quotations"])), @@ -87,6 +125,75 @@ class TabEnquiryListState extends ConsumerState { }); } + Future _loadData(id, {int? tabIndex}) async { + print('loadQuotationTab 2'); + setState(() => isLoading = true); + final response = await apiService.findEnqQuotePolicyView(id); + + setState(() { + enquiryData = response["data"]; + isLoading = false; + tabs = [ + TabItem( + "Enquiry", + EnquiryTab(data: enquiryData?["enquiry"], id: id ?? ""), + ), + TabItem( + "Quotation", + QuotationTab( + data: + (enquiryData?["quotations"] as List?) + ?.map((e) => Map.from(e as Map)) + .toList() ?? + [], + id: id ?? "", + onRefresh: () async { + await _loadData(id); // refresh parent data + }, + ), + ), + TabItem( + "Policy", + PolicyTab( + data: enquiryData?["policies"] is List + ? List>.from( + (enquiryData?["policies"] as List).map( + (e) => Map.from(e as Map), + ), + ) + : enquiryData?["policies"] is Map + ? [Map.from(enquiryData?["policies"] as Map)] + : [], + id: id ?? "", + ), + ), + + // TabItem( + // "Policy", + // PolicyTab( + // data: + // (enquiryData?["policies"] as List?) + // ?.map((e) => Map.from(e as Map)) + // .toList() ?? + // [], + // id: id ?? "", + // ), + // ), + ]; + + if (tabIndex != null) { + selectedIndex = tabIndex; + expandedIndex = tabIndex; + } + }); + } + + /// Public method to load data and select a tab + Future loadQuotationTab(String id) async { + print('loadQuotationTab 1'); + await _loadData(id, tabIndex: 2); // now _loadData will set the selected tab + } + @override Widget build(BuildContext context) { final bool isMobile = MediaQuery.of(context).size.width < 600; @@ -94,12 +201,12 @@ class TabEnquiryListState extends ConsumerState { print("TABUPDID- $id"); - // When provider changes, re-fetch - ref.listen(enquiryIdProvider, (prev, next) { - if (prev != next) { - _loadData(id); - } - }); + // // When provider changes, re-fetch + // ref.listen(enquiryIdProvider, (prev, next) { + // if (prev != next) { + // _loadData(id); + // } + // }); print('ENQID: $id'); @@ -110,14 +217,130 @@ class TabEnquiryListState extends ConsumerState { child: isLoading ? const Center(child: CircularProgressIndicator()) : isMobile - ? _buildMobileTabs() + ? SingleChildScrollView( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 2, + ), + child: GestureDetector( + onTap: () { + // context.go(AppRoutes.dashboard); + ref.read(enquiryIdProvider.notifier).state = null; + context.go(AppRoutes.enquiryLst); + }, + child: Row( + children: [ + const Icon( + Icons.arrow_left_sharp, + size: 25, + color: Color(0xFF425B5B), + ), + // const SizedBox(width: 8), + Text( + "Enquiry", + style: GoogleFonts.inter( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + ), + ], + ), + ), + ), + _buildMobileTabs( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + ), + ], + ), + ) : _buildDesktopTabs(), ), ); } - Widget _buildMobileTabs() { + Widget _buildMobileTabs({ + required bool shrinkWrap, + required ScrollPhysics physics, + }) { return ListView.builder( + shrinkWrap: shrinkWrap, + physics: physics, + itemCount: tabs.length, + padding: const EdgeInsets.all(16), + itemBuilder: (context, index) { + final isExpanded = expandedIndex == index; + + return Card( + margin: const EdgeInsets.only(bottom: 12), + color: isExpanded ? const Color(0xFFEDF6F5) : const Color(0xFF425B5B), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + side: const BorderSide(color: Color(0xFF425B5B), width: 1), + ), + child: Theme( + // ✅ removes top & bottom dividers inside ExpansionTile + data: Theme.of(context).copyWith(dividerColor: Colors.transparent), + child: ExpansionTile( + key: ValueKey(index), + collapsedIconColor: isExpanded ? Colors.black : Colors.white, + iconColor: isExpanded ? Colors.black : Colors.white, + initiallyExpanded: isExpanded, + tilePadding: const EdgeInsets.symmetric(horizontal: 16.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + collapsedShape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + onExpansionChanged: (expanded) { + setState(() { + expandedIndex = expanded ? index : null; + if (expanded) { + WidgetsBinding.instance.addPostFrameCallback((_) { + RenderBox box = context.findRenderObject() as RenderBox; + double yPos = box.localToGlobal(Offset.zero).dy; + _scrollController.animateTo( + _scrollController.offset + yPos - 100, + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + ); + }); + } + }); + }, + title: Text( + tabs[index].title, + style: GoogleFonts.inter( + fontSize: 14, + color: isExpanded ? Colors.black : Colors.white, + fontWeight: FontWeight.w600, + ), + ), + children: [ + Container( + // padding: const EdgeInsets.all(12), + child: tabs[index].widget, + ), + ], + ), + ), + ); + }, + ); + } + + Widget _buildMobileTabs1({ + required bool shrinkWrap, + required NeverScrollableScrollPhysics physics, + }) { + return ListView.builder( + shrinkWrap: shrinkWrap, // ✅ Important + physics: physics, itemCount: tabs.length, padding: const EdgeInsets.all(16), itemBuilder: (context, index) { @@ -139,6 +362,7 @@ class TabEnquiryListState extends ConsumerState { collapsedIconColor: isExpanded ? Colors.black : Colors.white, iconColor: isExpanded ? Colors.black : Colors.white, initiallyExpanded: isExpanded, + onExpansionChanged: (expanded) { setState(() { if (expanded) { @@ -163,10 +387,12 @@ class TabEnquiryListState extends ConsumerState { title: Text( tabs[index].title, style: GoogleFonts.inter( + fontSize: 14, color: isExpanded ? Colors.black : Colors.white, fontWeight: FontWeight.w600, ), ), + children: [ Container( // padding: const EdgeInsets.all(12), diff --git a/lib/presentation/screens/Enquiry/enquiryList.dart b/lib/presentation/screens/Enquiry/enquiryList.dart index 5d22865..682dd70 100644 --- a/lib/presentation/screens/Enquiry/enquiryList.dart +++ b/lib/presentation/screens/Enquiry/enquiryList.dart @@ -2,9 +2,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:http/http.dart'; import 'package:intl/intl.dart'; import 'package:nhance_partner/presentation/providers/userRoleProvider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/routing/routes.dart'; import '../../../../core/services/api_service.dart'; import '../../../../data/utils/Pagination.dart'; @@ -100,6 +102,29 @@ class EnquiryListState extends ConsumerState { return sortedData.sublist(startIndex, endIndex); } + Future handleEdit(item) async { + // Navigator.pop(context); + print('EDITStaff - ${item['id']}'); + // dynamic id = data['id']; + // context.go('/tabEnquiry/$id'); + + final prefs = await SharedPreferences.getInstance(); + + // ✅ Remove old value (if any) + await prefs.remove('enqAgentDataId'); + + // setState(() { + final id = item['id'].toString(); + // ✅ Save the new id + await prefs.setString('enqAgentDataId', id.toString()); + ref.read(enquiryIdProvider.notifier).state = id; + + // }); + // update provider + + context.go(AppRoutes.tabEnquiry); + } + void filterData(String query) { print("FilterDAta - $query"); setState(() { @@ -186,13 +211,13 @@ class EnquiryListState extends ConsumerState { children: [ Icon( Icons.arrow_left_sharp, - size: 35, + size: ResponsiveLayout.isMobile(context) ? 25 : 35, color: Color(0xFF425B5B), ), Text( "Enquiries", - style: TextStyle( - fontSize: 18, + style: GoogleFonts.inter( + fontSize: ResponsiveLayout.isMobile(context) ? 14 : 18, fontWeight: FontWeight.w600, ), ), @@ -201,7 +226,7 @@ class EnquiryListState extends ConsumerState { ), ), - SizedBox(height: 10), + SizedBox(height: ResponsiveLayout.isMobile(context) ? 5 : 10), Expanded( child: Container( @@ -250,8 +275,10 @@ class EnquiryListState extends ConsumerState { SizedBox(width: 10), GestureDetector( - onTap: () { - ref.read(enquiryIdProvider.notifier).state = null; + onTap: () async { + final prefs = await SharedPreferences.getInstance(); + + await prefs.remove('enqAgentDataId'); context.go(AppRoutes.tabEnquiry); // print('Export'); }, @@ -270,7 +297,7 @@ class EnquiryListState extends ConsumerState { SizedBox(width: 10), Text( 'Create New Enquiry', - style: TextStyle( + style: GoogleFonts.inter( color: Colors.white, fontWeight: FontWeight.w600, fontSize: 14, @@ -288,7 +315,7 @@ class EnquiryListState extends ConsumerState { // }, // child: Text( // 'Create New Enquiry', - // style: TextStyle( + // style: GoogleFonts.inter( // color: Colors.white, // fontWeight: FontWeight.w600, // fontSize: 14, @@ -315,7 +342,7 @@ class EnquiryListState extends ConsumerState { vertical: 12, horizontal: 16, ), - child: const Row( + child: Row( children: [ Expanded( flex: 1, @@ -341,7 +368,7 @@ class EnquiryListState extends ConsumerState { child: Text('Status', style: _headerStyle), ), Expanded( - flex: 1, + flex: 2, child: Text('Remarks', style: _headerStyle), ), Expanded( @@ -423,7 +450,7 @@ class EnquiryListState extends ConsumerState { Widget _buildDataRow(Map item, sno) { return Container( - padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16), + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), // margin: const EdgeInsets.only(top: 10), decoration: BoxDecoration( color: Colors.white, @@ -462,7 +489,7 @@ class EnquiryListState extends ConsumerState { child: Text(item['status'] ?? '-', style: _dataBold), ), Expanded( - flex: 1, + flex: 2, child: Text( item['remarks'] ?? '-', style: _dataBold, @@ -473,36 +500,70 @@ class EnquiryListState extends ConsumerState { Expanded( flex: 1, - child: Row( - children: [ - PopupMenuButton( - color: Colors.white, - padding: EdgeInsets.zero, - offset: Offset(0, 30), - icon: Icon( - Icons.more_vert, - color: Color(0xFF475569), - size: 14, - ), - itemBuilder: (context) => [ - CustomPopupMenuEntry( - child: Container( - padding: EdgeInsets.symmetric( - horizontal: 8, - vertical: 8, - ), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: _buildPopupMenuActions(context, item), - ), - ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + GestureDetector( + // onTap: () { + // Navigator.pop(context); + // print('EDITStaff - ${item['id']}'); + // // dynamic id = data['id']; + // // context.go('/tabEnquiry/$id'); + // setState(() { + // final id = item['id'].toString(); + // ref.read(enquiryIdProvider.notifier).state = id; + // }); + // // update provider + // + // context.go(AppRoutes.tabEnquiry); + // }, + onTap: () { + handleEdit(item); + }, + child: Image.asset( + "assets/miscellaneous/Edit.png", + height: 15, + width: 15, ), - ], - ), - ], + ), + ], + ), ), ), + + // Expanded( + // flex: 1, + // child: Row( + // children: [ + // PopupMenuButton( + // color: Colors.white, + // padding: EdgeInsets.zero, + // offset: Offset(0, 30), + // icon: Icon( + // Icons.more_vert, + // color: Color(0xFF475569), + // size: 14, + // ), + // itemBuilder: (context) => [ + // CustomPopupMenuEntry( + // child: Container( + // padding: EdgeInsets.symmetric( + // horizontal: 8, + // vertical: 8, + // ), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.center, + // children: _buildPopupMenuActions(context, item), + // ), + // ), + // ), + // ], + // ), + // ], + // ), + // ), ], ), ); @@ -524,24 +585,47 @@ class EnquiryListState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(item['reg_no'] ?? '-', style: _headerStyle), - PopupMenuButton( - color: Colors.white, - padding: EdgeInsets.zero, - offset: Offset(0, 30), - icon: Icon(Icons.more_vert, color: Color(0xFF475569), size: 14), - itemBuilder: (context) => [ - CustomPopupMenuEntry( - child: Container( - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: _buildPopupMenuActions(context, item), - ), - ), - ), - ], + GestureDetector( + // onTap: () { + // Navigator.pop(context); + // print('EDITStaff - ${item['id']}'); + // // dynamic id = data['id']; + // // context.go('/tabEnquiry/$id'); + // setState(() { + // final id = item['id'].toString(); + // ref.read(enquiryIdProvider.notifier).state = id; + // }); + // // update provider + // + // context.go(AppRoutes.tabEnquiry); + // }, + onTap: () { + handleEdit(item); + }, + child: Image.asset( + "assets/miscellaneous/Edit.png", + height: 15, + width: 15, + ), ), + // PopupMenuButton( + // color: Colors.white, + // padding: EdgeInsets.zero, + // offset: Offset(0, 30), + // icon: Icon(Icons.more_vert, color: Color(0xFF475569), size: 14), + // itemBuilder: (context) => [ + // CustomPopupMenuEntry( + // child: Container( + // padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.center, + // children: _buildPopupMenuActions(context, item), + // ), + // ), + // ), + // ], + // ), ], ), const Divider(color: Color(0xffD9EBE8), thickness: 0.8), @@ -557,7 +641,7 @@ class EnquiryListState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.start, children: [ - const Text("Company", style: _cardheaderStyle), + Text("Company", style: _cardheaderStyle), Text( item['insurer_name'] ?? '-', style: _cardBodyStyle, @@ -573,7 +657,7 @@ class EnquiryListState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - const Text("Status", style: _cardheaderStyle), + Text("Status", style: _cardheaderStyle), Text( item['status'] ?? '-', style: _cardBodyStyle, @@ -595,7 +679,7 @@ class EnquiryListState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Received Date & Time", style: _cardheaderStyle), + Text("Received Date & Time", style: _cardheaderStyle), Text( _formatDate(item['created_on']) ?? '-', style: _cardBodyStyle, @@ -608,7 +692,7 @@ class EnquiryListState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Remarks", style: _cardheaderStyle), + Text("Remarks", style: _cardheaderStyle), Text( item['remarks'] ?? '-', style: _cardBodyStyle, @@ -625,30 +709,34 @@ class EnquiryListState extends ConsumerState { ); } - static final _dataBold = TextStyle( + static final _dataBold = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF000000), ); - static final _dataSub = TextStyle( + static final _dataSub = GoogleFonts.inter( fontSize: 10, fontWeight: FontWeight.w300, color: Color(0xFF585757), ); - static const _headerStyle = TextStyle( + // static const _headerStyle = GoogleFonts.inter( + // color: Colors.black, + // fontWeight: FontWeight.bold, + // ); + static final _headerStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.bold, ); - static const _cardheaderStyle = TextStyle( + static final _cardheaderStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 12, ); - static const _cardBodyStyle = TextStyle( + static final _cardBodyStyle = GoogleFonts.inter( color: Color(0xFF545454), fontWeight: FontWeight.w400, fontSize: 12, diff --git a/lib/presentation/screens/Enquiry/policy_claims_endros/claims.dart b/lib/presentation/screens/Enquiry/policy_claims_endros/claims.dart index 0e4be99..6cf08d6 100644 --- a/lib/presentation/screens/Enquiry/policy_claims_endros/claims.dart +++ b/lib/presentation/screens/Enquiry/policy_claims_endros/claims.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; import 'package:nhance_partner/presentation/providers/userRoleProvider.dart'; import '../../../../core/routing/routes.dart'; @@ -188,7 +189,7 @@ class claimListState extends ConsumerState { ), Text( "Claims", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 18, fontWeight: FontWeight.w600, ), @@ -271,7 +272,7 @@ class claimListState extends ConsumerState { // }, // child: Text( // 'Create New Staff', - // style: TextStyle( + // style: GoogleFonts.inter( // color: Colors.white, // fontWeight: FontWeight.w600, // fontSize: 14, @@ -297,7 +298,7 @@ class claimListState extends ConsumerState { vertical: 12, horizontal: 16, ), - child: const Row( + child: Row( children: [ Expanded( flex: 2, @@ -556,7 +557,7 @@ class claimListState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.start, children: [ //company - const Text("Company", style: _cardheaderStyle), + Text("Company", style: _cardheaderStyle), Text( item['policy_end_date'] != null ? _formatDate(item['policy_end_date']) @@ -575,7 +576,7 @@ class claimListState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.start, children: [ //status - const Text("Claim Type", style: _cardheaderStyle), + Text("Claim Type", style: _cardheaderStyle), Text( item['claim_type_value'] ?? '-', style: _cardBodyStyle, @@ -598,7 +599,7 @@ class claimListState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ //date and time - const Text("policy Number", style: _cardheaderStyle), + Text("policy Number", style: _cardheaderStyle), Text(item['policy_no'] ?? '-', style: _cardBodyStyle), ], ), @@ -609,7 +610,7 @@ class claimListState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ //remarks - const Text("Claim Number", style: _cardheaderStyle), + Text("Claim Number", style: _cardheaderStyle), Text( item['claim_number'] ?? '-', style: _cardBodyStyle, @@ -626,31 +627,31 @@ class claimListState extends ConsumerState { ); } - static final _dataBold = TextStyle( + static final _dataBold = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF000000), ); - static final _dataSub = TextStyle( + static final _dataSub = GoogleFonts.inter( fontSize: 10, fontWeight: FontWeight.w300, color: Color(0xFF585757), ); - static const _headerStyle = TextStyle( + static final _headerStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.bold, ); - static const _cardheaderStyle = TextStyle( + static final _cardheaderStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 12, ); - static const _cardBodyStyle = TextStyle( - color: Color(0xFF545454), + static final _cardBodyStyle = GoogleFonts.inter( + color: const Color(0xFF545454), fontWeight: FontWeight.w400, fontSize: 12, ); diff --git a/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart b/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart index 3921832..8f5368f 100644 --- a/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart +++ b/lib/presentation/screens/Enquiry/policy_claims_endros/endrosment.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; import 'package:nhance_partner/presentation/providers/userRoleProvider.dart'; import '../../../../core/routing/routes.dart'; @@ -185,7 +186,7 @@ class endosementState extends ConsumerState { ), Text( "Endorsement", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 18, fontWeight: FontWeight.w600, ), @@ -267,7 +268,7 @@ class endosementState extends ConsumerState { // }, // child: Text( // 'Create New Staff', - // style: TextStyle( + // style: GoogleFonts.inter( // color: Colors.white, // fontWeight: FontWeight.w600, // fontSize: 14, @@ -293,7 +294,7 @@ class endosementState extends ConsumerState { vertical: 12, horizontal: 16, ), - child: const Row( + child: Row( children: [ Expanded( flex: 2, @@ -535,7 +536,7 @@ class endosementState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.start, children: [ //company - const Text("Company", style: _cardheaderStyle), + Text("Company", style: _cardheaderStyle), Text( item['insurer_name'] ?? '-', style: _cardBodyStyle, @@ -552,7 +553,7 @@ class endosementState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.start, children: [ //status - const Text("Endorsement Type", style: _cardheaderStyle), + Text("Endorsement Type", style: _cardheaderStyle), Text( item['endorsement_type_value'] ?? '-', style: _cardBodyStyle, @@ -575,7 +576,7 @@ class endosementState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ //date and time - const Text("policy Number", style: _cardheaderStyle), + Text("policy Number", style: _cardheaderStyle), Text( _formatDate(item['policy_number']) ?? '-', style: _cardBodyStyle, @@ -589,7 +590,7 @@ class endosementState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ //remarks - const Text("Endorsement Number", style: _cardheaderStyle), + Text("Endorsement Number", style: _cardheaderStyle), Text( item['endorsement_no'] ?? '-', style: _cardBodyStyle, @@ -606,31 +607,31 @@ class endosementState extends ConsumerState { ); } - static final _dataBold = TextStyle( + static final _dataBold = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF000000), ); - static final _dataSub = TextStyle( + static final _dataSub = GoogleFonts.inter( fontSize: 10, fontWeight: FontWeight.w300, color: Color(0xFF585757), ); - static const _headerStyle = TextStyle( + static final _headerStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.bold, ); - static const _cardheaderStyle = TextStyle( + static final _cardheaderStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 12, ); - static const _cardBodyStyle = TextStyle( - color: Color(0xFF545454), + static final _cardBodyStyle = GoogleFonts.inter( + color: const Color(0xFF545454), fontWeight: FontWeight.w400, fontSize: 12, ); diff --git a/lib/presentation/screens/dashboard/dashboard.dart b/lib/presentation/screens/dashboard/dashboard.dart index af9c90d..1e33e2f 100644 --- a/lib/presentation/screens/dashboard/dashboard.dart +++ b/lib/presentation/screens/dashboard/dashboard.dart @@ -180,6 +180,7 @@ class _DashboardScreenState extends ConsumerState { ? Expanded( // ✅ take available space child: SingleChildScrollView( + scrollDirection: Axis.vertical, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -236,12 +237,16 @@ class _DashboardScreenState extends ConsumerState { color: const Color(0xFF425B5B), borderRadius: BorderRadius.circular(25), ), - padding: const EdgeInsets.all(8), + padding: const EdgeInsets.all(6), child: Row( children: [ - buildTab("Enquiries Pending", 0), + Expanded( + child: buildTab("Enquiries Pending", 0), + ), const SizedBox(width: 10), - buildTab("Quotation Pending", 1), + Expanded( + child: buildTab("Quotation Pending", 1), + ), ], ), ), @@ -302,108 +307,224 @@ class _DashboardScreenState extends ConsumerState { ), ), ) - : Expanded( - child: Column( - children: [ - if (role != 'staff') - Row( - children: [ - Expanded( - child: StatCard( - title: "Policies Issued", - today: policiesIssuedToday ?? '', - month: policiesIssuedMonth ?? '', - year: policiesIssuedYear ?? '', - imagePath: "assets/dashboard/Policy issue icon.png", - ), - ), - SizedBox(width: 16), - Expanded( - child: StatCard( - title: "Premium Value", - today: premiumValueToday ?? '', - month: premiumValueMonth ?? '', - year: premiumValueYear ?? '', - imagePath: "assets/dashboard/Premium value.png", - ), - ), - SizedBox(width: 16), - Expanded( - child: StatCard( - title: "Earnings", - today: earningsToday ?? '', - month: earningsMonth ?? '', - year: earningsYear ?? '', - imagePath: "assets/dashboard/Earnings.png", - ), - ), - ], - ), - if (role == 'manager') - Expanded( - child: Row( + : Container( + height: MediaQuery.of(context).size.height * 0.8, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + if (role != 'staff') + Row( children: [ Expanded( - child: Performance( - title: "Top Agent Performance", - data: agentsPerformanceList, + child: StatCard( + title: "Policies Issued", + today: policiesIssuedToday ?? '', + month: policiesIssuedMonth ?? '', + year: policiesIssuedYear ?? '', + imagePath: + "assets/dashboard/Policy issue icon.png", ), ), SizedBox(width: 16), Expanded( - child: Performance( - title: "Bottom Non-Performing Agents", - data: nonAgentsPerformanceList, + child: StatCard( + title: "Premium Value", + today: premiumValueToday ?? '', + month: premiumValueMonth ?? '', + year: premiumValueYear ?? '', + imagePath: "assets/dashboard/Premium value.png", + ), + ), + SizedBox(width: 16), + Expanded( + child: StatCard( + title: "Earnings", + today: earningsToday ?? '', + month: earningsMonth ?? '', + year: earningsYear ?? '', + imagePath: "assets/dashboard/Earnings.png", ), ), ], ), - ), - const SizedBox(height: 10), - Expanded( - child: Row( - children: [ - Expanded( - child: (role == 'agent') - ? agentPendings( - title: - "Enquiries Pending (${policiesPendingList.length})", - data: policiesPendingList, - ) - : othersPendings( - title: - "Quotations Pending (${quotationsPendingList.length})", - data: quotationsPendingList, - stringFlag: "Quotation", - ), + if (role == 'manager') + SizedBox( + // ✅ replace Expanded + height: 350, // adjust height as needed + child: Row( + children: [ + Expanded( + child: Performance( + title: "Top Agent Performance", + data: agentsPerformanceList, + ), + ), + SizedBox(width: 16), + Expanded( + child: Performance( + title: "Bottom Non-Performing Agents", + data: nonAgentsPerformanceList, + ), + ), + ], ), - const SizedBox(width: 16), - Expanded( - child: (role == 'agent') - ? agentPendings( - title: - "Quotations Pending (${quotationsPendingList.length})", - data: quotationsPendingList, - ) - : othersPendings( - title: - "Policies Pending (${policiesPendingList.length})", - data: policiesPendingList, - stringFlag: "Policies", - ), - // child: - // quotationsPendingList.isEmpty ? Center(child: Text("Loading quotations...")) : - // agentPendings( - // title: "Quotations Pending (${quotationsPendingList.length})", - // data: quotationsPendingList, - // ), - ), - ], + ), + const SizedBox(height: 10), + SizedBox( + // ✅ replace Expanded + height: (role == 'agent') + ? MediaQuery.of(context).size.height * + 0.69 //400 + : MediaQuery.of(context).size.height * + 0.5, // 350 adjust height as needed + child: Row( + children: [ + Expanded( + child: (role == 'agent') + ? agentPendings( + title: + "Enquiries Pending (${policiesPendingList.length})", + data: policiesPendingList, + ) + : othersPendings( + title: + "Quotations Pending (${quotationsPendingList.length})", + data: quotationsPendingList, + stringFlag: "Quotation", + ), + ), + const SizedBox(width: 16), + Expanded( + child: (role == 'agent') + ? agentPendings( + title: + "Quotations Pending (${quotationsPendingList.length})", + data: quotationsPendingList, + ) + : othersPendings( + title: + "Policies Pending (${policiesPendingList.length})", + data: policiesPendingList, + stringFlag: "Policies", + ), + ), + ], + ), ), - ), - ], + ], + ), ), ), + + // Expanded( + // child: + // + // SingleChildScrollView( + // scrollDirection: Axis.vertical, + // child: Column( + // children: [ + // if (role != 'staff') + // Row( + // children: [ + // Expanded( + // child: StatCard( + // title: "Policies Issued", + // today: policiesIssuedToday ?? '', + // month: policiesIssuedMonth ?? '', + // year: policiesIssuedYear ?? '', + // imagePath: + // "assets/dashboard/Policy issue icon.png", + // ), + // ), + // SizedBox(width: 16), + // Expanded( + // child: StatCard( + // title: "Premium Value", + // today: premiumValueToday ?? '', + // month: premiumValueMonth ?? '', + // year: premiumValueYear ?? '', + // imagePath: "assets/dashboard/Premium value.png", + // ), + // ), + // SizedBox(width: 16), + // Expanded( + // child: StatCard( + // title: "Earnings", + // today: earningsToday ?? '', + // month: earningsMonth ?? '', + // year: earningsYear ?? '', + // imagePath: "assets/dashboard/Earnings.png", + // ), + // ), + // ], + // ), + // if (role == 'manager') + // Expanded( + // child: Row( + // children: [ + // Expanded( + // child: Performance( + // title: "Top Agent Performance", + // data: agentsPerformanceList, + // ), + // ), + // SizedBox(width: 16), + // Expanded( + // child: Performance( + // title: "Bottom Non-Performing Agents", + // data: nonAgentsPerformanceList, + // ), + // ), + // ], + // ), + // ), + // const SizedBox(height: 10), + // Expanded( + // child: Row( + // children: [ + // Expanded( + // child: (role == 'agent') + // ? agentPendings( + // title: + // "Enquiries Pending (${policiesPendingList.length})", + // data: policiesPendingList, + // ) + // : othersPendings( + // title: + // "Quotations Pending (${quotationsPendingList.length})", + // data: quotationsPendingList, + // stringFlag: "Quotation", + // ), + // ), + // const SizedBox(width: 16), + // Expanded( + // child: (role == 'agent') + // ? agentPendings( + // title: + // "Quotations Pending (${quotationsPendingList.length})", + // data: quotationsPendingList, + // ) + // : othersPendings( + // title: + // "Policies Pending (${policiesPendingList.length})", + // data: policiesPendingList, + // stringFlag: "Policies", + // ), + // // child: + // // quotationsPendingList.isEmpty ? Center(child: Text("Loading quotations...")) : + // // agentPendings( + // // title: "Quotations Pending (${quotationsPendingList.length})", + // // data: quotationsPendingList, + // // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // ), ); } @@ -422,22 +543,22 @@ class _DashboardScreenState extends ConsumerState { }, child: SizedBox( child: Container( - padding: EdgeInsets.only( - top: 9.0, - bottom: 9.0, - left: 20.0, - right: 20.0, - ), + padding: EdgeInsets.symmetric(vertical: 6, horizontal: 10), decoration: BoxDecoration( color: isSelected ? const Color(0xFFFFFFFF) : Colors.transparent, borderRadius: BorderRadius.circular(16), ), - child: Text( - title, - style: GoogleFonts.poppins( - fontSize: 12, - color: isSelected ? Colors.black : Colors.white, - fontWeight: FontWeight.w500, + child: Center( + child: Text( + title, + style: GoogleFonts.poppins( + fontSize: 12, + + color: isSelected ? Colors.black : Colors.white, + fontWeight: FontWeight.w500, + ), + maxLines: 2, + softWrap: true, ), ), ), @@ -483,7 +604,7 @@ class StatCard extends StatelessWidget { title, style: GoogleFonts.inter( fontSize: 16, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, color: Color(0xFF425B5B), ), ), @@ -533,21 +654,21 @@ class StatCard extends StatelessWidget { child: Text( "Today", textAlign: TextAlign.center, - style: GoogleFonts.inter(fontSize: 12), + style: topHeaderStyle, ), ), Expanded( child: Text( "This Month", textAlign: TextAlign.center, - style: GoogleFonts.inter(fontSize: 12), + style: topHeaderStyle, ), ), Expanded( child: Text( "This Year", textAlign: TextAlign.center, - style: GoogleFonts.inter(fontSize: 12), + style: topHeaderStyle, ), ), ], @@ -731,19 +852,12 @@ class agentPendings extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // Title - Text( - title, - style: GoogleFonts.inter( - fontWeight: FontWeight.bold, - fontSize: 20, - color: const Color(0xff425B5B), - ), - ), - const SizedBox(height: 20), + Text(title, style: _title), + const SizedBox(height: 10), // Header row Container( - padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), decoration: BoxDecoration( color: const Color(0xFF3E5B56), borderRadius: BorderRadius.circular(10), @@ -754,33 +868,21 @@ class agentPendings extends StatelessWidget { child: Text( "Date & Time", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( child: Text( "Registration number", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( child: Text( "Insurer Company", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), ], @@ -827,20 +929,8 @@ class agentPendings extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - date, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - Text( - time, - style: GoogleFonts.inter( - fontSize: 10, - fontWeight: FontWeight.w400, - ), - ), + Text(date, style: _tableDataStyle), + Text(time, style: _tableDataStyle), ], ), ), @@ -850,10 +940,7 @@ class agentPendings extends StatelessWidget { child: Text( row['reg_no'] ?? "", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), @@ -862,10 +949,7 @@ class agentPendings extends StatelessWidget { child: Text( row['insurer_name'] ?? "", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), ], @@ -907,19 +991,12 @@ class othersPendings extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // Title - Text( - title, - style: GoogleFonts.inter( - fontWeight: FontWeight.bold, - fontSize: 20, - color: const Color(0xff425B5B), - ), - ), - const SizedBox(height: 20), + Text(title, style: _title), + const SizedBox(height: 10), // Header row Container( - padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), decoration: BoxDecoration( color: const Color(0xFF3E5B56), borderRadius: BorderRadius.circular(10), @@ -927,48 +1004,36 @@ class othersPendings extends StatelessWidget { child: Row( children: [ Expanded( + flex: 1, child: Text( "S.No", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( + flex: 2, child: Text( "Staff Name", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( + flex: 2, child: Text( stringFlag + " Issued", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), (stringFlag == "Policies") ? Expanded( + flex: 2, child: Text( "Total Premium Value", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ) : const SizedBox.shrink(), @@ -1005,43 +1070,38 @@ class othersPendings extends StatelessWidget { child: Row( children: [ Expanded( + flex: 1, child: Text( (index + 1).toString(), textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), Expanded( + flex: 2, child: Text( row['staff_name'] ?? "", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), Expanded( + flex: 2, child: Text( issuedCount, textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), stringFlag == "Policies" ? Expanded( + flex: 2, child: Text( formatToCroresLakhsAndThousands(permiumValue), textAlign: TextAlign.center, style: GoogleFonts.inter( - fontSize: 16, + fontSize: 14, fontWeight: FontWeight.w500, ), ), @@ -1079,19 +1139,12 @@ class Performance extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // Title - Text( - title, - style: GoogleFonts.inter( - fontWeight: FontWeight.bold, - fontSize: 20, - color: const Color(0xff425B5B), - ), - ), - const SizedBox(height: 20), + Text(title, style: _title), + const SizedBox(height: 10), // Header row Container( - padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12), + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12), decoration: BoxDecoration( color: const Color(0xFF3E5B56), borderRadius: BorderRadius.circular(10), @@ -1102,33 +1155,21 @@ class Performance extends StatelessWidget { child: Text( "S.No", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( child: Text( "Agent Name", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( child: Text( "Policies Issued", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), Expanded( @@ -1137,11 +1178,7 @@ class Performance extends StatelessWidget { ? "Premium Value" : "Status", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontWeight: FontWeight.w600, - fontSize: 18, - color: Colors.white, - ), + style: _headerStyle, ), ), ], @@ -1157,6 +1194,7 @@ class Performance extends StatelessWidget { final row = data[index]; return Container( + // height: 5200, margin: const EdgeInsets.symmetric(vertical: 5), padding: const EdgeInsets.symmetric( vertical: 5, @@ -1172,10 +1210,7 @@ class Performance extends StatelessWidget { child: Text( (index + 1).toString(), // convert int to string textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), @@ -1183,10 +1218,7 @@ class Performance extends StatelessWidget { child: Text( row['agent_name'] ?? "", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), @@ -1194,10 +1226,7 @@ class Performance extends StatelessWidget { child: Text( row['total_policy_issued'] ?? "", textAlign: TextAlign.center, - style: GoogleFonts.inter( - fontSize: 16, - fontWeight: FontWeight.w500, - ), + style: _tableDataStyle, ), ), @@ -1210,7 +1239,7 @@ class Performance extends StatelessWidget { : (row['status']?.toString() ?? ""), textAlign: TextAlign.center, style: GoogleFonts.inter( - fontSize: 16, + fontSize: 14, fontWeight: FontWeight.w500, color: title == "Top Agent Performance" ? Colors.black @@ -1233,3 +1262,27 @@ class Performance extends StatelessWidget { ); } } + +final _headerStyle = GoogleFonts.inter( + fontWeight: FontWeight.w600, + fontSize: 14, + color: Colors.white, +); + +final _title = GoogleFonts.inter( + fontWeight: FontWeight.bold, + fontSize: 16, + // color: Colors.red, + color: const Color(0xff425B5B), +); + +final _tableDataStyle = GoogleFonts.inter( + fontSize: 14, + fontWeight: FontWeight.w500, +); + +final topHeaderStyle = GoogleFonts.inter( + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.w500, +); diff --git a/lib/presentation/screens/login/login_screen.dart b/lib/presentation/screens/login/login_screen.dart index 8e46963..1a30e42 100644 --- a/lib/presentation/screens/login/login_screen.dart +++ b/lib/presentation/screens/login/login_screen.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'dart:io'; import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; @@ -46,6 +48,7 @@ class _LoginScreenState extends ConsumerState { bool enteredEmailOrMobile = false; dynamic clickedButtonName; dynamic token; + dynamic fCMToken; // Future _handleLogin() async { // if (!_formKey.currentState!.validate()) return; @@ -104,6 +107,20 @@ class _LoginScreenState extends ConsumerState { _countryController.text = "+91"; } + Future initNotification() async { + try { + // await _firebaseMessaging.requestPermission(); + fCMToken = await FirebaseMessaging.instance.getToken(); + print('Token : $fCMToken'); + + if (fCMToken != null) { + // await sendDeviceToken(fCMToken); + } + } catch (e) { + print("Error getting FCM Token: $e"); + } + } + Future _saveUserRole(String token) async { final prefs = await SharedPreferences.getInstance(); final decodedToken = Jwt.parseJwt(token); @@ -747,41 +764,41 @@ class _LoginScreenState extends ConsumerState { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const SizedBox(height: 30), + const SizedBox(height: 15), Image.asset( "assets/login/nhance-partner-logo.png", - height: 45, + height: 35, ), - const SizedBox(height: 30), + const SizedBox(height: 10), Text( "Welcome Back", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xFF425C5C), ), ), - const SizedBox(height: 20), - Image.asset("assets/login/login-content.png", height: 180), const SizedBox(height: 10), + Image.asset("assets/login/login-content.png", height: 120), + // const SizedBox(height: 10), Container( - padding: EdgeInsets.symmetric(vertical: 20, horizontal: 50), + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 50), child: Text( - '${'"'}Manage vsdv your policies, track quotations, and grow your business all in one place.${'"'}', + '${'"'}Manage your policies, track quotations, and grow your business all in one place.${'"'}', textAlign: TextAlign.center, style: TextStyle( - fontSize: 11, + fontSize: 14, color: Color(0xFF000000), fontWeight: FontWeight.w500, ), ), ), - const SizedBox(height: 20), + const SizedBox(height: 10), Container( width: double.infinity, - height: MediaQuery.of( - context, - ).size.height, // full screen height + height: + MediaQuery.of(context).size.height * + 0.8, // full screen height padding: const EdgeInsets.all(20), decoration: const BoxDecoration( gradient: LinearGradient( @@ -816,7 +833,7 @@ class _LoginScreenState extends ConsumerState { Text( "Login to your account", style: TextStyle( - fontSize: ResponsiveLayout.isMobile(context) ? 28 : 35, + fontSize: ResponsiveLayout.isMobile(context) ? 20 : 35, fontWeight: FontWeight.w600, color: Colors.white, ), @@ -826,7 +843,7 @@ class _LoginScreenState extends ConsumerState { "Enter your email or mobile number to receive a one time password.", textAlign: TextAlign.center, style: TextStyle( - fontSize: ResponsiveLayout.isMobile(context) ? 14 : 18, + fontSize: ResponsiveLayout.isMobile(context) ? 12 : 18, color: Colors.white, fontWeight: FontWeight.w600, ), @@ -1129,19 +1146,22 @@ class _LoginScreenState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - child: Text( - 'OTP', - style: TextStyle( - fontSize: ResponsiveLayout.isMobile(context) - ? 14 - : 18, - fontWeight: FontWeight.w600, - color: Colors.white, + child: Center( + child: Text( + 'OTP', + style: TextStyle( + fontSize: ResponsiveLayout.isMobile(context) + ? 14 + : 18, + fontWeight: FontWeight.w600, + color: Colors.white, + ), ), ), ), const SizedBox(height: 10), Container( + alignment: Alignment.center, child: Pinput( length: 6, defaultPinTheme: defaultPinTheme, @@ -1191,49 +1211,104 @@ class _LoginScreenState extends ConsumerState { ), ), const SizedBox(height: 20), - SizedBox( - width: 400, - child: CommonButton( - text: "Continue", - backgroundColor: Color(0xFF436462), - onPressed: () async { - if (switcherStatus == 1) { - await verifyFirebaseMobileOTP(); - } else { - await verifyMobileOrMailOTP( - _otpController.text, - ); - } - }, + Container( + alignment: Alignment.center, // center the text + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: 'Didn’t Receive Code? ', // normal text + style: TextStyle( + fontSize: ResponsiveLayout.isMobile(context) + ? 12 + : 14, + fontWeight: FontWeight.normal, + color: Colors.white, + ), + children: [ + TextSpan( + text: 'Resend', // bold clickable part + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + decoration: TextDecoration + .underline, // optional + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + print('Resend clicked'); + print(enteredEmailOrMobile); + print(clickedButtonName); + if (_PhoneNumberController + .text + .isNotEmpty) { + print('1224'); + _resendCode( + _PhoneNumberController.text, + _resendToken, + ); + } else if (_PhoneNumberController + .text + .isEmpty) { + print('1227'); + sendMobileOrEmailVerify( + clickedButtonName, + ); + } else { + print('data not found'); + } + }, + ), + ], + ), + ), + ), + const SizedBox(height: 20), + + Center( + child: SizedBox( + width: 400, + child: CommonButton( + text: "Continue", + backgroundColor: Color(0xFF436462), + onPressed: () async { + if (switcherStatus == 1) { + await verifyFirebaseMobileOTP(); + } else { + await verifyMobileOrMailOTP( + _otpController.text, + ); + } + }, + ), + // ElevatedButton( + // style: ElevatedButton.styleFrom( + // backgroundColor: const Color(0xFF436462), + // padding: const EdgeInsets.symmetric( + // vertical: 16, + // ), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8), + // ), + // ), + // onPressed: () { + // if (switcherStatus == 1) { + // verifyFirebaseMobileOTP(); + // } else { + // verifyMobileOrMailOTP(_otpController.text); + // } + // }, + // child: Text( + // 'Continue', + // style: TextStyle( + // fontSize: ResponsiveLayout.isMobile(context) + // ? 18 + // : 20, + // fontWeight: FontWeight.w600, + // color: Colors.white, + // ), + // ), + // ), ), - // ElevatedButton( - // style: ElevatedButton.styleFrom( - // backgroundColor: const Color(0xFF436462), - // padding: const EdgeInsets.symmetric( - // vertical: 16, - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(8), - // ), - // ), - // onPressed: () { - // if (switcherStatus == 1) { - // verifyFirebaseMobileOTP(); - // } else { - // verifyMobileOrMailOTP(_otpController.text); - // } - // }, - // child: Text( - // 'Continue', - // style: TextStyle( - // fontSize: ResponsiveLayout.isMobile(context) - // ? 18 - // : 20, - // fontWeight: FontWeight.w600, - // color: Colors.white, - // ), - // ), - // ), ), ], ) @@ -1258,12 +1333,16 @@ class _LoginScreenState extends ConsumerState { _PhoneNumberController.text = ''; _emailController.text = ''; _otpController.text = ''; + _PhoneNumberController.clear(); + _emailController.clear(); + _otpController.clear(); if (selectedIndex == 2) { switcherStatus = 0; } else { switcherStatus = 1; } }); + _formKey.currentState?.reset(); }, child: Container( padding: EdgeInsets.only( diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_list.dart b/lib/presentation/screens/staff/Enquiry/enquiry_list.dart index 973f379..0f2a518 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_list.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_list.dart @@ -7,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/config/env.dart'; import '../../../../core/routing/routes.dart'; @@ -236,9 +237,23 @@ class EnquiryStaffState extends ConsumerState { Material( color: Colors.transparent, child: InkWell( - onTap: () { + onTap: () async { Navigator.pop(context); + final prefs = await SharedPreferences.getInstance(); + + // ✅ Remove old value (if any) + await prefs.remove('enqStaffDataId'); + + // ✅ Save the new id + await prefs.setString('enqStaffDataId', id.toString()); + + // Read it back if needed + // final dynamic? enqStaffDataId = prefs.getString('enqStaffDataId'); + + // ✅ Update provider too + // ref.read(quotationStaffIdProvider.notifier).state = enqStaffDataId; ref.read(quotationStaffIdProvider.notifier).state = id; + context.go(AppRoutes.quotation); }, hoverColor: Color(0xFFE3F1F0), @@ -271,8 +286,19 @@ class EnquiryStaffState extends ConsumerState { Material( color: Colors.transparent, child: InkWell( - onTap: () { + onTap: () async { Navigator.pop(context); + + final prefs = await SharedPreferences.getInstance(); + + // ✅ Remove old value (if any) + await prefs.remove('enqStaffDataId'); + + // ✅ Save the new id + await prefs.setString('enqStaffDataId', id.toString()); + + // ✅ Update provider too + ref.read(quotationStaffIdProvider.notifier).state = id; context.go(AppRoutes.policy); }, @@ -372,13 +398,14 @@ class EnquiryStaffState extends ConsumerState { Spacer(), ExportBtn( - sheetName: "Policy", - fileName: "Policy_list", + sheetName: "Enquiry", + fileName: "Enquiry_list", data: filteredData, txt: !ResponsiveLayout.isMobile(context) ? true : false, headers: [ + "updated_on", "reg_no", "agent_name", "assigned_to_name", @@ -386,7 +413,7 @@ class EnquiryStaffState extends ConsumerState { "insured_name", "premium_amount", "payment_mode", - "updated_on", + "policy_number", "status", ], ), @@ -446,7 +473,7 @@ class EnquiryStaffState extends ConsumerState { child: const Row( children: [ Expanded( - flex: 2, + flex: 3, child: Text('Date', style: _headerStyle), ), @@ -467,7 +494,7 @@ class EnquiryStaffState extends ConsumerState { child: Text('Insurer', style: _headerStyle), ), Expanded( - flex: 2, + flex: 3, child: Text('Insured Name', style: _headerStyle), ), Expanded( @@ -579,7 +606,7 @@ class EnquiryStaffState extends ConsumerState { child: Row( children: [ Expanded( - flex: 2, + flex: 3, child: Text( _formatDate(item['updated_on']) ?? '-', style: _dataBold, @@ -613,7 +640,7 @@ class EnquiryStaffState extends ConsumerState { ), ), Expanded( - flex: 2, + flex: 3, child: Text( item['insured_name'] ?? '-', style: _dataBold, diff --git a/lib/presentation/screens/staff/policy/policy.dart b/lib/presentation/screens/staff/policy/policy.dart index ecebd36..a24fa15 100644 --- a/lib/presentation/screens/staff/policy/policy.dart +++ b/lib/presentation/screens/staff/policy/policy.dart @@ -1,4 +1,5 @@ // import 'dart:io' as html; +import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import 'package:dropdown_search/dropdown_search.dart'; import 'package:flutter/cupertino.dart'; @@ -7,6 +8,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/config/env.dart'; import '../../../../core/routing/routes.dart'; @@ -149,6 +151,10 @@ class PolicyScreenState extends ConsumerState { // getQuotationList(managerId); // }); + if (kIsWeb) { + Future.microtask(() => _restoreManagerId(ref)); + } + Future.microtask(() { managerId = ref.read(managerIdProvider); // ✅ use read userId = ref.read(userIdProvider); // ✅ use read @@ -162,6 +168,20 @@ class PolicyScreenState extends ConsumerState { }); } + Future _restoreManagerId(WidgetRef ref) async { + final prefs = await SharedPreferences.getInstance(); + + final String? savedId = prefs.getString( + 'enqStaffDataId', + ); // already a string + if (savedId != null) { + ref.read(quotationStaffIdProvider.notifier).state = savedId; + print("savedenqStaffDataId ID restored: $savedId"); + + _loadData(savedId); + } + } + @override void dispose() { // Dispose all TextEditingControllers @@ -510,7 +530,7 @@ class PolicyScreenState extends ConsumerState { width: MediaQuery.of(context).size.width, child: GestureDetector( onTap: () { - context.go(AppRoutes.policylist); + context.go(AppRoutes.enquiryForStaff); }, child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -1215,12 +1235,13 @@ class PolicyScreenState extends ConsumerState { Widget buildUploadPolicyPdf(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Text('Upload Policy PDF * ', style: _textStyle), const SizedBox(height: 10), Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ ThemedUploadField( hintText: selectedPDFFileNames ?? "Upload Document", @@ -1241,6 +1262,7 @@ class PolicyScreenState extends ConsumerState { Container( // color: Colors.white, child: Row( + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.end, children: [ GestureDetector( @@ -1313,6 +1335,7 @@ class PolicyScreenState extends ConsumerState { Container( // color: Colors.white, child: Row( + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.end, children: [ GestureDetector( diff --git a/lib/presentation/screens/staff/policy/policy_list.dart b/lib/presentation/screens/staff/policy/policy_list.dart index 111b236..8f2cc5e 100644 --- a/lib/presentation/screens/staff/policy/policy_list.dart +++ b/lib/presentation/screens/staff/policy/policy_list.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; import 'package:nhance_partner/presentation/providers/userRoleProvider.dart'; import 'package:nhance_partner/presentation/screens/staff/assignStaff.dart'; @@ -312,7 +313,7 @@ class policylistState extends ConsumerState { ), Text( "Policy", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 18, fontWeight: FontWeight.w600, ), @@ -398,7 +399,7 @@ class policylistState extends ConsumerState { // }, // child: Text( // 'Create New Staff', - // style: TextStyle( + // style: GoogleFonts.inter( // color: Colors.white, // fontWeight: FontWeight.w600, // fontSize: 14, @@ -424,10 +425,10 @@ class policylistState extends ConsumerState { vertical: 12, horizontal: 16, ), - child: const Row( + child: Row( children: [ Expanded( - flex: 2, + flex: 3, child: Text('Date', style: _headerStyle), ), Expanded( @@ -559,7 +560,7 @@ class policylistState extends ConsumerState { child: Row( children: [ Expanded( - flex: 2, + flex: 3, child: Text( _formatDate(item['updated_on']) ?? '-', style: _dataBold, @@ -726,7 +727,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Company", style: _cardheaderStyle), + Text("Company", style: _cardheaderStyle), Text(item['insurer_name'] ?? '-', style: _cardBodyStyle), ], ), @@ -736,7 +737,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Status", style: _cardheaderStyle), + Text("Status", style: _cardheaderStyle), Text(item['status'] ?? '-', style: _cardBodyStyle), ], ), @@ -752,7 +753,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Agent", style: _cardheaderStyle), + Text("Agent", style: _cardheaderStyle), Text(item['agent_name'] ?? '-', style: _cardBodyStyle), ], ), @@ -762,7 +763,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Assigned To", style: _cardheaderStyle), + Text("Assigned To", style: _cardheaderStyle), Text( item['assigned_to_name'] ?? '-', style: _cardBodyStyle, @@ -781,7 +782,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Insured Name", style: _cardheaderStyle), + Text("Insured Name", style: _cardheaderStyle), Text(item['insured_name'] ?? '-', style: _cardBodyStyle), ], ), @@ -791,7 +792,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Premium", style: _cardheaderStyle), + Text("Premium", style: _cardheaderStyle), Text(item['premium_amount'] ?? '-', style: _cardBodyStyle), ], ), @@ -807,7 +808,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Payment Mode", style: _cardheaderStyle), + Text("Payment Mode", style: _cardheaderStyle), Text(item['payment_mode'] ?? '-', style: _cardBodyStyle), ], ), @@ -817,7 +818,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Policy Number", style: _cardheaderStyle), + Text("Policy Number", style: _cardheaderStyle), Text(item['policy_number'] ?? '-', style: _cardBodyStyle), ], ), @@ -833,7 +834,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Date", style: _cardheaderStyle), + Text("Date", style: _cardheaderStyle), Text( _formatDate(item['updated_on']) ?? '-', style: _cardBodyStyle, @@ -846,7 +847,7 @@ class policylistState extends ConsumerState { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text("Remarks", style: _cardheaderStyle), + Text("Remarks", style: _cardheaderStyle), Text( item['remarks'] ?? '-', style: _cardBodyStyle, @@ -862,31 +863,31 @@ class policylistState extends ConsumerState { ); } - static final _dataBold = TextStyle( + static final _dataBold = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF000000), ); - static final _dataSub = TextStyle( + static final _dataSub = GoogleFonts.inter( fontSize: 10, fontWeight: FontWeight.w300, color: Color(0xFF585757), ); - static const _headerStyle = TextStyle( + static final _headerStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.bold, ); - static const _cardheaderStyle = TextStyle( + static final _cardheaderStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 12, ); - static const _cardBodyStyle = TextStyle( - color: Color(0xFF545454), + static final _cardBodyStyle = GoogleFonts.inter( + color: const Color(0xFF545454), fontWeight: FontWeight.w400, fontSize: 12, ); diff --git a/lib/presentation/screens/staff/quotations/quotation.dart b/lib/presentation/screens/staff/quotations/quotation.dart index 69ff367..8a125b9 100644 --- a/lib/presentation/screens/staff/quotations/quotation.dart +++ b/lib/presentation/screens/staff/quotations/quotation.dart @@ -3,10 +3,12 @@ import 'dart:io' as html; import 'package:dropdown_search/dropdown_search.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/routing/routes.dart'; import '../../../../core/services/api_service.dart'; @@ -32,6 +34,8 @@ class QuotationScreenState extends ConsumerState { int currentPage = 0; int itemsPerPage = 10; + bool blockKey = false; + List> dataVal = []; final TextEditingController _searchController = TextEditingController(); @@ -94,11 +98,29 @@ class QuotationScreenState extends ConsumerState { List> filteredData = []; // bool isLoading = false; + Future _restoreManagerId(WidgetRef ref) async { + final prefs = await SharedPreferences.getInstance(); + + final String? savedId = prefs.getString( + 'enqStaffDataId', + ); // already a string + if (savedId != null) { + ref.read(quotationStaffIdProvider.notifier).state = savedId; + print("savedenqStaffDataId ID restored: $savedId"); + + _loadData(savedId); + } + } + @override void initState() { super.initState(); apiService = ApiService(); + if (kIsWeb) { + Future.microtask(() => _restoreManagerId(ref)); + } + for (String field in tabHeader) { controllers[field] = TextEditingController(); } @@ -137,7 +159,7 @@ class QuotationScreenState extends ConsumerState { selectedEnquiryId = enquiryData['id']; print('selectedEnquiryId- $selectedEnquiryId'); controllers["regNum"]?.text = enquiryData['reg_no']; - controllers["insurer"]?.text = enquiryData['insurer_id']; + controllers["insurer"]?.text = enquiryData['insurer_name']; }); } @@ -171,6 +193,9 @@ class QuotationScreenState extends ConsumerState { ); originalData = getQuotationData; filteredData = List.from(originalData); + + blockKey = getQuotationData.any((item) => item['status'] == 'Accepted'); + print('blockKey- $blockKey'); // print('originalData - $getClaimPolicies'); }); } else { @@ -188,12 +213,12 @@ class QuotationScreenState extends ConsumerState { Color _getStatusColor(String? status) { switch (status) { + case 'Pending': + return Colors.yellow; case 'Accepted': return Colors.green; case 'Rejected': return Colors.red; - case 'Pending': - return Colors.yellow; default: return Colors.grey; } @@ -261,7 +286,7 @@ class QuotationScreenState extends ConsumerState { width: MediaQuery.of(context).size.width, child: GestureDetector( onTap: () { - context.go(AppRoutes.policylist); + context.go(AppRoutes.enquiryForStaff); }, child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -274,7 +299,7 @@ class QuotationScreenState extends ConsumerState { ), Text( "Quotation", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 18, fontWeight: FontWeight.w600, ), @@ -360,6 +385,7 @@ class QuotationScreenState extends ConsumerState { ], const SizedBox(height: 20), + if(!blockKey)...[ Container( padding: EdgeInsets.only(right: 10), child: Row( @@ -368,6 +394,10 @@ class QuotationScreenState extends ConsumerState { GestureDetector( onTap: () { // print('Export'); + setState(() { + selectedQuotationFrmListId = null; + selectedQuotationFrmListData = null; + }); showDialog( context: context, @@ -420,7 +450,7 @@ class QuotationScreenState extends ConsumerState { ), ), - const SizedBox(height: 20), + const SizedBox(height: 20),], //3RD SECTION (TABLE) Container( @@ -503,11 +533,11 @@ class QuotationScreenState extends ConsumerState { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - const Text( + Text( "Download RC", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 12, - fontWeight: FontWeight.w200, + fontWeight: FontWeight.w500, color: Colors.white, ), ), @@ -546,9 +576,9 @@ class QuotationScreenState extends ConsumerState { children: [ Text( "Download ID Proof", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 12, - fontWeight: FontWeight.w200, + fontWeight: FontWeight.w500, color: Colors.white, ), ), @@ -583,9 +613,9 @@ class QuotationScreenState extends ConsumerState { children: [ Text( "Download Previous Policy", - style: TextStyle( + style: GoogleFonts.inter( fontSize: 12, - fontWeight: FontWeight.w200, + fontWeight: FontWeight.w500, color: Colors.white, ), ), @@ -719,7 +749,7 @@ class QuotationScreenState extends ConsumerState { borderRadius: BorderRadius.circular(6), ), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), - child: const Row( + child: Row( children: [ // Expanded(flex: 3, child: Text(' ', style: _headerStyle)), Expanded( @@ -779,7 +809,11 @@ class QuotationScreenState extends ConsumerState { flex: 2, child: Text( item['status'] ?? '-', - style: _dataBold.copyWith(color: _getStatusColor(item['status'])), + style: GoogleFonts.inter( + fontSize: 14, + fontWeight: FontWeight.w400, + color: _getStatusColor(item['status']), + ), ), ), @@ -905,7 +939,7 @@ class QuotationScreenState extends ConsumerState { children: [ TextSpan( text: 'Status : ', // key - style: TextStyle( + style: GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 11, @@ -913,7 +947,7 @@ class QuotationScreenState extends ConsumerState { ), TextSpan( text: '${item['status'] ?? '-'}', // value - style: TextStyle( + style: GoogleFonts.inter( color: _getStatusColor(item['status']), fontWeight: FontWeight.w600, fontSize: 11, @@ -937,49 +971,49 @@ class QuotationScreenState extends ConsumerState { ); } - static final _dataBold = TextStyle( + static final _dataBold = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFF000000), ); - static final _dataSub = TextStyle( + static final _dataSub = GoogleFonts.inter( fontSize: 10, fontWeight: FontWeight.w300, color: Color(0xFF585757), ); - static const _headerStyle = TextStyle( + static final _headerStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.bold, ); - static const _textStyle = TextStyle( + static final _textStyle = GoogleFonts.inter( fontSize: 14, fontWeight: FontWeight.w600, ); - static const _cardheaderStyle = TextStyle( + static final _cardheaderStyle = GoogleFonts.inter( color: Colors.black, fontWeight: FontWeight.w600, fontSize: 12, ); - static const _cardBodyStyle = TextStyle( + static final _cardBodyStyle = GoogleFonts.inter( color: Color(0xFF545454), fontWeight: FontWeight.w400, fontSize: 12, ); - static const _cardRow1BodyStyle = TextStyle( + static final _cardRow1BodyStyle = GoogleFonts.inter( // color: Color(0xFF545454), color: Colors.black, fontWeight: FontWeight.w500, fontSize: 12, ); - static const _cardRow2BodyStyle = TextStyle( - color: Color(0xFF545454), + static final _cardRow2BodyStyle = GoogleFonts.inter( + color: const Color(0xFF545454), // color: Colors.black, fontWeight: FontWeight.w500, fontSize: 12, diff --git a/lib/presentation/themes/indicators/export_btn.dart b/lib/presentation/themes/indicators/export_btn.dart index 0754c1f..4891197 100644 --- a/lib/presentation/themes/indicators/export_btn.dart +++ b/lib/presentation/themes/indicators/export_btn.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:io'; import 'package:excel/excel.dart'; import 'package:flutter/material.dart'; @@ -62,7 +63,12 @@ class ExportBtn extends HookWidget { ) : null, ?txt! ? SizedBox(width: 20) : null, - Icon(Icons.input_sharp, color: Colors.white), + Image.asset( + "assets/miscellaneous/export.png", + height: 25, + width: 25, + ), + // Icon(Icons.input_sharp, color: Colors.white), // Image.asset("assets/miscellaneous/export", height: 15, width: 15), ], ), @@ -71,6 +77,8 @@ class ExportBtn extends HookWidget { } } + + class ExcelExporter { static Future exportToExcel({ required String sheetName, @@ -79,14 +87,16 @@ class ExcelExporter { required String fileName, }) async { try { - // Create Excel and delete default sheet + // Create Excel var excel = Excel.createExcel(); + + // Rename default sheet if (excel.sheets.containsKey('Sheet1')) { - excel.delete('Sheet1'); + excel.rename('Sheet1', sheetName); } - // Create your sheet - Sheet sheetObject = excel[sheetName]; // now this is the only sheet + // Get the sheet + Sheet sheetObject = excel[sheetName]!; // Add headers sheetObject.appendRow(headers.map((h) => TextCellValue(h)).toList()); @@ -112,13 +122,12 @@ class ExcelExporter { var bytes = excel.encode()!; if (kIsWeb) { - // Web: download - final blob = html.Blob([bytes]); - final url = html.Url.createObjectUrlFromBlob(blob); - final anchor = html.AnchorElement(href: url) + // ✅ Web: base64 download instead of Blob + final base64Str = base64Encode(bytes); + final dataUri = "data:application/octet-stream;base64,$base64Str"; + final anchor = html.AnchorElement(href: dataUri) ..setAttribute("download", "$fileName.xlsx") ..click(); - html.Url.revokeObjectUrl(url); } else { // Mobile/Desktop: save file final dir = await getApplicationDocumentsDirectory(); @@ -132,6 +141,71 @@ class ExcelExporter { } } + +// class ExcelExporter { +// static Future exportToExcel({ +// required String sheetName, +// required List> data, +// required List headers, +// required String fileName, +// }) async { +// try { +// // Create Excel and delete default sheet +// var excel = Excel.createExcel(); +// if (excel.sheets.containsKey('Sheet1')) { +// excel.delete('Sheet1'); +// } +// +// // Create your sheet +// Sheet sheetObject = excel[sheetName]; // now this is the only sheet +// +// // Add headers +// sheetObject.appendRow(headers.map((h) => TextCellValue(h)).toList()); +// +// // Add data +// for (var rowData in data) { +// var row = []; +// for (var key in headers) { +// final value = rowData[key]; +// if (value == null) { +// row.add(TextCellValue('-')); +// } else if (value is int) { +// row.add(IntCellValue(value)); +// } else if (value is double) { +// row.add(DoubleCellValue(value)); +// } else { +// row.add(TextCellValue(value.toString())); +// } +// } +// sheetObject.appendRow(row); +// } +// +// var bytes = excel.encode()!; +// +// if (kIsWeb) { +// // Web: download +// final blob = html.Blob([bytes]); +// final url = html.Url.createObjectUrlFromBlob(blob); +// final anchor = html.AnchorElement(href: url) +// ..setAttribute("download", "$fileName.xlsx") +// ..click(); +// html.Url.revokeObjectUrl(url); +// } else { +// // Mobile/Desktop: save file +// final dir = await getApplicationDocumentsDirectory(); +// final file = File('${dir.path}/$fileName.xlsx'); +// await file.writeAsBytes(bytes); +// await OpenFile.open(file.path); +// } +// } catch (e) { +// print("Error exporting Excel: $e"); +// } +// } +// } + + +//--------------------------------------------------------------------------- + // class ExcelExporter { // static Future exportToExcel({ // required String sheetName, diff --git a/lib/presentation/themes/indicators/text_field_theme.dart b/lib/presentation/themes/indicators/text_field_theme.dart index 8417182..a761a42 100644 --- a/lib/presentation/themes/indicators/text_field_theme.dart +++ b/lib/presentation/themes/indicators/text_field_theme.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:google_fonts/google_fonts.dart'; // import 'package:uae_stat/config/my_theme.dart'; @@ -103,7 +104,13 @@ class ThemedFormField extends HookWidget { // ✅ dynamic hint color color: const Color(0xFFC3C6CB), ), - labelStyle: TextStyle(fontSize: 12), + // labelText: hintText, + // labelStyle: GoogleFonts.inter( + // fontSize: 10, + // // color: Colors.black, // customize here + // color: Colors.red, // customize here + // fontWeight: FontWeight.w400, + // ), prefixIconConstraints: const BoxConstraints( maxWidth: 25 + 16 + 10, maxHeight: 25 + (8 * 2), @@ -139,6 +146,11 @@ class ThemedFormField extends HookWidget { // ✅ allow multiline if user sets maxLines / minLines minLines: (keyboardType == TextInputType.multiline) ? 3 : 1, maxLines: (keyboardType == TextInputType.multiline) ? null : 1, + style: GoogleFonts.inter( + fontSize: 14, // 👈 Change this to your desired size + fontWeight: FontWeight.w400, // optional + color: Colors.black, // optional + ), ), ), ); diff --git a/lib/presentation/widgets/drawer_menu.dart b/lib/presentation/widgets/drawer_menu.dart index db65e2c..9e02419 100644 --- a/lib/presentation/widgets/drawer_menu.dart +++ b/lib/presentation/widgets/drawer_menu.dart @@ -219,29 +219,6 @@ class DrawerMenuState extends ConsumerState { ), DrawerLabel("Dashboard"), - Builder( - builder: (itemContext) { - return MouseRegion( - // onEnter: (_) => _showPopup(itemContext), - onEnter: (_) { - final renderBox = itemContext.findRenderObject() as RenderBox; - final offset = renderBox.localToGlobal(Offset.zero); - final size = renderBox.size; - final key = "Reports"; - _showPopup(context, offset, size, key); - }, - - child: DrawerContentWrapper( - child: Image.asset( - "assets/drawer/drawerImg2.png", - height: 25, - width: 25, - ), - ), - ); - }, - ), - DrawerLabel("Reports"), DrawerContentWrapper( child: Consumer( builder: (context, ref, _) { @@ -290,6 +267,30 @@ class DrawerMenuState extends ConsumerState { ), DrawerLabel("User"), ], + + Builder( + builder: (itemContext) { + return MouseRegion( + // onEnter: (_) => _showPopup(itemContext), + onEnter: (_) { + final renderBox = itemContext.findRenderObject() as RenderBox; + final offset = renderBox.localToGlobal(Offset.zero); + final size = renderBox.size; + final key = "Reports"; + _showPopup(context, offset, size, key); + }, + + child: DrawerContentWrapper( + child: Image.asset( + "assets/drawer/drawerImg2.png", + height: 25, + width: 25, + ), + ), + ); + }, + ), + DrawerLabel("Reports"), ], ), ); diff --git a/lib/presentation/widgets/mobile_tabs.dart b/lib/presentation/widgets/mobile_tabs.dart index ca0b4f4..1880d04 100644 --- a/lib/presentation/widgets/mobile_tabs.dart +++ b/lib/presentation/widgets/mobile_tabs.dart @@ -100,28 +100,48 @@ class _MobileBottomMenuState extends ConsumerState { }, items: [ BottomNavigationBarItem( - icon: Image.asset( - "assets/drawer/drawerImg1.png", - height: 20, - width: 20, - ), + icon: _currentIndex == 0 + ? Image.asset( + "assets/drawer/drawerImg1_light.png", + height: 20, + width: 20, + ) + : Image.asset( + "assets/drawer/drawerImg1.png", + height: 20, + width: 20, + ), label: "Dashboard", ), BottomNavigationBarItem( - icon: Image.asset( - "assets/drawer/drawerImg2.png", - height: 20, - width: 20, - ), + icon: _currentIndex == 1 + ? Image.asset( + "assets/drawer/drawerImg2_light.png", + height: 20, + width: 20, + ) + : Image.asset( + "assets/drawer/drawerImg2.png", + height: 20, + width: 20, + ), label: "Reports", ), - const BottomNavigationBarItem( - icon: Icon(Icons.list_alt_rounded, size: 24, color: Colors.black), + BottomNavigationBarItem( + icon: Icon( + Icons.list_alt_rounded, + size: 24, + color: _currentIndex == 2 ? Colors.white : Colors.black, + ), label: "Enquiry", ), - const BottomNavigationBarItem( - icon: Icon(Icons.person_add_alt, size: 24, color: Colors.black), + BottomNavigationBarItem( + icon: Icon( + Icons.person_add_alt, + size: 24, + color: _currentIndex == 3 ? Colors.white : Colors.black, + ), label: "User", ), ], diff --git a/lib/presentation/widgets/topbar.dart b/lib/presentation/widgets/topbar.dart index 316abef..8096849 100644 --- a/lib/presentation/widgets/topbar.dart +++ b/lib/presentation/widgets/topbar.dart @@ -39,6 +39,14 @@ class TopBar extends StatelessWidget implements PreferredSizeWidget { width: 120, ), if (isMobile) ...[ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + "assets/login/nhance-partner-logo.png", + height: 40, + width: 90, + ), + ), // IconButton( // icon: const Icon( // Icons.arrow_back_ios, @@ -47,17 +55,17 @@ class TopBar extends StatelessWidget implements PreferredSizeWidget { // ), // onPressed: onBack ?? () => Navigator.pop(context), // ), - SizedBox(width: 5), - Expanded( - child: Text( - title, - style: const TextStyle( - color: Colors.black87, - fontWeight: FontWeight.w500, - fontSize: 16, - ), - ), - ), + // SizedBox(width: 5), + // Expanded( + // child: Text( + // title, + // style: const TextStyle( + // color: Colors.black87, + // fontWeight: FontWeight.w500, + // fontSize: 16, + // ), + // ), + // ), ], Spacer(), @@ -98,6 +106,7 @@ class TopBar extends StatelessWidget implements PreferredSizeWidget { // icon: const Icon(Icons.person_outline, color: Colors.black87), // onPressed: onProfile, // ), + ], SizedBox(width: 10), Container( width: 40, @@ -111,7 +120,7 @@ class TopBar extends StatelessWidget implements PreferredSizeWidget { onPressed: onLogout, ), ), - ], + ], ), ); diff --git a/lib_29_sep.zip b/lib_29_sep.zip new file mode 100644 index 0000000..db97910 Binary files /dev/null and b/lib_29_sep.zip differ