diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 36c37a5..7d480df 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":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.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":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.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":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.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":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"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-11-21 14:33:18.462170","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.1/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_ios","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.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":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.30/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_android-7.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_android-2.2.18/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_android","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_app_check","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.1.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"url_launcher_linux","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth-6.0.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core-4.1.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"url_launcher_windows","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/file_picker-10.3.3/","dependencies":[],"dev_dependency":false},{"name":"firebase_app_check_web","path":"/Users/venbateam/.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":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_auth_web-6.0.2/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_core_web-3.1.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.0.1/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/google_sign_in_web-1.0.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/Users/venbateam/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"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":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"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-11-20 11:03:06.002014","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}} diff --git a/lib/core/routing/app_router.dart b/lib/core/routing/app_router.dart index 8b4f2a2..b132a91 100644 --- a/lib/core/routing/app_router.dart +++ b/lib/core/routing/app_router.dart @@ -6,6 +6,7 @@ import 'package:nhance_partner/presentation/screens/Enquiry/enquiryList.dart'; import 'package:nhance_partner/presentation/screens/Masters/PaymentMode/paymentList.dart'; import 'package:nhance_partner/presentation/screens/UserManagement/Profile/profile_web.dart'; import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart'; +import 'package:nhance_partner/presentation/screens/payout/invoice_list.dart'; import '../../data/services/auth_service.dart'; import '../../presentation/providers/manager_provider.dart'; @@ -24,6 +25,7 @@ import '../../presentation/screens/handler/enquiryList.dart'; import '../../presentation/screens/handler/enquiryListOld.dart'; import '../../presentation/screens/home/home_screen.dart'; import '../../presentation/screens/login/login_screen.dart'; +import '../../presentation/screens/payout/payout_screen.dart'; import '../../presentation/screens/splash/splash_screen.dart'; import '../../presentation/screens/staff/Enquiry/enquiry_inline_list.dart'; import '../../presentation/screens/staff/Enquiry/enquiry_list.dart'; @@ -52,6 +54,19 @@ final GoRouter appRouter = GoRouter( builder: (context, state) => const DashboardScreen(), ), + GoRoute( + path: AppRoutes.payout, + builder: (context, state) { + final editItem = state.extra as Map?; + return PayOutScreen(editItem: editItem); + }, + ), + + GoRoute( + path: AppRoutes.invoiceList, + builder: (context, state) => const InvoiceList(), + ), + GoRoute( path: AppRoutes.profile, builder: (context, state) => const Profile(), diff --git a/lib/core/routing/routes.dart b/lib/core/routing/routes.dart index 1a05841..704569d 100644 --- a/lib/core/routing/routes.dart +++ b/lib/core/routing/routes.dart @@ -22,6 +22,8 @@ class AppRoutes { static const String quotation = '/QuotationScreen'; static const String policy = '/PolicyScreen'; + static const String payout = '/payout'; + static const String invoiceList = '/invoiceList'; static const String brokerLst = '/brokerLst'; static const String paymentModeLst = '/paymentMode'; } diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index 64c7c7a..18d102b 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -1209,4 +1209,99 @@ class ApiService { throw Exception('Error fetching options: $e'); } } + + // --------------------------------- PayOut Module---------------------------------------------- + Future> getCommissionRateList(data) async { + + final url = Uri.parse('${Env.apiUrl}/invoice/commission-rate-list'); + + // final token = await getToken(); // Fetch token + + if (_token == null) { + throw Exception('Token not found. Please log in.'); + } + + print("data------- $data}"); + + final headers = { + 'Authorization': 'Bearer $_token', + 'Content-Type': 'application/json', + 'app-signature': Env.App_Signature, + // 'app-signature': 'nhance-partner-2025-signature-35468846JRhH551HK', + }; + + final response = await _makePostRequestJson(url, data, headers); + return response; + } + + Future> getCreateOrUpdate(data) async { + + final url = Uri.parse('${Env.apiUrl}/invoice/create-or-update'); + + // final token = await getToken(); // Fetch token + + if (_token == null) { + throw Exception('Token not found. Please log in.'); + } + + print("data------- $data}"); + + final headers = { + 'Authorization': 'Bearer $_token', + 'Content-Type': 'application/json', + 'app-signature': Env.App_Signature, + // 'app-signature': 'nhance-partner-2025-signature-35468846JRhH551HK', + }; + + final response = await _makePostRequestJson(url, data, headers); + return response; + } + + Future> getInvoiceList() async { + // print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url = Uri.parse('${Env.apiUrl}invoice/list'); + + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + 'app-signature': Env.App_Signature, + }; + final response = await _makeGetRequest(url, headers); + return response; + } + + Future> deleteInvoice(ID) async { + // print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url = Uri.parse('${Env.apiUrl}invoice/delete?id=$ID'); + + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + 'app-signature': Env.App_Signature, + }; + final response = await _makeGetRequest(url, headers); + return response; + } + + Future> getInvoiceDetails(ID) async { + // print(_token); + if (_token == null) { + await _initializeToken(); + } + + final url = Uri.parse('${Env.apiUrl}invoice/details?id=$ID'); + + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + 'app-signature': Env.App_Signature, + }; + final response = await _makeGetRequest(url, headers); + return response; + } } diff --git a/lib/presentation/layouts/appheader.dart b/lib/presentation/layouts/appheader.dart index 8ed4de5..99a6943 100644 --- a/lib/presentation/layouts/appheader.dart +++ b/lib/presentation/layouts/appheader.dart @@ -267,6 +267,19 @@ class _AppHeaderState extends ConsumerState { const SizedBox(width: 8), ], + // Pay Out button for admin + if (role == 'admin') ...[ + _buildMenuItem( + icon: Icons.checklist_outlined, + label: "Pay Out", + onTap: () async { + _hidePopup(); + await _clearDashboardFilters(); + context.go(AppRoutes.invoiceList); + }, + ), + ], + const Spacer(), // Raise Enquiry button for agents diff --git a/lib/presentation/screens/login/login_screen.dart b/lib/presentation/screens/login/login_screen.dart index 6336f63..0704222 100644 --- a/lib/presentation/screens/login/login_screen.dart +++ b/lib/presentation/screens/login/login_screen.dart @@ -139,6 +139,8 @@ class _LoginScreenState extends ConsumerState { role = "handler"; } else if (roleId.toString() == "3") { role = "staff"; + } else if (roleId.toString() == "4") { + role = "admin"; } else { role = "agent"; // fallback if unexpected value } @@ -341,7 +343,7 @@ class _LoginScreenState extends ConsumerState { if (userRole == 'staff') { context.go(AppRoutes.enquiryForStaff); } else { - context.go(AppRoutes.dashboard); + context.go(AppRoutes.dashboard); } } else { ToastHelper.showErrorToast(context, data['message'] ?? 'Invalid OTP'); diff --git a/lib/presentation/screens/payout/FormFieldBox.dart b/lib/presentation/screens/payout/FormFieldBox.dart new file mode 100644 index 0000000..27e09bd --- /dev/null +++ b/lib/presentation/screens/payout/FormFieldBox.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class FormFieldBox extends StatelessWidget { + final Widget child; + final String label; + + const FormFieldBox({ + super.key, + required this.child, + required this.label, + }); + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: GoogleFonts.inter( + fontSize: 13, + fontWeight: FontWeight.w500, + color: Color(0xFF2F766E), + ) + ), + const SizedBox(height: 6), + SizedBox( + height: 35, + child: child, + ), + ], + ), + ); + } +} diff --git a/lib/presentation/screens/payout/invoice_list.dart b/lib/presentation/screens/payout/invoice_list.dart new file mode 100644 index 0000000..7b64c49 --- /dev/null +++ b/lib/presentation/screens/payout/invoice_list.dart @@ -0,0 +1,623 @@ +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/data/utils/toastNotification.dart'; + +import '../../../core/routing/routes.dart'; +import '../../../core/services/api_service.dart'; +import '../../../data/utils/Pagination.dart'; +import '../../layouts/main_layout.dart'; +import '../../layouts/responsive_layout.dart'; +import '../../providers/manager_provider.dart'; +import '../../providers/userRoleProvider.dart'; +import '../../themes/indicators/export_btn.dart'; +import '../../themes/indicators/search_field_theme.dart'; +import '../../widgets/custom_Stdate_EnDate_Filter.dart'; + +class InvoiceList extends ConsumerStatefulWidget { + const InvoiceList({super.key}); + + @override + ConsumerState createState() => _InvoiceListState(); +} + +class _InvoiceListState extends ConsumerState { + int currentPage = 1; + int itemsPerPage = 10; + bool isLoading = false; + List> getInvoiceData = []; + List> originalData = []; + List> filteredData = []; + dynamic roleId; + dynamic userId; + late ApiService apiService; + final _formKey = GlobalKey(); + Map controllers = {}; + List tabHeader = ['startDate', 'endDate']; + dynamic SelectedStatus; + dynamic SelectedStaffId; + + @override + void initState() { + super.initState(); + apiService = ApiService(); + for (String field in tabHeader) { + controllers[field] = TextEditingController(); + } + + Future.microtask(() { + final id = ref.read(managerIdProvider); + roleId = ref.read(userRoleProvider); + userId = ref.read(userIdProvider); + + print("D49 => r : $roleId | mId: $id | uId: $userId "); + getInvoiceList(); + }); + } + + // Get Broker List + Future getInvoiceList() async { + print('getBroker called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.getInvoiceList(); + + if (response['status'] == 'success') { + print('getInvoiceList - ${response['data']}'); + final data = response['data']; + print('D81 => getInvoiceList => ${response['data']}'); + + // final fromDate = response['from_date'] ?? ''; + // final toDate = response['to_date'] ?? ''; + // + // print('FromDate : $fromDate'); + // print('ToDate : $toDate'); + setState(() { + // controllers['startDate']?.text = fromDate; + // controllers['endDate']?.text = toDate; + if (data is List) { + // Already a list of maps + getInvoiceData = List>.from(data); + } else if (data is Map) { + // Single object, wrap in a list + getInvoiceData = [Map.from(data)]; + } else { + getInvoiceData = []; + } + originalData = getInvoiceData; + filteredData = List.from(originalData); + }); + } else { + originalData = []; + filteredData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + // Delete Invoice List + Future deleteInvoice(ID) async { + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.deleteInvoice(ID); + + if (response['status'] == 'success') { + ToastHelper.showSuccessToast(context, response['data']); + getInvoiceList(); + } else { + ToastHelper.showSuccessToast(context, response['data']); + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + List get _paginatedData { + // Sort descending by id first + final sortedData = [...filteredData] + ..sort((a, b) => int.parse(b['id']) - int.parse(a['id'])); + + if (sortedData.isEmpty) return []; + + // Ensure currentPage is valid + final maxPage = (sortedData.length / itemsPerPage).ceil(); + final safePage = currentPage.clamp(1, maxPage); + + final startIndex = (safePage - 1) * itemsPerPage; + final endIndex = (startIndex + itemsPerPage).clamp(0, sortedData.length); + + return sortedData.sublist(startIndex, endIndex); + } + + void filterDateRange() { + + } + + void refrshfilterDateRange() { + setState(() { + // SelectedStaffId = null; + controllers['startDate']!.clear(); + controllers['endDate']!.clear(); + + controllers['startDate']?.text = ''; + controllers['endDate']?.text = ''; + // Reset the FormField validation + _formKey.currentState?.reset(); + }); + getInvoiceList(); + } + + void filterData(String query) { + print("FilterDAta - $query"); + setState(() { + filteredData = getInvoiceData.where((item) { + // final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive"; + + return (_formatDate(item['updated_at']) ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || + (_formatDate(item['invoice_date']) ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || + (item['invoice_no'] ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || + (item['invoice_amount'] ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || + (item['broker_name'] ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || + (item['agent_name'] ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) + // || + // (item['status'] ?? '-').toLowerCase().contains(query.toLowerCase()); + ; + }).toList(); + }); + } + + final TextEditingController _searchStaffController = TextEditingController(); + + String _formatDate(String rawDate) { + try { + final dateTime = DateTime.parse(rawDate); + return DateFormat('dd-MM-yyyy HH:mm').format(dateTime); // 24-hour format + } catch (e) { + return rawDate; // fallback if parsing fails + } + } + + @override + Widget build(BuildContext context) { + return MainLayout( + title: "Pay Out", + body: Container( + // color: Colors.yellow.shade50, + width: MediaQuery.of(context).size.width, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: 30, + width: MediaQuery.of(context).size.width, + child: GestureDetector( + onTap: () { + context.go(AppRoutes.dashboard); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Tooltip( + message: 'Back', + child: IconButton( + icon: const Icon( + Icons.arrow_left_sharp, + size: 25, + color: Color(0xFF425B5B), + ), + onPressed: () { + context.go(AppRoutes.dashboard); + }, + splashRadius: 18, + hoverColor: Colors.black12, + padding: const EdgeInsets.all(4), + constraints: const BoxConstraints(), + ), + ), + const SizedBox(width: 5), // spacing between icon and text + Text( + "Invoice", + style: GoogleFonts.inter( + fontSize: 18, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ), + + SizedBox(height: 5), + + Expanded( + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(8.0), + child: _buildContent(context), + ), + ), + + Container( + // height: 20, + width: MediaQuery.of(context).size.width, + // color: Colors.green.shade50, + child: PaginationControls( + currentPage: currentPage, + itemsPerPage: itemsPerPage, + // totalItems: dataVal.length, + totalItems: filteredData.length, + // activeColor: layoutColor, // your theme color + onPageChanged: (page) { + setState(() { + currentPage = page; + }); + }, + onItemsPerPageChanged: (items) { + setState(() { + itemsPerPage = items; + currentPage = 1; + }); + }, + ), + ), + ], + ), + ), + ); + } + + Widget _buildContent(BuildContext context) { + return Column( + children: [ + Container( + // height: 40, + // color: Colors.pink, + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + // if (!ResponsiveLayout.isMobile(context)) ...[ + // DateFilterRow( + // dataFrom: 'Policy', + // role: roleId, + // id: userId, + // onFilterStaff: (val) { + // print('Selected Filterd STAFF Id - $val'); + // SelectedStaffId = val; + // }, + // selectedStaffId: SelectedStaffId, + // startController: controllers['startDate']!, + // endController: controllers['endDate']!, + // onStatusChanged: (val) { + // SelectedStatus = val; // update parent + // }, + // formKey: _formKey, + // isMobile: ResponsiveLayout.isMobile(context), + // onFilter: () { + // // call your filter logic + // filterDateRange(); + // }, + // onRefresh: () { + // // call your refresh logic + // refrshfilterDateRange(); + // }, + // ), + // + // // Form( + // // key: _formKey, + // // child: Row( + // // mainAxisAlignment: MainAxisAlignment.start, + // // crossAxisAlignment: CrossAxisAlignment.end, + // // children: [ + // // buildStartDate(context), + // // SizedBox(width: 10), + // // buildEndDate(context), + // // SizedBox(width: 10), + // // + // // Padding( + // // padding: const EdgeInsets.symmetric( + // // vertical: 8.0, + // // ), + // // child: GestureDetector( + // // // onTap: filterDateRange, + // // onTap: () { + // // if (_formKey.currentState!.validate()) { + // // filterDateRange(); // only runs if valid + // // } + // // }, + // // child: Icon(Icons.filter_alt_outlined), + // // ), + // // ), + // // + // // Padding( + // // padding: const EdgeInsets.all(8.0), + // // child: GestureDetector( + // // onTap: refrshfilterDateRange, + // // child: Icon(Icons.refresh), + // // ), + // // ), + // // ], + // // ), + // // ), + // Spacer(), + // ], + + ThemedSearchField( + hintText: 'Search', + backgroundColor: Color(0xFFF6F8F8), + onChanged: filterData, + controller: _searchStaffController, + txtwidth: MediaQuery.of(context).size.width * 0.2, + ), + SizedBox(width: 10), + Tooltip( + message: 'Export File', + child: InkWell( + onTap: () async { + context.go(AppRoutes.payout); + }, + // onTap: () { + // print('TAV ExcelExporter'); + // + // ExcelExporter.exportToExcel( + // sheetName: sheetName, + // data: data, + // headers: headers, + // fileName: fileName, + // keys: keys!, + // ); + // }, + child: Container( + padding: const EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: const Color(0xFF2E7D6E), + // color: const Color(0xFF425B5B), + borderRadius: BorderRadius.circular(8.0), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + // Image.asset( + // "assets/miscellaneous/export.png", + // height: 25, + // width: 25, + // ), + Icon(Icons.add, color: Colors.white, size: 25), + // Image.asset("assets/miscellaneous/export", height: 15, width: 15), + ], + ), + ), + ), + ), + SizedBox(width: 10), + ExportBtn( + sheetName: "Invoice", + fileName: "Invoice_List", + data: filteredData, + txt: true, + displayHeaders: [ + "Updated Date", + "Invoice Date", + "Invoice No", + "Invoice Amount", + "Broker Name", + "Partner Name", + ], + keys: [ + "updated_at", + "invoice_date", + "invoice_no", + "invoice_amount", + "broker_name", + "agent_name", + ], + ), + ], + ), + ), + SizedBox(height: 5), + Container( + decoration: BoxDecoration( + color: Color(0xFFEDF6F5), + borderRadius: BorderRadius.circular(6), + ), + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), + child: Row( + children: [ + Expanded(flex: 3, child: Text('Invoice No', style: _headerStyle)), + Expanded( + flex: 3, + child: Text('Invoice Date', style: _headerStyle), + ), + Expanded( + flex: 3, + child: Text('Invoice Amount', style: _headerStyle), + ), + Expanded( + flex: 3, + child: Text('Broker Name', style: _headerStyle), + ), + Expanded( + flex: 3, + child: Text('Partner Name', style: _headerStyle), + ), + Expanded( + flex: 3, + child: Text('Updated Date', style: _headerStyle), + ), + Expanded(flex: 3, child: Text('Action', style: _headerStyle)), + ], + ), + ), + + Expanded(child: _buildDataTable(context)), + ], + ); + } + + Widget _buildDataTable(BuildContext context) { + if (filteredData.isEmpty) { + return const SizedBox( + height: 50, + child: Center(child: Text('No available data')), + ); + } + + final sortedData = [..._paginatedData]; + + // Desktop: keep ListView.builder + return ListView.builder( + itemCount: sortedData.length + 1, + itemBuilder: (context, index) { + if (index == 0) return _buildHeader(); + final startIndex = (currentPage - 1) * itemsPerPage; + final item = sortedData[index - 1]; + final sno = startIndex + index; + return _buildDataRow(item, sno); + }, + ); + } + + Widget _buildHeader() { + return SizedBox.shrink(); + } + + Widget _buildDataRow(Map item, sno) { + return Container( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16), + // margin: const EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Colors.white, + // color: Color(0xFFE0F7F9), + border: const Border( + bottom: BorderSide(color: Color(0xFFEAEAEA), width: 1), + ), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text(item['invoice_no'] ?? '-', style: _dataBold), + ), + Expanded( + flex: 3, + child: Text( + item['invoice_date'] ?? '-', + style: _dataBold, + ), + ), + Expanded( + flex: 3, + child: Text( + item['invoice_amount'] ?? '-', + style: _dataBold, + softWrap: true, + maxLines: 3, + ), + ), + Expanded( + flex: 3, + child: Text( + item['broker_name'] ?? '-', + style: _dataBold, + softWrap: true, + maxLines: 3, + ), + ), + Expanded( + flex: 3, + child: Text( + item['agent_name'] ?? '-', + style: _dataBold, + softWrap: true, + maxLines: 3, + ), + ), + Expanded( + flex: 3, + child: Text( + _formatDate(item['updated_at']) ?? '-', + style: _dataBold, + softWrap: true, + maxLines: 3, + ), + ), + + // ACTION ICONS (Edit + Delete) + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // EDIT ICON + IconButton( + icon: const Icon(Icons.edit, color: Colors.blue, size: 20), + onPressed: () { + // TODO: handle edit + context.go(AppRoutes.payout, extra: item); + print("Edit clicked for ${item['invoice_no']}"); + }, + ), + const SizedBox(width: 6), + + // DELETE ICON + IconButton( + icon: const Icon(Icons.delete, color: Colors.red, size: 20), + onPressed: () { + // TODO: handle delete + deleteInvoice(item['id']); + print("Delete clicked for ${item['invoice_no']}"); + }, + ), + ], + ), + ), + ], + ), + ); + } + + static final _dataBold = GoogleFonts.inter( + fontSize: 14, + + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + ); + + static final _headerStyle = GoogleFonts.inter( + color: Colors.black, + fontWeight: FontWeight.bold, + ); +} diff --git a/lib/presentation/screens/payout/payout_screen.dart b/lib/presentation/screens/payout/payout_screen.dart new file mode 100644 index 0000000..13b0948 --- /dev/null +++ b/lib/presentation/screens/payout/payout_screen.dart @@ -0,0 +1,1089 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:intl/intl.dart'; +import 'package:nhance_partner/data/utils/toastNotification.dart'; + +import '../../../core/routing/routes.dart'; +import '../../../core/services/api_service.dart'; +import '../../layouts/main_layout.dart'; +import '../../providers/manager_provider.dart'; +import 'FormFieldBox.dart'; + +class PayOutScreen extends ConsumerStatefulWidget { + final Map? editItem; + + const PayOutScreen({super.key, this.editItem}); + + @override + ConsumerState createState() => _PayOutScreenState(); +} + +class _PayOutScreenState extends ConsumerState { + // -------------------------- + // Invoice Fields + // -------------------------- + late TextEditingController invoiceNoController; + DateTime invoiceDate = DateTime.now(); + int? selectedAgentId; + int? selectedBrokerID; + DateTime? policyTillDate = DateTime.now(); + + // -------------------------- + // Filters + // -------------------------- + DateTime? fromDate; + DateTime? toDate; + + // -------------------------- + // Collapse States + // -------------------------- + bool invoiceCollapsed = false; + bool policyCollapsed = false; + + // -------------------------- + // Sample Data (replace with API later) + // -------------------------- + final List> allPolicies = [ + { + 'id': 1, + 'policyNo': 'POL456578798', + 'customer': 'Ram', + 'agentId': 1, + 'brokerId': 1, + 'premium': 1500, + 'commission': 450, + 'date': '2025-10-01', + }, + { + 'id': 2, + 'policyNo': 'POL456578799', + 'customer': 'Shyam', + 'agentId': 1, + 'brokerId': 1, + 'premium': 2000, + 'commission': 600, + 'date': '2025-10-02', + }, + { + 'id': 3, + 'policyNo': 'POL456578800', + 'customer': 'Mohan', + 'agentId': 1, + 'brokerId': 2, + 'premium': 3000, + 'commission': 900, + 'date': '2025-10-03', + }, + { + 'id': 4, + 'policyNo': 'POL98765', + 'customer': 'Kumar', + 'agentId': 1, + 'brokerId': 2, + 'premium': 15000, + 'commission': 3500, + 'date': '2025-10-04', + }, + { + 'id': 5, + 'policyNo': 'POL98766', + 'customer': 'Vijay', + 'agentId': 1, + 'brokerId': 3, + 'premium': 5000, + 'commission': 1250, + 'date': '2025-10-05', + }, + { + 'id': 6, + 'policyNo': 'POL98767', + 'customer': 'Ajay', + 'agentId': 1, + 'brokerId': 3, + 'premium': 7500, + 'commission': 1875, + 'date': '2025-10-06', + }, + { + 'id': 7, + 'policyNo': 'POL98768', + 'customer': 'Ravi', + 'agentId': 2, + 'brokerId': 4, + 'premium': 4000, + 'commission': 1000, + 'date': '2025-10-07', + }, + { + 'id': 8, + 'policyNo': 'POL98769', + 'customer': 'Prakash', + 'agentId': 2, + 'brokerId': 4, + 'premium': 6000, + 'commission': 1500, + 'date': '2025-10-08', + }, + ]; + + List> filteredPolicies = []; + Set selectedPolicies = {}; + + List> getBrokerData = []; + List> filteredBrokerData = []; + + List> getAgentData = []; + List> filteredAgentData = []; + + bool isLoading = false; + late ApiService apiService; + dynamic managerId; + dynamic userId; + final DateFormat df = DateFormat('dd-MM-yyyy'); + + @override + void initState() { + super.initState(); + apiService = ApiService(); + invoiceNoController = TextEditingController(text: generateInvoiceNumber()); + Future.microtask(() async { + managerId = ref.watch(managerIdProvider); + userId = ref.watch(userIdProvider); + if (managerId != null) { + await getAgentList(managerId); + } + await getBroker(); + }); + + // 👉 CHECK EDIT MODE + if (widget.editItem != null) { + print('editItemID ${widget.editItem}'); + final invoiceID = widget.editItem!['id']; + _loadEditData(invoiceID); + } + } + + void _loadEditData(String invoiceID) async { + setState(() => isLoading = true); + + final response = await apiService.getInvoiceDetails(invoiceID); + + if (response['status'] == 'success') { + final invoice = response['data']['invoice']; + final items = List>.from(response['data']['items']); + + print("Invoice → $invoice"); + print("Items → $items"); + + // ----------------------------- + // 1. SET BASIC FIELDS + // ----------------------------- + setState(() { + selectedBrokerID = int.tryParse(invoice['broker_id'].toString()); + selectedAgentId = int.tryParse(invoice['agent_id'].toString()); + + invoiceNoController.text = invoice['invoice_no']; + invoiceDate = DateTime.parse(invoice['invoice_date']); + + if (invoice['till_date'] != "0000-00-00") { + policyTillDate = DateTime.parse(invoice['till_date']); + } else { + policyTillDate = DateTime.now(); + } + }); + print('selectedBrokerID $selectedBrokerID'); + + // ----------------------------- + // 3. LOAD ALL POLICIES FOR THIS BROKER + AGENT + // ----------------------------- + await loadPolicies(); + + // ----------------------------- + // 2. SET SELECTED POLICIES + // ----------------------------- + selectedPolicies = items + .map((p) => int.parse(p['policy_id'].toString())) + .toSet(); + + // ----------------------------- + // 3. LOAD ALL POLICIES FOR THIS BROKER + AGENT + // ----------------------------- + await loadPolicies(); + + // ----------------------------- + // 4. KEEP ONLY POLICIES THAT MATCH API DATA + // ----------------------------- + setState(() { + filteredPolicies = filteredPolicies.map((p) { + final policyId = int.parse(p['policy_id']); + return { + ...p, + 'is_selected': selectedPolicies.contains(policyId), + }; + }).toList(); + }); + } + + setState(() => isLoading = false); + } + + + + String formatDate(String date) { + final d = DateTime.parse(date); + return DateFormat('dd-MM-yyyy').format(d); + } + + // Get Broker List + Future getBroker() async { + print('getBroker called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.fetchMasterDropDown('Broker'); + + if (response['status'] == 200) { + print('getBroker - ${response['data']}'); + setState(() { + getBrokerData = List>.from(response['data']); + print('API Data - $getBrokerData'); + + filteredBrokerData = List.from(getBrokerData); + print('originalData - $filteredBrokerData'); + }); + } else { + getBrokerData = []; + filteredBrokerData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + //Get Agent List + Future getAgentList(int id) async { + print('getClaimList called'); + setState(() { + isLoading = true; + }); + + try { + final response = await apiService.fetchAgentUserList(managerId); + + if (response['status'] == 'success') { + print('getAgentListData - ${response['data']}'); + setState(() { + getAgentData = List>.from(response['data']); + print('API Data - $getAgentData'); + + filteredAgentData = List.from(getAgentData); + print('originalData - $filteredAgentData'); + }); + } else { + getAgentData = []; + filteredAgentData = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + // Generate invoice number + String generateInvoiceNumber() { + final now = DateTime.now(); + final random = now.millisecondsSinceEpoch % 1000; + return "INV${now.year}${now.month.toString().padLeft(2, '0')}${random.toString().padLeft(3, '0')}"; + } + + // Pick date helper + Future pickDate(DateTime initial) async { + return await showDatePicker( + context: context, + initialDate: initial, + firstDate: DateTime(2000), + lastDate: DateTime(2100), + ); + } + + // Load policies (simulate API) + Future loadPolicies() async { + try { + String formattedTillDate = DateFormat( 'yyyy-MM-dd').format(policyTillDate!); + final jsondata = { + "broker_id": selectedBrokerID, + "agent_id": selectedAgentId, + "issued_date": formattedTillDate, + }; + final response = await apiService.getCommissionRateList(jsondata); + + if (response['status'] == 'success') { + print('API Data response - $response'); + setState(() { + filteredPolicies = List>.from(response['data']); + print('API Data - $filteredPolicies'); + // filteredPolicies = allPolicies.where((p) { + // if (p["agentId"] != selectedAgentId) return false; + // if (policyTillDate != null && + // DateTime.parse(p["date"]).isAfter(policyTillDate!)) + // return false; + // return true; + // }).toList(); + }); + } else { + filteredPolicies = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + } + + // Apply date filters + void filterPolicies() { + if (selectedAgentId == null) return; + + setState(() { + filteredPolicies = allPolicies.where((p) { + final date = DateTime.parse(p["date"]); + // if (p["agentId"] != selectedAgentId) return false; + // if (policyTillDate != null && date.isAfter(policyTillDate!)) + // return false; + if (fromDate != null && date.isBefore(fromDate!)) return false; + if (toDate != null && date.isAfter(toDate!)) return false; + return true; + }).toList(); + }); + } + + // Save invoice (simulation) + Future saveInvoice() async{ + + try { + if (selectedAgentId == null) { + ToastHelper.showWarningToast(context,"Please select an agent"); + return; + } + + if (selectedPolicies.isEmpty) { + ToastHelper.showWarningToast(context,"Please select at least 1 policy"); + return; + } + + // Format dates for API + final String formattedInvoiceDate = DateFormat('yyyy-MM-dd').format(invoiceDate); + final String formattedTillDate = DateFormat('yyyy-MM-dd').format(policyTillDate!); + + // Total Commission + final double totalCommission = filteredPolicies + .where((p) => selectedPolicies.contains(int.parse(p["policy_id"]))) + .fold(0.0, (sum, p) => sum + double.parse(p["commission_amount"])); + + // Build items array + final List> items = filteredPolicies + .where((p) => selectedPolicies.contains(int.parse(p["policy_id"]))) + .map((p) => { + "policy_id": int.parse(p["policy_id"]), + "policy_no": p["policy_no"], + "commission_amount": double.parse(p["commission_amount"]), + }).toList(); + + final jsondata = { + "invoice_no": invoiceNoController.text, + "invoice_amount": totalCommission, + "agent_id": selectedAgentId, + "broker_id": selectedBrokerID, + "invoice_date": formattedInvoiceDate, + "till_date": formattedTillDate, + "payout_status": 0, + "created_by": userId, + "updated_by": userId, + "items": items, + }; + print('Commissions $jsondata'); + final response = await apiService.getCreateOrUpdate(jsondata); + + if (response['status'] == 'success') { + + setState(() { + print('API Data response - $response'); + selectedPolicies.clear(); + invoiceNoController.clear(); + invoiceDate = DateTime.now(); + policyTillDate = DateTime.now(); + filteredPolicies = []; + + }); + context.go(AppRoutes.invoiceList); + } else { + filteredPolicies = []; + } + } catch (e) { + print('Exception occurred: $e'); + } finally { + setState(() { + isLoading = false; + }); + } + + + + // showDialog( + // context: context, + // builder: (_) => AlertDialog( + // title: const Text("Success"), + // content: Text( + // "Invoice No: ${invoiceNoController.text}\n" + // "Total Commission: ₹$totalComm", + // ), + // actions: [ + // TextButton( + // onPressed: () => Navigator.pop(context), + // child: const Text("OK"), + // ), + // ], + // ), + // ); + } + + void showMessage(String msg) { + ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg))); + } + + @override + Widget build(BuildContext context) { + final df = DateFormat("dd-MM-yyyy"); + + return MainLayout( + title: "Pay Out", + body: Stack( + children: [ + SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + // ---------------------- + // Invoice Details + // ---------------------- + Card( + color: Colors.white, // White background + clipBehavior: Clip.none, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 1, + child: Column( + children: [ + // ---------- HEADER (CLICK TO COLLAPSE) ---------- + ListTile( + title: const Text("Invoice Details"), + trailing: Icon( + invoiceCollapsed + ? Icons.expand_more + : Icons.expand_less, + color: Color(0xFF2F766E), + size: 26, + ), + onTap: () => setState( + () => invoiceCollapsed = !invoiceCollapsed, + ), + ), + // ------------------- HR LINE WHEN OPEN ------------------- + if (!invoiceCollapsed) + const Divider( + height: 1, + thickness: 1, + color: Color(0xFFE0E0E0), + ), + + // ---------- COLLAPSIBLE CONTENT ---------- + AnimatedCrossFade( + duration: const Duration(milliseconds: 500), + crossFadeState: invoiceCollapsed + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + firstChild: const SizedBox( + // FIXED + height: 0, + width: double.infinity, + ), + secondChild: Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + // ------------------- ROW OF FIELDS ------------------- + SizedBox( + height: 80, // 👈 ensures bottom alignment works + child: Row( + crossAxisAlignment: CrossAxisAlignment + .center, // 👈 bottom align everything + children: [ + // INVOICE NO + FormFieldBox( + label: "Invoice No *", + child: TextField( + controller: invoiceNoController, + readOnly: true, + decoration: commonInputDecoration( + hint: "Invoice Number", + ), + ), + ), + const SizedBox(width: 12), + + // INVOICE DATE + FormFieldBox( + label: "Invoice Date *", + child: GestureDetector( + onTap: () async { + final picked = await pickDate( + invoiceDate, + ); + if (picked != null) + setState( + () => invoiceDate = picked, + ); + }, + child: AbsorbPointer( + child: TextField( + readOnly: true, + decoration: + commonInputDecoration( + hint: df.format(invoiceDate), + ).copyWith( + suffixIcon: const Icon( + Icons.calendar_today, + size: 18, + ), + ), + ), + ), + ), + ), + const SizedBox(width: 12), + + // BROKER + FormFieldBox( + label: "Select Broker *", + child: DropdownButtonFormField( + value: selectedBrokerID, + decoration: commonInputDecoration( + hint: "Select Broker", + ), + items: filteredBrokerData.map((a) { + final int id = + int.tryParse( + a['id'].toString(), + ) ?? + 0; + return DropdownMenuItem( + value: id, + child: Text(a['name'].toString()), + ); + }).toList(), + onChanged: (id) => setState( + () => selectedBrokerID = id, + ), + ), + ), + const SizedBox(width: 12), + + // AGENT + FormFieldBox( + label: "Select Agent *", + child: DropdownButtonFormField( + value: selectedAgentId, + decoration: commonInputDecoration( + hint: "Select Agent", + ), + items: filteredAgentData.map((a) { + final int id = + int.tryParse( + a['id'].toString(), + ) ?? + 0; + return DropdownMenuItem( + value: id, + child: Text(a['name'].toString()), + ); + }).toList(), + onChanged: (id) => setState( + () => selectedAgentId = id, + ), + ), + ), + const SizedBox(width: 12), + + // POLICY TILL DATE + FormFieldBox( + label: "Policy Till Date *", + child: GestureDetector( + onTap: () async { + final picked = await pickDate( + policyTillDate!, + ); + if (picked != null) + setState( + () => policyTillDate = picked, + ); + }, + child: AbsorbPointer( + child: TextField( + readOnly: true, + decoration: + commonInputDecoration( + hint: df.format( + policyTillDate!, + ), + ).copyWith( + suffixIcon: const Icon( + Icons.calendar_today, + size: 18, + ), + ), + ), + ), + ), + ), + const SizedBox(width: 12), + + // --- RESET + SEARCH (BOTTOM ALIGNED) --- + Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + // RESET + SizedBox( + height: 30, + width: 30, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + padding: EdgeInsets.zero, + ), + onPressed: () { + setState(() { + selectedBrokerID = null; + selectedAgentId = null; + fromDate = null; + toDate = null; + policyTillDate = + DateTime.now(); + filteredPolicies = []; + }); + }, + child: const Icon( + Icons.refresh, + size: 18, + ), + ), + ), + const SizedBox(width: 12), + + // SEARCH + SizedBox( + height: 30, + width: 30, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + padding: EdgeInsets.zero, + ), + onPressed: loadPolicies, + child: const Icon( + Icons.search, + size: 18, + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + + const SizedBox(height: 20), + + // ---------------------- + // Policy Selection + // ---------------------- + Card( + color: Colors.white, // White background + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 1, + child: Column( + children: [ + ListTile( + // contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), + title: const Text("Policy Selection"), + // ---------------- RIGHT SIDE (filters + collapse) ---------------- + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + // FROM DATE + SizedBox( + height: 30, + width: MediaQuery.of(context).size.width * 0.12, + child: GestureDetector( + onTap: () async { + final date = await pickDate( + fromDate ?? DateTime.now(), + ); + if (date != null) + setState(() => fromDate = date); + }, + child: AbsorbPointer( + child: TextField( + readOnly: true, + decoration: + commonInputDecoration( + hint: "From Date", + ).copyWith( + // 👇 THIS is where you set formatted date + suffixIcon: const Icon( + Icons.calendar_today, + size: 18, + ), + labelText: fromDate == null + ? "From Date" + : df.format(fromDate!), + ), + ), + ), + ), + ), + const SizedBox(width: 8), + + // TO DATE + SizedBox( + height: 30, + width: MediaQuery.of(context).size.width * 0.12, + child: GestureDetector( + onTap: () async { + final date = await pickDate( + toDate ?? DateTime.now(), + ); + if (date != null) + setState(() => toDate = date); + }, + child: AbsorbPointer( + child: TextField( + readOnly: true, + decoration: + commonInputDecoration( + hint: "To Date", + ).copyWith( + // 👇 THIS is where you set formatted date + suffixIcon: const Icon( + Icons.calendar_today, + size: 18, + ), + labelText: toDate == null + ? "To Date" + : df.format(toDate!), + ), + ), + ), + ), + ), + const SizedBox(width: 8), + + // RESET BUTTON + SizedBox( + height: 30, + width: 30, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + padding: EdgeInsets.zero, + ), + onPressed: () { + setState(() { + fromDate = null; + toDate = null; + }); + loadPolicies(); + }, + child: const Icon(Icons.refresh, size: 18), + ), + ), + const SizedBox(width: 8), + + // SEARCH BUTTON + SizedBox( + height: 30, + width: 30, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + padding: EdgeInsets.zero, + ), + onPressed: filterPolicies, + child: const Icon(Icons.search, size: 18), + ), + ), + const SizedBox(width: 8), + + // COLLAPSE ICON + GestureDetector( + onTap: () => setState( + () => policyCollapsed = !policyCollapsed, + ), + child: Icon( + policyCollapsed + ? Icons.expand_more + : Icons.expand_less, + color: Colors.teal, + size: 26, + ), + ), + ], + ), + onTap: () => + setState(() => policyCollapsed = !policyCollapsed), + ), + // ------------------- HR LINE WHEN OPEN ------------------- + if (!policyCollapsed) + const Divider( + height: 1, + thickness: 1, + color: Color(0xFFE0E0E0), + ), + + AnimatedCrossFade( + duration: const Duration(milliseconds: 500), + crossFadeState: policyCollapsed + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + firstChild: Container(), + secondChild: Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + // ---------------- SELECT ALL ---------------- + if (filteredPolicies.isNotEmpty) + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + child: Row( + children: [ + Checkbox( + value: filteredPolicies.isNotEmpty && + filteredPolicies.every( + (p) => selectedPolicies.contains(int.parse(p["policy_id"])), + ), + onChanged: (v) { + setState(() { + if (v == true) { + selectedPolicies = filteredPolicies + .map((p) => int.parse(p["policy_id"])) + .toSet(); + } else { + selectedPolicies.clear(); + } + }); + }, + ), + const SizedBox(width: 8), + const Text( + "Select All Policies", + style: TextStyle(fontSize: 16), + ), + ], + ), + ), + + // ---------------- POLICY LIST ---------------- + if (filteredPolicies.isEmpty) + const Padding( + padding: EdgeInsets.all(20), + child: Text("No policies found"), + ) + else + ...filteredPolicies.map((p) { + final int id = int.parse(p["policy_id"]); + final bool isSelected = selectedPolicies.contains(id); + + return ListTile( + tileColor: isSelected + ? Colors.teal.shade50 + : null, + leading: Checkbox( + value: isSelected, + onChanged: (v) { + setState(() { + if (v == true) { + selectedPolicies.add(id); + } else { + selectedPolicies.remove(id); + } + }); + }, + ), + + title: Text(p["policy_no"]), + + subtitle: Text( + "Customer: ${p["customer_name"]} | " + "Premium: ₹${p["premium_amount"]}", + ), + + trailing: Text( + "₹${p["commission_amount"]}", + style: const TextStyle( + color: Colors.teal, + fontWeight: FontWeight.bold, + ), + ), + + onTap: () { + setState(() { + if (isSelected) { + selectedPolicies.remove(id); + } else { + selectedPolicies.add(id); + } + }); + }, + ); + }).toList(), + ], + ), + ), + ), + ], + ), + ), + + const SizedBox(height: 100), + ], + ), + ), + + // ------------------------------ + // Bottom Summary Bar + // ------------------------------ + if (selectedPolicies.isNotEmpty) + Positioned( + left: 0, + right: 0, + bottom: 0, + child: Material( + elevation: 8, + child: Container( + padding: const EdgeInsets.all(16), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Selected Count + Total + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Selected Policies", + style: TextStyle(fontSize: 12), + ), + const SizedBox(height: 4), + Text( + selectedPolicies.length.toString(), + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Total Commission", + style: TextStyle(fontSize: 12), + ), + const SizedBox(height: 4), + Text( + "₹${filteredPolicies + .where((p) => selectedPolicies.contains(int.parse(p["policy_id"]))) + .fold(0.0, (s, p) => s + double.parse(p["commission_amount"]))}", + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.teal, + ), + ), + ], + ), + + Row( + children: [ + TextButton( + onPressed: () => + setState(() => selectedPolicies.clear()), + child: const Text("Clear"), + ), + const SizedBox(width: 10), + ElevatedButton( + onPressed: saveInvoice, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.orange, + ), + child: const Text("Submit"), + ), + ], + ), + ], + ), + ), + ), + ), + ], + ), + ); + } + + InputDecoration commonInputDecoration({required String hint}) { + return InputDecoration( + hintText: hint, + filled: true, + fillColor: Colors.white, + contentPadding: const EdgeInsets.symmetric(horizontal: 12), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(6), + borderSide: const BorderSide( + color: Color(0xFFDDDDDD), // light gray + width: 1, + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(6), + borderSide: const BorderSide( + color: Color(0xFFAAAAAA), // darker gray on focus + width: 1.2, + ), + ), + ); + } +} diff --git a/lib/presentation/themes/indicators/export_btn.dart b/lib/presentation/themes/indicators/export_btn.dart index e8665c2..812681b 100644 --- a/lib/presentation/themes/indicators/export_btn.dart +++ b/lib/presentation/themes/indicators/export_btn.dart @@ -94,8 +94,8 @@ class ExportBtn extends HookWidget { // ?txt! ? SizedBox(width: 15) : null, Image.asset( "assets/miscellaneous/export.png", - height: 15, - width: 15, + height: 25, + width: 25, ), // Icon(Icons.input_sharp, color: Colors.white), // Image.asset("assets/miscellaneous/export", height: 15, width: 15), diff --git a/pubspec.lock b/pubspec.lock index bbb6d37..d2a66a8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -700,26 +700,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -1225,10 +1225,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" toastification: dependency: "direct main" description: @@ -1345,10 +1345,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: