From 1fefb22f4618df87b3cc099d2adc752017343fa9 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Sat, 3 Jan 2026 17:53:37 +0530 Subject: [PATCH] Code Merged --- .flutter-plugins-dependencies | 2 +- lib/core/services/api_service.dart | 24 +- .../screens/payout/custom_dateRange.dart | 92 +++-- .../screens/payout/payout_screen.dart | 33 +- .../staff/Enquiry/enquiry_inline_list.dart | 390 ++++++++++-------- .../themes/indicators/export_btn.dart | 17 +- .../widgets/custom_Stdate_EnDate_Filter.dart | 2 +- 7 files changed, 342 insertions(+), 218 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 4e982eb..14a82cb 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.13/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_macos-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_linux-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_windows-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","dependencies":[],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.3.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_web","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_web-31.1.19/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"device_info_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"pdf_render","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"syncfusion_flutter_pdfviewer","dependencies":["url_launcher","device_info_plus","syncfusion_pdfviewer_web","syncfusion_pdfviewer_macos","syncfusion_pdfviewer_windows","syncfusion_pdfviewer_linux"]},{"name":"syncfusion_pdfviewer_linux","dependencies":[]},{"name":"syncfusion_pdfviewer_macos","dependencies":[]},{"name":"syncfusion_pdfviewer_web","dependencies":[]},{"name":"syncfusion_pdfviewer_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2026-01-03 09:17:29.546629","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_ios-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_android","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_android-7.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"open_file_android","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_android-1.0.6/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_android-2.2.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_android","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.13/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_flutter_pdfviewer","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_flutter_pdfviewer-31.1.19/","native_build":true,"dependencies":["device_info_plus"],"dev_dependency":false},{"name":"url_launcher_android","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"firebase_messaging","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging-16.0.4/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"google_sign_in_ios","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_ios-6.2.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_mac","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_mac-1.0.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_macos-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_macos","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.3/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_linux-0.0.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_linux-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"firebase_auth","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth-6.1.2/","native_build":true,"dependencies":["firebase_core"],"dev_dependency":false},{"name":"firebase_core","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core-4.2.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"open_file_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_windows-0.0.3/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false},{"name":"syncfusion_pdfviewer_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_windows-31.1.19/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.5/","dependencies":[],"dev_dependency":false},{"name":"device_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/device_info_plus-11.5.0/","dependencies":[],"dev_dependency":false},{"name":"file_picker","path":"/home/venba/.pub-cache/hosted/pub.dev/file_picker-10.3.7/","dependencies":[],"dev_dependency":false},{"name":"firebase_auth_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_auth_web-6.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"firebase_core_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_core_web-3.3.0/","dependencies":[],"dev_dependency":false},{"name":"firebase_messaging_web","path":"/home/venba/.pub-cache/hosted/pub.dev/firebase_messaging_web-4.1.0/","dependencies":["firebase_core_web"],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/home/venba/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/home/venba/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0/","dependencies":[],"dev_dependency":false},{"name":"google_sign_in_web","path":"/home/venba/.pub-cache/hosted/pub.dev/google_sign_in_web-1.1.0/","dependencies":[],"dev_dependency":false},{"name":"open_file_web","path":"/home/venba/.pub-cache/hosted/pub.dev/open_file_web-0.0.4/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/home/venba/.pub-cache/hosted/pub.dev/package_info_plus-8.3.1/","dependencies":[],"dev_dependency":false},{"name":"pdf_render","path":"/home/venba/.pub-cache/hosted/pub.dev/pdf_render-1.4.12/","dependencies":[],"dev_dependency":false},{"name":"shared_preferences_web","path":"/home/venba/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false},{"name":"syncfusion_pdfviewer_web","path":"/home/venba/.pub-cache/hosted/pub.dev/syncfusion_pdfviewer_web-31.1.19/","dependencies":[],"dev_dependency":false},{"name":"url_launcher_web","path":"/home/venba/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"device_info_plus","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]},{"name":"open_file","dependencies":["open_file_android","open_file_web","open_file_ios","open_file_mac","open_file_windows","open_file_linux"]},{"name":"open_file_android","dependencies":[]},{"name":"open_file_ios","dependencies":[]},{"name":"open_file_linux","dependencies":[]},{"name":"open_file_mac","dependencies":[]},{"name":"open_file_web","dependencies":[]},{"name":"open_file_windows","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"pdf_render","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"syncfusion_flutter_pdfviewer","dependencies":["url_launcher","device_info_plus","syncfusion_pdfviewer_web","syncfusion_pdfviewer_macos","syncfusion_pdfviewer_windows","syncfusion_pdfviewer_linux"]},{"name":"syncfusion_pdfviewer_linux","dependencies":[]},{"name":"syncfusion_pdfviewer_macos","dependencies":[]},{"name":"syncfusion_pdfviewer_web","dependencies":[]},{"name":"syncfusion_pdfviewer_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2026-01-03 15:15:25.227888","version":"3.32.1","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index 3cdd7b4..583eafa 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -1718,6 +1718,28 @@ class ApiService { return response; } + Future> fetchAgentUnusedCommissionList(id,broker_id) async { + print('fetchAGENTNameDropDown'); + if (_token == null) { + await _initializeToken(); + } + + dynamic url; + print('fetchAGENTNameDropDown 1'); + url = Uri.parse( + '${Env.apiUrl}invoice/getAgentUnusedCommissionList?manager_id=$id&broker_id=$broker_id', + ); + print('fetchAGENTNameDropDown 2'); + final headers = { + 'Authorization': 'Bearer $_token' ?? '', + 'app-signature': Env.App_Signature, + }; + print('fetchAGENTNameDropDown 3'); + final response = await _makeGetRequest(url, headers); + print('fetchAGENTNameDropDown 4 - $response'); + return response; + } + static late String _baseUrl; static void initialize(String baseUrl) { @@ -2093,7 +2115,7 @@ class ApiService { Future generatePolicyExcel(managerId, fromDate, toDate, searchValue) async { final url = Uri.parse( - '${Env.apiUrl}reports/policy-excel?manager_id=$managerId&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}', + '${Env.apiUrl}reports/policy-excel?manager_id=$managerId&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&search=${searchValue ?? ''}', ); // final url = Uri.parse( 'http://localhost/nhance_partner_be/reports/policy-excel?manager_id=$managerId&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&search=${searchValue ?? ''}', ); diff --git a/lib/presentation/screens/payout/custom_dateRange.dart b/lib/presentation/screens/payout/custom_dateRange.dart index 7733dba..5c39974 100644 --- a/lib/presentation/screens/payout/custom_dateRange.dart +++ b/lib/presentation/screens/payout/custom_dateRange.dart @@ -93,9 +93,10 @@ class _DateFilterRowState extends ConsumerState { // getPartnerDetails(userID); // } - if (managerId != null) { + if (managerId != null && widget.selectedBroker != null) { print('managerId - $managerId'); - getAgentList(managerId); + print('SelectedBroker - $widget.selectedBroker'); + getAgentList(managerId,widget.selectedBroker); } }); @@ -133,24 +134,31 @@ class _DateFilterRowState extends ConsumerState { } } - Future getAgentList(id) async { + Future getAgentList(id,broker_id) async { + print('getAgentListData called'); setState(() { isLoadingAgentList = true; }); try { - final response = await apiService.fetchAgentNameDropDown(id); + final response = await apiService.fetchAgentUnusedCommissionList(id,broker_id); print('getAgentListData called response'); print('get Agent- ${response['data']}'); if (response['status'] == 'success') { print('get Agent- ${response['data']}'); setState(() { - getPartnerData = List>.from(response['data']); - print('API Data - $getPartnerData'); - + // 1. Convert the response to a list + final rawList = List>.from(response['data']); + print('API Data - rawList'); + // 2. Filter out items where agent_id is null or empty + getPartnerData = rawList.where((item) { + final id = item['agent_id']; + return id != null && id.toString().isNotEmpty; + }).toList(); + print('Filtered API Data (No Null IDs) - $getPartnerData'); + // 3. Sync the filtered data to your display list filteredPartnerData = List.from(getPartnerData); - print('originalAgentData - $filteredPartnerData'); }); } else { getPartnerData = []; @@ -499,18 +507,35 @@ class _DateFilterRowState extends ConsumerState { }, // constraints: BoxConstraints(), ), - + // onChanged: (val) { + // if (val != null) { + // print("Selected Broker : ${val['name']}"); + // print("Id: ${val['id']}"); + // // selectedBroker = val['id']; + // widget.onBrokerChanged?.call(val['id'].toString()); + // // widget.onBrokerChanged?.call(val['id']); + // // controllers['agentId']?.text = val['agent_code']; + // // agentId = agent['id']; + // } + // }, onChanged: (val) { if (val != null) { - print("Selected Broker : ${val['name']}"); - print("Id: ${val['id']}"); - // selectedBroker = val['id']; - widget.onBrokerChanged?.call(val['id'].toString()); - // widget.onBrokerChanged?.call(val['id']); - // controllers['agentId']?.text = val['agent_code']; - // agentId = agent['id']; + String selectedId = val['id'].toString(); + + // 1. Notify parent of the change + widget.onBrokerChanged?.call(selectedId); + + // 2. Clear current partner list so user doesn't see old data + setState(() { + filteredPartnerData = []; + }); + + // 3. Fetch new agents based on this broker + getAgentList(managerId!, selectedId); } }, + + ), ), ], @@ -523,7 +548,7 @@ class _DateFilterRowState extends ConsumerState { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("Referer *", style: _textStyle), + Text("Referer", style: _textStyle), SizedBox(height: 5), SizedBox( height: 35, @@ -536,7 +561,7 @@ class _DateFilterRowState extends ConsumerState { // : null, selectedItems: filteredPartnerData .where( - (item) => (widget.selectedParnter ?? []).contains(item['id']), + (item) => (widget.selectedParnter ?? []).contains(item['agent_id']), ) .toList(), @@ -549,26 +574,27 @@ class _DateFilterRowState extends ConsumerState { return filteredPartnerData; }, - itemAsString: (val) => val['name'].toString(), // what to show + itemAsString: (val) => // what to show + "${val['agent_name']} | ${val['unused_commission_amount']} (${val['total_policies']})", compareFn: (item, selectedItem) => - item['id'] == selectedItem['id'], // ✅ compare by id + item['agent_id'] == selectedItem['agent_id'], // ✅ compare by id // validator: (val) { // if (val == null) { // return "Required"; // ✅ error message // } // return null; // }, - validator: (val) { - if (val == null || val.isEmpty) { - return ""; // 👈 triggers error border, no text - } - return null; - - // if (val == null || val.isEmpty) { - // return "Required"; - // } - // return null; - }, + // validator: (val) { + // if (val == null || val.isEmpty) { + // return ""; // 👈 triggers error border, no text + // } + // return null; + // + // // if (val == null || val.isEmpty) { + // // return "Required"; + // // } + // // return null; + // }, decoratorProps: DropDownDecoratorProps( decoration: @@ -641,7 +667,7 @@ class _DateFilterRowState extends ConsumerState { vertical: 3, ), child: Text( - item['name'].toString(), + "${item['agent_name']} | ${item['unused_commission_amount']} (${item['total_policies']})", style: GoogleFonts.inter(fontSize: 12, color: Colors.black), ), ); @@ -652,7 +678,7 @@ class _DateFilterRowState extends ConsumerState { // selectedPartnerIds = selectedVals // .map((v) => v['id'].toString()) // .toList(); - final ids = selectedVals.map((v) => v['id'].toString()).toList(); + final ids = selectedVals.map((v) => v['agent_id'].toString()).toList(); print("Selected PArnter IDs: $widget.selectedPartnerIds"); widget.onPartnerChanges?.call(ids); // widget.onPartnerChanges!(v['id']); diff --git a/lib/presentation/screens/payout/payout_screen.dart b/lib/presentation/screens/payout/payout_screen.dart index e5386e8..725c23b 100644 --- a/lib/presentation/screens/payout/payout_screen.dart +++ b/lib/presentation/screens/payout/payout_screen.dart @@ -138,7 +138,7 @@ class _PayOutScreenState extends ConsumerState { print('invoiceID $invoiceID'); print('brokerID $brokerID'); - _loadEditData(invoiceID, brokerID); + _loadEditData(invoiceID, brokerID,managerId); } } @@ -230,7 +230,7 @@ class _PayOutScreenState extends ConsumerState { }); } - void _loadEditData(String invoiceID, brokerID) async { + void _loadEditData(String invoiceID, brokerID, managerID) async { setState(() => isLoadingEditData = true); print('_loadEditData'); @@ -238,6 +238,7 @@ class _PayOutScreenState extends ConsumerState { // "id": invoiceID, "invoice_id": invoiceID, "broker_id": int.tryParse(brokerID ?? ''), + "manager_id": managerID // "issued_date": formattedTillDate, }; @@ -442,6 +443,28 @@ class _PayOutScreenState extends ConsumerState { ); } + // if (dashboardKey == 'f' && + // isDashboardInitialLoad && + // SelectedStatus == "P") { + // + // + // fromDt = "";toDt = ""; + // isDashboardInitialLoad = false; + // + // } else if (dashboardKey == 'f' && isDashboardInitialLoad && SelectedStatus != '') { + // fromDt = "";toDt = ""; + // isDashboardInitialLoad = false; + // } else if (fromDateVal.isEmpty && toDateVal.isEmpty) { + // // Default fallback + // final today = DateTime.now(); + // fromDt = DateFormat('dd-MM-yyyy').format(today.subtract(const Duration(days: 5))); + // toDt = DateFormat('dd-MM-yyyy').format(today); + // } else { + // // ✅ USER SELECTED DATE — ALWAYS RESPECT THIS + // fromDt = fromDateVal; + // toDt = toDateVal; + // } + // Load policies (simulate API) Future loadPolicies() async { print('loadPolicies'); @@ -454,7 +477,9 @@ class _PayOutScreenState extends ConsumerState { "from_date": controllers['startDate']?.text, "to_date": controllers['endDate']?.text, "broker_id": int.tryParse(selectedBrokerID ?? ''), - "agent_id": agentIds, + "manager_id": managerId, + if (agentIds != null && agentIds.isNotEmpty) "agent_id": agentIds, + // "agent_id": agentIds, // "issued_date": formattedTillDate, }; final response = await apiService.getCommissionRateList(jsondata); @@ -1296,6 +1321,8 @@ class _PayOutScreenState extends ConsumerState { } double _calculateTotalCommission() { + print("ASD"); + print(filteredPolicies); double total = 0.0; for (var p in filteredPolicies) { diff --git a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart index ef83700..811691b 100644 --- a/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart +++ b/lib/presentation/screens/staff/Enquiry/enquiry_inline_list.dart @@ -44,12 +44,16 @@ import 'enquiry_inline_SubRow.dart'; import 'multi_file_list.dart'; class EnquiryListStaffInline extends ConsumerStatefulWidget { + const EnquiryListStaffInline({super.key}); @override ConsumerState createState() => EnquiryStaffState(); } class EnquiryStaffState extends ConsumerState { + // bool fromDashboard = false; + bool _dashboardInitHandled = false; + bool _resetKeyEnable = false; int currentPage = 1; int itemsPerPage = 10; // int itemsPerPage = 5; @@ -169,9 +173,9 @@ class EnquiryStaffState extends ConsumerState { Map dataDetails() { final data = { "agent_id": - ((roleId == 'handler') || - (roleId == 'manager') || - (roleId == 'staff')) + ((roleId == 'handler') || + (roleId == 'manager') || + (roleId == 'staff')) ? selectedAgent : userId, "name": controllers["name"]?.text, @@ -198,19 +202,19 @@ class EnquiryStaffState extends ConsumerState { } final GlobalKey>> dropDownKey = - GlobalKey>>(); + GlobalKey>>(); final GlobalKey>> dropDownSelectPaymentModeKey = - GlobalKey>>(); + GlobalKey>>(); //---------------------- Assign Staff starts -------------------------------- // final GlobalKey>> dropDownKeyInsurerEnqAsgn = - GlobalKey>>(); + GlobalKey>>(); final GlobalKey>> dropDownKeyBroker = - GlobalKey>>(); + GlobalKey>>(); List> getStaffDetailsDataEnqAsgn = []; List> filteredStaffDataEnqAsgn = []; @@ -234,6 +238,26 @@ class EnquiryStaffState extends ConsumerState { //---------------------- Assign Staff Ends -------------------------------- // //---------------------- Enquiry TAB Initializations Ends -------------------------------- // + // @override + // void didChangeDependencies() { + // super.didChangeDependencies(); + + // if (_dashboardInitHandled) return; + // _dashboardInitHandled = true; + + // final extra = GoRouterState.of(context).extra; + + // if (extra is Map) { + // fromDashboard = extra['fromDashboard'] ?? false; + // } + + // // 🔥 IMPORTANT: Clear date pickers ONLY when coming from dashboard + // if (fromDashboard) { + // controllers['startDate']?.clear(); + // controllers['endDate']?.clear(); + // } + // } + @override void initState() { super.initState(); @@ -298,9 +322,9 @@ class EnquiryStaffState extends ConsumerState { getPaymentMode(); refreshSub = ref.listenManual(enquiryRefreshProvider, ( - previous, - next, - ) { + previous, + next, + ) { if (next == true) { print('refresh triggered Quick Creation'); autoRefrshfilterDateRange(); @@ -505,6 +529,9 @@ class EnquiryStaffState extends ConsumerState { } Future refrshfilterDateRange() async { + setState(() { + _resetKeyEnable = true; + }); print('refrshfilterDateRange'); // setState(() async { final prefs = await SharedPreferences.getInstance(); @@ -603,13 +630,13 @@ class EnquiryStaffState extends ConsumerState { } Future getStaffList( - int managerId, - role, { - String fromDate = '', - String toDate = '', - String SelectedStatus = '', - String SelectedStaffId = '', - }) async { + int managerId, + role, { + String fromDate = '', + String toDate = '', + String SelectedStatus = '', + String SelectedStaffId = '', + }) async { print('A613 => Fns called => $managerId | $role'); setState(() { isLoadingStaffList = true; @@ -624,16 +651,21 @@ class EnquiryStaffState extends ConsumerState { final dateFormat = DateFormat('dd-MM-yyyy'); if (dashboardKey == 'fromDashboard' && SelectedStatus == "PrevPending") { + setState(() { + _dashboardInitHandled = true; + }); // For PREV PENDING → set date range until yesterday final today = DateTime.now(); print('A813 => Fns called => $managerId | $role'); // Change to dd-MM-yyyy - final dateFormat = DateFormat('dd-MM-yyyy'); + // final dateFormat = DateFormat('dd-MM-yyyy'); + // + // final yesterday = today.subtract(Duration(days: 1)); - final yesterday = today.subtract(Duration(days: 1)); - - fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15))); - toDt = dateFormat.format(yesterday); + fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; + toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; + // fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15))); + // toDt = dateFormat.format(yesterday); print('PrevPending FROM TO - $fromDt - $toDt'); } else if (dashboardKey == 'fromDashboard' && @@ -645,8 +677,11 @@ class EnquiryStaffState extends ConsumerState { // Change to dd-MM-yyyy final dateFormat = DateFormat('dd-MM-yyyy'); - fromDt = dateFormat.format(today); - toDt = dateFormat.format(today); + // fromDt = dateFormat.format(today); + // toDt = dateFormat.format(today); + + fromDt = _dashboardInitHandled ? controllers['startDate']?.text : ''; + toDt = _dashboardInitHandled ? controllers['endDate']?.text : ''; print('PrevPending FROM TO - $fromDt - $toDt'); } else if (dashboardKey != 'fromDashboard' && @@ -664,8 +699,25 @@ class EnquiryStaffState extends ConsumerState { } else { print('A1113 => Fns called => $managerId | $role'); print('Enq 1- $fromDt - $toDt'); - fromDt = fromDateVal; - toDt = toDateVal; + + if(_resetKeyEnable = true){ + final dateFormat = DateFormat('dd-MM-yyyy'); + final today = DateTime.now(); + final yesterday = today.subtract(Duration(days: 1)); + + fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15))); + toDt = dateFormat.format(yesterday); + setState(() { + controllers['startDate']?.text = fromDt; + controllers['endDate']?.text = toDt; + }); + + } else { + fromDt = fromDateVal; + toDt = toDateVal; + } + + } print('Enq 2- $fromDt - $toDt'); String finalStatus = SelectedStatus; @@ -678,13 +730,13 @@ class EnquiryStaffState extends ConsumerState { managerId, userId, role, - fromDate: fromDt, - toDate: toDt, + fromDate: _dashboardInitHandled ? controllers['startDate']?.text : fromDt, + toDate: _dashboardInitHandled ? controllers['endDate']?.text : toDt, // selectedStatus: (finalStatus != '' && finalStatus != 'PrevPending') // ? finalStatus // : '', selectedStatus: - (SelectedStatus != '' && SelectedStatus != 'PrevPending') + (SelectedStatus != '' && SelectedStatus != 'PrevPending') ? SelectedStatus : '', selectedStaffId: SelectedStaffId ?? '', @@ -700,8 +752,13 @@ class EnquiryStaffState extends ConsumerState { print('A1213 => Fns called => $managerId | $role'); setState(() { + _resetKeyEnable = false; + controllers['startDate']?.text = fromDate; controllers['endDate']?.text = toDate; + + + if (data is List) { getStaffData = List>.from(data); @@ -946,8 +1003,8 @@ class EnquiryStaffState extends ConsumerState { // Search within the current tab's data filteredData = sourceList.where((item) { return (item['agent_name'] ?? '-').toLowerCase().contains( - query.toLowerCase(), - ) || + query.toLowerCase(), + ) || (item['agent_code'] ?? '-').toLowerCase().contains( query.toLowerCase(), ) || @@ -1013,11 +1070,11 @@ class EnquiryStaffState extends ConsumerState { } Future handleStaff( - BuildContext context, - dynamic data, - id, - regNum, - ) async { + BuildContext context, + dynamic data, + id, + regNum, + ) async { showDialog( context: context, builder: (ctx) => AssignStaffDialog( @@ -1152,7 +1209,7 @@ class EnquiryStaffState extends ConsumerState { final bool isNewRow = int.tryParse(id.toString()) != null && - int.parse(id.toString()) > 1000000000000; + int.parse(id.toString()) > 1000000000000; print('isNewRow - $isNewRow'); @@ -1160,20 +1217,20 @@ class EnquiryStaffState extends ConsumerState { if (isNewRow) { // Check if this is a new unsaved row final row = getStaffData.firstWhere( - (item) => item['id'].toString() == id.toString(), + (item) => item['id'].toString() == id.toString(), orElse: () => {}, ); // If policy_number is empty, it's a new row - remove it if (row.isNotEmpty) { getStaffData.removeWhere( - (item) => item['id'].toString() == id.toString(), + (item) => item['id'].toString() == id.toString(), ); originalData.removeWhere( - (item) => item['id'].toString() == id.toString(), + (item) => item['id'].toString() == id.toString(), ); filteredData.removeWhere( - (item) => item['id'].toString() == id.toString(), + (item) => item['id'].toString() == id.toString(), ); rowControllers.remove(id); } @@ -1293,10 +1350,10 @@ class EnquiryStaffState extends ConsumerState { Future attachFiles(http.MultipartRequest request) async { Future addFileOrKeepName( - PlatformFile? file, - String? apiFileName, - String fieldName, - ) async { + PlatformFile? file, + String? apiFileName, + String fieldName, + ) async { if (file != null) { // User uploaded a new file → send as multipart if (file.bytes != null) { @@ -1347,8 +1404,8 @@ class EnquiryStaffState extends ConsumerState { Future createUserData(Map userData) async { final bool isNewRow = idPrimary != null && - int.tryParse(idPrimary.toString()) != null && - int.parse(idPrimary.toString()) > 1000000000000; + int.tryParse(idPrimary.toString()) != null && + int.parse(idPrimary.toString()) > 1000000000000; final bool isUpdating = idPrimary != null && idPrimary != 'null' && !isNewRow; @@ -1577,26 +1634,26 @@ class EnquiryStaffState extends ConsumerState { // SizedBox(height: 5), ResponsiveLayout.isMobile(context) ? Container( - height: MediaQuery.of(context).size.height * 0.69, - child: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(2), - child: _buildContent(context), - ), - ), - ) + height: MediaQuery.of(context).size.height * 0.69, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(2), + child: _buildContent(context), + ), + ), + ) : - // Expanded( - // child: - Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.69, - // padding: EdgeInsets.symmetric( - // horizontal: 8.0, - // vertical: 2.0, - // ), - child: _buildContent(context), - ), + // Expanded( + // child: + Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.69, + // padding: EdgeInsets.symmetric( + // horizontal: 8.0, + // vertical: 2.0, + // ), + child: _buildContent(context), + ), ], ), ), @@ -1615,7 +1672,7 @@ class EnquiryStaffState extends ConsumerState { final result = await showDialog( context: context, barrierDismissible: - false, // optional - prevents closing by tapping outside + false, // optional - prevents closing by tapping outside builder: (context) => TabEnquiryStaffList(showKey: val), ); @@ -1626,10 +1683,10 @@ class EnquiryStaffState extends ConsumerState { } Future buildPolicyCreatedStatusActions( - BuildContext context, - status, - id, - ) async { + BuildContext context, + status, + id, + ) async { print("Actionsstatus - $status -$id"); dynamic val; if (status == 'Awaiting Proposal' || status == 'Proposal Created') { @@ -1641,7 +1698,7 @@ class EnquiryStaffState extends ConsumerState { final result = await showDialog( context: context, barrierDismissible: - false, // optional - prevents closing by tapping outside + false, // optional - prevents closing by tapping outside builder: (context) => PolicyStaffEnqList(), ); @@ -1748,7 +1805,7 @@ class EnquiryStaffState extends ConsumerState { userPreference = newValue; // Save this as the new "normal" }); final prefs = - await SharedPreferences.getInstance(); + await SharedPreferences.getInstance(); await prefs.setBool( 'isActionable', newValue, @@ -1817,7 +1874,7 @@ class EnquiryStaffState extends ConsumerState { // }); }, child: ThemedSearchField( - hintText: 'Search *', + hintText: 'Search', backgroundColor: Color(0xFFFFFFFF), txtHeight: 30, controller: _searchStaffController, @@ -1851,11 +1908,11 @@ class EnquiryStaffState extends ConsumerState { txt: !ResponsiveLayout.isMobile(context) ? true : false, displayHeaders: [ "Received Date & Time", - "Partner", "Assigned To", + "Partner", "Insurer", - "Vehicle.No.", "Insured Name", + "Vehicle.No.", "Assigned Date & Time", "Premium", "Payment Mode", @@ -1864,14 +1921,14 @@ class EnquiryStaffState extends ConsumerState { ], keys: [ "created_on", - "agent_name", "assigned_to_name", + "agent_name", "insurer_short_name", - "reg_no", "insured_name", + "reg_no", "updated_on", "premium_amount", - "payment_mode", + "payment_mode_value", "policy_number", "status", ], @@ -1885,12 +1942,12 @@ class EnquiryStaffState extends ConsumerState { ResponsiveLayout.isMobile(context) ? _buildDataTable(context) : Container( - height: MediaQuery.of(context).size.height * 0.55, - // decoration: BoxDecoration( - // color: Colors.white - // ), - child: _buildDataTable(context), - ), + height: MediaQuery.of(context).size.height * 0.55, + // decoration: BoxDecoration( + // color: Colors.white + // ), + child: _buildDataTable(context), + ), ], ); } @@ -2036,54 +2093,54 @@ class EnquiryStaffState extends ConsumerState { // Calculate minimum width based on screen size double minTableWidth = isMobile ? screenWidth * 1.5 : 1300; return - // Expanded( - // child: - LayoutBuilder( - builder: (context, constraints) { - double tableWidth = constraints.maxWidth > minTableWidth - ? constraints.maxWidth - : minTableWidth; + // Expanded( + // child: + LayoutBuilder( + builder: (context, constraints) { + double tableWidth = constraints.maxWidth > minTableWidth + ? constraints.maxWidth + : minTableWidth; - final isDesktop = !ResponsiveLayout.isMobile(context); + final isDesktop = !ResponsiveLayout.isMobile(context); - return ScrollConfiguration( - behavior: const MaterialScrollBehavior().copyWith( - dragDevices: {PointerDeviceKind.mouse, PointerDeviceKind.touch}, - ), - child: SingleChildScrollView( - controller: _horizontalScrollController, // 👈 Shared controller - scrollDirection: Axis.horizontal, - child: SizedBox( - // width: minWidth, - width: tableWidth, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Fixed Header - Container( - decoration: BoxDecoration( - // color: Colors.white, - color: Color(0xFFF1F5F9), - borderRadius: BorderRadius.circular(5), + return ScrollConfiguration( + behavior: const MaterialScrollBehavior().copyWith( + dragDevices: {PointerDeviceKind.mouse, PointerDeviceKind.touch}, + ), + child: SingleChildScrollView( + controller: _horizontalScrollController, // 👈 Shared controller + scrollDirection: Axis.horizontal, + child: SizedBox( + // width: minWidth, + width: tableWidth, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Fixed Header + Container( + decoration: BoxDecoration( + // color: Colors.white, + color: Color(0xFFF1F5F9), + borderRadius: BorderRadius.circular(5), + ), + child: _buildTableHeader(isDesktop), ), - child: _buildTableHeader(isDesktop), - ), - // Scrollable Data Content - Expanded( - child: Container( - decoration: BoxDecoration(color: Colors.white), - child: _buildDataTableContent(), // 👈 New method + // Scrollable Data Content + Expanded( + child: Container( + decoration: BoxDecoration(color: Colors.white), + child: _buildDataTableContent(), // 👈 New method + ), ), - ), - _buildPaginationControls(), - ], + _buildPaginationControls(), + ], + ), ), ), - ), - ); - }, - ); + ); + }, + ); // ); } @@ -2295,10 +2352,10 @@ class EnquiryStaffState extends ConsumerState { // Helper: Build action buttons Widget _buildActionButtons( - Map item, - int id, - String selectId, - ) { + Map item, + int id, + String selectId, + ) { return Row( children: [ _buildInfoTooltip(item), @@ -2370,8 +2427,8 @@ class EnquiryStaffState extends ConsumerState { onTap: () async { final button = buttonContext.findRenderObject() as RenderBox; final overlay = - Overlay.of(buttonContext).context.findRenderObject() - as RenderBox; + Overlay.of(buttonContext).context.findRenderObject() + as RenderBox; final position = button.localToGlobal( Offset.zero, ancestor: overlay, @@ -2417,9 +2474,6 @@ class EnquiryStaffState extends ConsumerState { ); } - String normalizedStatus(dynamic value) { - return value?.toString().trim().toLowerCase() ?? ''; - } // Helper: Status cell with conditional actions Widget _buildStatusCell( Map item, @@ -2461,11 +2515,11 @@ class EnquiryStaffState extends ConsumerState { // Helper: Status display container Widget _buildStatusContainer( - Map item, - int id, - Color bgColor, - Color borderColor, - ) { + Map item, + int id, + Color bgColor, + Color borderColor, + ) { return Material( color: Colors.white, child: InkWell( @@ -2484,13 +2538,7 @@ class EnquiryStaffState extends ConsumerState { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - (item['enquiry_status'] ?? '-') - .toString() - .toLowerCase() - .split(' ') - .where((w) => w.isNotEmpty) - .map((w) => w[0].toUpperCase() + w.substring(1)) - .join(' '), + item['enquiry_status'] ?? '-', style: GoogleFonts.inter( fontSize: 10, color: Color(0XFF1e293b), @@ -2645,7 +2693,7 @@ class EnquiryStaffState extends ConsumerState { child: InkWell( onTap: () => apiService.downloadFile( apiUrl: - 'api/policy/downloadPolicyFile?policy_id=${item["policy_id"]}&file_type=policy_pdf', + 'api/policy/downloadPolicyFile?policy_id=${item["policy_id"]}&file_type=policy_pdf', apiId: item["policy_id"], localFile: null, fileName: item['policy_pdf_file_name'], @@ -2685,12 +2733,12 @@ class EnquiryStaffState extends ConsumerState { // Helper: Show policy upload menu Future _showPolicyUploadMenu( - BuildContext buttonContext, - Map item, - ) async { + BuildContext buttonContext, + Map item, + ) async { final button = buttonContext.findRenderObject() as RenderBox; final overlay = - Overlay.of(buttonContext).context.findRenderObject() as RenderBox; + Overlay.of(buttonContext).context.findRenderObject() as RenderBox; final position = button.localToGlobal(Offset.zero, ancestor: overlay); await showMenu( @@ -2723,7 +2771,7 @@ class EnquiryStaffState extends ConsumerState { Widget _buildPolicyUploadField(Map item) { return ThemedUploadField( hintText: - selectedFileNames ?? + selectedFileNames ?? item['policy_pdf_file_name'] ?? "Upload Document", padHorizontal: 4, @@ -2741,10 +2789,10 @@ class EnquiryStaffState extends ConsumerState { // Helper: Handle policy file upload Future _handlePolicyFileUpload( - String? fileName, - PlatformFile? file, - Map item, - ) async { + String? fileName, + PlatformFile? file, + Map item, + ) async { if (lastPickedFile == fileName) { ToastHelper.showErrorToast(context, 'Please upload a new file.'); setState(() { @@ -2786,7 +2834,7 @@ class EnquiryStaffState extends ConsumerState { Map? _getSelectedPaymentMode(Map item) { try { return filteredPaymentModeData.firstWhere( - (mode) => mode['id'].toString() == item['payment_mode_id'].toString(), + (mode) => mode['id'].toString() == item['payment_mode_id'].toString(), orElse: () => {}, ); } catch (e) { @@ -2797,8 +2845,8 @@ class EnquiryStaffState extends ConsumerState { Map? _getSelectedInsurancePlan(Map item) { try { return filteredInsuranceData.firstWhere( - (mode) => - mode['insurance_plan_type'].toString().trim().toLowerCase() == + (mode) => + mode['insurance_plan_type'].toString().trim().toLowerCase() == item['insurance_plan_type'].toString().trim().toLowerCase(), orElse: () => {}, ); @@ -2840,8 +2888,8 @@ class EnquiryStaffState extends ConsumerState { Widget _buildDropdownDisplay(dynamic selectedItem, String key, String hint) { bool isEmpty = selectedItem == null || - selectedItem.isEmpty || - selectedItem[key] == null; + selectedItem.isEmpty || + selectedItem[key] == null; return Container( padding: EdgeInsets.zero, @@ -3123,7 +3171,7 @@ class EnquiryStaffState extends ConsumerState { decoration: BoxDecoration( // borderRadius: BorderRadius.circular(6), color: isSelected - // ? Color(0xFFF1F5F9) + // ? Color(0xFFF1F5F9) ? const Color(0xFF2E7D6E).withOpacity(0.08) : Colors.transparent, border: Border.all( @@ -3250,9 +3298,9 @@ class EnquiryStaffState extends ConsumerState { .split(' ') .map( (word) => word.isNotEmpty - ? word[0].toUpperCase() + word.substring(1).toLowerCase() - : '', - ) + ? word[0].toUpperCase() + word.substring(1).toLowerCase() + : '', + ) .join(' '); } @@ -3460,8 +3508,8 @@ class EnquiryStaffState extends ConsumerState { icon: Icon(Icons.last_page, size: 18), onPressed: completedCurrentPage < totalCompletedPages ? () => setState( - () => completedCurrentPage = totalCompletedPages, - ) + () => completedCurrentPage = totalCompletedPages, + ) : null, color: completedCurrentPage < totalCompletedPages ? Color(0xFF2E7D6E) @@ -3583,8 +3631,8 @@ class EnquiryStaffState extends ConsumerState { icon: Icon(Icons.last_page, size: 18), onPressed: completedCurrentPage < totalCompletedPages ? () => setState( - () => completedCurrentPage = totalCompletedPages, - ) + () => completedCurrentPage = totalCompletedPages, + ) : null, color: completedCurrentPage < totalCompletedPages ? Color(0xFF2E7D6E) @@ -3650,4 +3698,4 @@ class EnquiryStaffState extends ConsumerState { return pageButtons; } -} +} \ No newline at end of file diff --git a/lib/presentation/themes/indicators/export_btn.dart b/lib/presentation/themes/indicators/export_btn.dart index ca4762b..9f81926 100644 --- a/lib/presentation/themes/indicators/export_btn.dart +++ b/lib/presentation/themes/indicators/export_btn.dart @@ -174,22 +174,23 @@ class ExcelExporter { final rowMap = reversedData[i]; final row = []; + // Inside ExcelExporter class -> exportToExcel method for (var key in keys) { dynamic value; - if (key == 'sno' || - key.toLowerCase() == 's.no' || - key.toLowerCase() == 'sno.') { - value = i + 1; // serial number (descending) + + if (key == 'sno' || key.toLowerCase() == 's.no' || key.toLowerCase() == 'sno.') { + value = i + 1; } else if (key.toLowerCase() == 'is_active') { - // ✅ Handle Active/Inactive display final rawVal = rowMap[key]; value = (rawVal == 1 || rawVal == '1') ? 'Active' : 'Inactive'; } else { + // FIX: Ensure we extract the value and check if it's "null" as a string value = rowMap[key]; + if (value == "null") value = null; } - if (value == null) { - row.add(TextCellValue('-')); + if (value == null || value.toString().trim().isEmpty) { + row.add(TextCellValue('-')); // This ensures the column isn't empty } else if (value is int) { row.add(IntCellValue(value)); } else if (value is double) { @@ -198,10 +199,10 @@ class ExcelExporter { row.add(TextCellValue(value.toString())); } } - sheet.appendRow(row); } + final excelBytes = excel.encode(); if (excelBytes == null) throw Exception('Failed to encode Excel file'); diff --git a/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart b/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart index 10f0e8d..ef48198 100644 --- a/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart +++ b/lib/presentation/widgets/custom_Stdate_EnDate_Filter.dart @@ -282,7 +282,7 @@ class _DateFilterRowState extends ConsumerState { 'dd-MM-yyyy', ).format(date); // controllers['date']?.text = date as String; - Future.microtask(() => widget.onFilter()); + // Future.microtask(() => widget.onFilter()); }, ), ),