From c2521ed76b040ab55cadaad15e260d2f85c142b0 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 7 Apr 2026 15:33:17 +0530 Subject: [PATCH] FIX_grid Details - Segment Changes --- .flutter-plugins-dependencies | 2 +- lib/core/services/api_service.dart | 28 +++--- .../UserManagement/Agent/agentList.dart | 46 ++++++--- .../UserManagement/Agent/agent_details.dart | 98 ++++++++++++------- .../dashboard/partner_portal_dashboard.dart | 10 ++ .../screens/payout/invoice_list.dart | 18 ++++ .../screens/payout/payout_details_view.dart | 29 +++--- pubspec.lock | 22 ++--- 8 files changed, 171 insertions(+), 82 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index ac80154..460a3e8 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-04-07 09:46:11.211850","version":"3.41.4","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-04-07 10:33:01.033828","version":"3.41.4","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 b72c4c2..f8aba41 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -938,6 +938,7 @@ class ApiService { final searchTrimmed = search?.trim(); final loggedIdTrimmed = loggedId?.trim(); final endpoint = Uri.parse('${Env.apiUrl}grid'); + // final endpoint = Uri.parse('http://localhost/nhance_partner_be/grid'); final roleLower = roleTrimmed?.toLowerCase(); final queryParameters = {}; @@ -1086,7 +1087,6 @@ class ApiService { } final url = Uri.parse('${Env.apiUrl}agent/exportRetentionRateExcel'); - // final url = Uri.parse('http://localhost/nhance_partner_be/agent/exportRetentionRateExcel'); final headers = { 'Authorization': 'Bearer ${_token ?? ''}', 'app-signature': Env.App_Signature, @@ -1122,7 +1122,6 @@ class ApiService { } final url = Uri.parse('${Env.apiUrl}agent/importRetentionRateExcel'); - // final url = Uri.parse('http://localhost/nhance_partner_be/agent/importRetentionRateExcel'); try { final request = http.MultipartRequest('POST', url); request.headers.addAll({ @@ -1141,6 +1140,15 @@ class ApiService { filename: file.name, ), ); + // Backward/forward compatibility: + // some backend versions expect `retention_rate_excel`. + request.files.add( + http.MultipartFile.fromBytes( + 'retention_rate_excel', + file.bytes!, + filename: file.name, + ), + ); final streamedResponse = await request.send(); final responseBody = await streamedResponse.stream.bytesToString(); @@ -1202,6 +1210,7 @@ class ApiService { Future> updateAgentVehicleRetention({ required String agentId, required String vehicleTypeId, + required String segmentId, required String retentionRate, required String updatedBy, }) async { @@ -1217,6 +1226,7 @@ class ApiService { final body = { 'agent_id': agentId, 'vehicle_type_id': vehicleTypeId, + 'segment_id': segmentId, 'retention_rate': retentionRate, 'updated_by': updatedBy, }; @@ -1547,7 +1557,6 @@ class ApiService { if (_token == null) await _initializeToken(); final url = Uri.parse('${Env.apiUrl}partner/$id/details'); - // final url = Uri.parse('http://localhost/nhance_partner_be/partner/$id/details'); final headers = { 'Authorization': 'Bearer $_token', @@ -1563,7 +1572,6 @@ class ApiService { if (_token == null) await _initializeToken(); final url = Uri.parse('${Env.apiUrl}partner/$id/policies'); - // final url = Uri.parse('http://localhost/nhance_partner_be/partner/$id/details/policies'); final headers = { 'Authorization': 'Bearer $_token', @@ -1583,7 +1591,7 @@ class ApiService { if (_token == null) await _initializeToken(); final url = Uri.parse('${Env.apiUrl}partner/$id/renewals?days=$days'); - // final url = Uri.parse('http://localhost/nhance_partner_be/partner/$id/renewals?days=$days'); + final headers = { 'Authorization': 'Bearer $_token', 'app-signature': Env.App_Signature, @@ -1604,7 +1612,7 @@ class ApiService { ? '?financial_year=${Uri.encodeQueryComponent(financialYear)}' : ''; final url = Uri.parse('${Env.apiUrl}partner/$id/earnings$q'); - // final url = Uri.parse('http://localhost/nhance_partner_be/partner/$id/earnings$q'); + final headers = { 'Authorization': 'Bearer $_token', 'app-signature': Env.App_Signature, @@ -2145,9 +2153,6 @@ class ApiService { '${Env.apiUrl}invoice/getAgentUnusedCommissionList?manager_id=$id', ); - // url = Uri.parse( - // 'http://localhost/nhance_partner_be/invoice/getAgentUnusedCommissionList?manager_id=$id', - // ); print('fetchAGENTNameDropDown 2'); final headers = { @@ -2288,9 +2293,9 @@ class ApiService { if (managerId != null) 'manager_id': managerId.toString(), }; - final url = Uri.parse('${Env.apiUrl}invoice/view').replace( + final url = Uri.parse('${Env.apiUrl}invoice/view').replace( queryParameters: queryParameters, - ); + ); final headers = { 'Authorization': 'Bearer $_token', @@ -2302,7 +2307,6 @@ class ApiService { Future> getCreateOrUpdate(data) async { final url = Uri.parse('${Env.apiUrl}invoice/create-or-update'); - // final url = Uri.parse('http://localhost/nhance_partner_be/invoice/create-or-update'); // final token = await getToken(); // Fetch token diff --git a/lib/presentation/screens/UserManagement/Agent/agentList.dart b/lib/presentation/screens/UserManagement/Agent/agentList.dart index baa855b..10e633f 100644 --- a/lib/presentation/screens/UserManagement/Agent/agentList.dart +++ b/lib/presentation/screens/UserManagement/Agent/agentList.dart @@ -188,14 +188,14 @@ class AgentListState extends ConsumerState { if (mounted) { ToastHelper.showSuccessToast( context, - 'Rentation rate Excel downloaded', + 'Retention rate Excel downloaded', ); } } catch (e) { if (mounted) { ToastHelper.showErrorToast( context, - 'Failed to export rentation rate Excel', + 'Failed to export retention rate Excel', ); } } @@ -234,26 +234,30 @@ class AgentListState extends ConsumerState { final report = (response['report'] is Map) ? response['report'] as Map : {}; - - final inserted = (data['inserted_cells'] ?? 0).toString(); - final updated = (data['updated_cells'] ?? 0).toString(); + final inserted = (data['inserted_cells'] ?? data['inserted_rows'] ?? 0); + final updated = (data['updated_cells'] ?? data['updated_rows'] ?? 0); + final message = (response['message'] ?? '').toString().trim(); if (mounted) { ToastHelper.showSuccessToast( context, - 'Import done', + message.isNotEmpty + ? message + : 'Import done (Inserted: $inserted, Updated: $updated)', ); } - // doN'T Delete This function And Related Codes - // await _showRetentionImportReportDialog(data, report); + if (report.isNotEmpty && mounted) { + await _showRetentionImportReportDialog(data, report); + } refresh(); } else { if (mounted) { - ToastHelper.showErrorToast(context, 'Import failed'); + final message = (response['message'] ?? 'Import failed').toString(); + ToastHelper.showErrorToast(context, message); } } } catch (e) { if (mounted) { - ToastHelper.showErrorToast(context, 'Failed to import rentation rate'); + ToastHelper.showErrorToast(context, 'Failed to import retention rate'); } } finally { if (mounted) { @@ -285,7 +289,14 @@ class AgentListState extends ConsumerState { .where((e) => e.trim().isNotEmpty) .toList() ?? []; - final unknownVehicleTypes = (report['unknown_vehicle_types'] as List?) + final unknownVehicleTypes = ((report['unknown_vehicle_types'] ?? + report['unknown_vehicle_type_names']) as List?) + ?.map((e) => e.toString()) + .where((e) => e.trim().isNotEmpty) + .toList() ?? + []; + final unknownSegments = ((report['unknown_segments'] ?? + report['unknown_segment_names']) as List?) ?.map((e) => e.toString()) .where((e) => e.trim().isNotEmpty) .toList() ?? @@ -322,13 +333,22 @@ class AgentListState extends ConsumerState { if (unknownVehicleTypes.isNotEmpty) { lines.add(''); - lines.add('Unknown Vehicle Types (header):'); + lines.add('Unknown Vehicle Types:'); lines.addAll(unknownVehicleTypes.take(10).map((e) => '- $e')); if (unknownVehicleTypes.length > 10) { lines.add('- ...and ${unknownVehicleTypes.length - 10} more'); } } + if (unknownSegments.isNotEmpty) { + lines.add(''); + lines.add('Unknown Segments:'); + lines.addAll(unknownSegments.take(10).map((e) => '- $e')); + if (unknownSegments.length > 10) { + lines.add('- ...and ${unknownSegments.length - 10} more'); + } + } + if (invalidCells.isNotEmpty) { lines.add(''); lines.add('Invalid Cell Samples:'); @@ -366,7 +386,7 @@ class AgentListState extends ConsumerState { context: context, builder: (ctx) { return AlertDialog( - title: const Text('Rentation Rate Import Report'), + title: const Text('Retention Rate Import Report'), content: SizedBox( width: 520, child: SingleChildScrollView( diff --git a/lib/presentation/screens/UserManagement/Agent/agent_details.dart b/lib/presentation/screens/UserManagement/Agent/agent_details.dart index d9fb08a..62ef6ba 100644 --- a/lib/presentation/screens/UserManagement/Agent/agent_details.dart +++ b/lib/presentation/screens/UserManagement/Agent/agent_details.dart @@ -75,7 +75,7 @@ class _AgentDetailsScreenState extends ConsumerState { GlobalKey>>(); List> _vehicleTypes = []; - final Map _rateControllers = {}; + final Map _rateControllers = {}; List> _salesExecutives = []; dynamic _selectedSalesExecutiveId; @@ -157,35 +157,46 @@ class _AgentDetailsScreenState extends ConsumerState { } catch (_) {} } - void _initRateControllersFromTypes({Map? initial}) { + String _retentionKey(int vehicleTypeId, int segmentId) => '${vehicleTypeId}_$segmentId'; + + int _readInt(dynamic value) => int.tryParse(value?.toString() ?? '') ?? 0; + + String _displayVehicleSegment(Map vt) { + final name = (vt['vehicle_type'] ?? '-').toString(); + final segment = (vt['segment'] ?? '').toString().trim(); + if (segment.isEmpty) return name; + return '$name - $segment'; + } + + void _initRateControllersFromTypes({Map? initial}) { for (final c in _rateControllers.values) { c.dispose(); } _rateControllers.clear(); for (final vt in _vehicleTypes) { - final id = int.tryParse(vt['id'].toString()) ?? 0; - if (id == 0) continue; - final text = initial?[id] ?? ''; - _rateControllers[id] = TextEditingController(text: text); + final vehicleTypeId = _readInt(vt['vehicle_type_id'] ?? vt['id']); + final segmentId = _readInt(vt['segment_id']); + if (vehicleTypeId == 0 || segmentId == 0) continue; + final key = _retentionKey(vehicleTypeId, segmentId); + final text = initial?[key] ?? ''; + _rateControllers[key] = TextEditingController(text: text); } } - /// Builds vehicle_type_id → retention % text from [findAgent] (or compatible) payload. - Map _retentionMapFromAgentData(Map data) { - final Map initial = {}; + /// Builds (vehicle_type_id + segment_id) → retention % text from [findAgent]. + Map _retentionMapFromAgentData(Map data) { + final Map initial = {}; final raw = data['retention_by_vehicle'] ?? data['retentionByVehicle']; if (raw is! List) return initial; for (final row in raw) { if (row is! Map) continue; final m = Map.from(row); - final vid = int.tryParse( - (m['vehicle_type_id'] ?? m['vehicleTypeId'] ?? '').toString(), - ) ?? - 0; - if (vid == 0) continue; + final vid = _readInt(m['vehicle_type_id'] ?? m['vehicleTypeId']); + final sid = _readInt(m['segment_id'] ?? m['segmentId']); + if (vid == 0 || sid == 0) continue; final rate = m['retention_rate'] ?? m['retentionRate']; if (rate == null) continue; - initial[vid] = rate.toString(); + initial[_retentionKey(vid, sid)] = rate.toString(); } return initial; } @@ -238,9 +249,13 @@ class _AgentDetailsScreenState extends ConsumerState { List> get _filteredVehicleTypes { final q = _retentionSearchCtrl.text.trim().toLowerCase(); if (q.isEmpty) return _vehicleTypes; - return _vehicleTypes - .where((vt) => (vt['vehicle_type'] ?? '').toString().toLowerCase().contains(q)) - .toList(); + final terms = q.split(RegExp(r'\s+')).where((t) => t.isNotEmpty).toList(); + return _vehicleTypes.where((vt) { + final vehicle = (vt['vehicle_type'] ?? '').toString().toLowerCase(); + final segment = (vt['segment'] ?? '').toString().toLowerCase(); + final searchable = '$vehicle $segment'; + return terms.every(searchable.contains); + }).toList(); } @override @@ -261,16 +276,19 @@ class _AgentDetailsScreenState extends ConsumerState { List> _collectBulkRetentionPayload() { final out = >[]; for (final vt in _vehicleTypes) { - final id = int.tryParse(vt['id'].toString()) ?? 0; - if (id == 0) continue; - final ctrl = _rateControllers[id]; + final vehicleTypeId = _readInt(vt['vehicle_type_id'] ?? vt['id']); + final segmentId = _readInt(vt['segment_id']); + if (vehicleTypeId == 0 || segmentId == 0) continue; + final key = _retentionKey(vehicleTypeId, segmentId); + final ctrl = _rateControllers[key]; if (ctrl == null) continue; final t = ctrl.text.trim(); if (t.isEmpty) continue; final v = double.tryParse(t); if (v == null || v < 0 || v > 100) continue; out.add({ - 'vehicle_type_id': id, + 'vehicle_type_id': vehicleTypeId, + 'segment_id': segmentId, 'retention_rate': v, }); } @@ -360,7 +378,7 @@ class _AgentDetailsScreenState extends ConsumerState { return null; } - Future _saveRowRetention(int vehicleTypeId) async { + Future _saveRowRetention(Map vt) async { if (!_retentionTableEnabled) { ToastHelper.showWarningToast( context, @@ -369,7 +387,14 @@ class _AgentDetailsScreenState extends ConsumerState { return; } if (_savingAllRetention) return; - final ctrl = _rateControllers[vehicleTypeId]; + final vehicleTypeId = _readInt(vt['vehicle_type_id'] ?? vt['id']); + final segmentId = _readInt(vt['segment_id']); + if (vehicleTypeId == 0 || segmentId == 0) { + ToastHelper.showErrorToast(context, 'Vehicle type or segment missing'); + return; + } + final key = _retentionKey(vehicleTypeId, segmentId); + final ctrl = _rateControllers[key]; if (ctrl == null) return; final t = ctrl.text.trim(); if (t.isEmpty) { @@ -391,6 +416,7 @@ class _AgentDetailsScreenState extends ConsumerState { final res = await _api.updateAgentVehicleRetention( agentId: _loadedAgentPk!, vehicleTypeId: '$vehicleTypeId', + segmentId: '$segmentId', retentionRate: t, updatedBy: userId, ); @@ -1126,7 +1152,7 @@ class _AgentDetailsScreenState extends ConsumerState { SizedBox( width: 220, child: ThemedSearchField( - hintText: 'Search vehicle type', + hintText: 'Search vehicle type and segment', backgroundColor: Colors.white, txtHeight: 34, controller: _retentionSearchCtrl, @@ -1267,9 +1293,11 @@ class _AgentDetailsScreenState extends ConsumerState { } Widget _retentionMobileCard(Map vt) { - final id = int.tryParse(vt['id'].toString()) ?? 0; - final name = (vt['vehicle_type'] ?? '-').toString(); - final ctrl = _rateControllers[id]; + final vehicleTypeId = _readInt(vt['vehicle_type_id'] ?? vt['id']); + final segmentId = _readInt(vt['segment_id']); + final key = _retentionKey(vehicleTypeId, segmentId); + final name = _displayVehicleSegment(vt); + final ctrl = _rateControllers[key]; if (ctrl == null) return const SizedBox.shrink(); return Padding( @@ -1305,7 +1333,7 @@ class _AgentDetailsScreenState extends ConsumerState { alignment: Alignment.centerRight, child: TextButton( onPressed: (_retentionTableEnabled && !_retentionActionsBusy) - ? () => _saveRowRetention(id) + ? () => _saveRowRetention(vt) : null, style: TextButton.styleFrom( foregroundColor: const Color(0xFF2E7D6E), @@ -1337,7 +1365,7 @@ class _AgentDetailsScreenState extends ConsumerState { Expanded( flex: 5, child: Text( - 'Vehicle type', + 'Vehicle type / Segment', style: _headerStyle, overflow: TextOverflow.ellipsis, ), @@ -1365,9 +1393,11 @@ class _AgentDetailsScreenState extends ConsumerState { } Widget _retentionDataRow(Map vt) { - final id = int.tryParse(vt['id'].toString()) ?? 0; - final name = (vt['vehicle_type'] ?? '-').toString(); - final ctrl = _rateControllers[id]; + final vehicleTypeId = _readInt(vt['vehicle_type_id'] ?? vt['id']); + final segmentId = _readInt(vt['segment_id']); + final key = _retentionKey(vehicleTypeId, segmentId); + final name = _displayVehicleSegment(vt); + final ctrl = _rateControllers[key]; if (ctrl == null) return const SizedBox.shrink(); return Container( @@ -1409,7 +1439,7 @@ class _AgentDetailsScreenState extends ConsumerState { child: Center( child: TextButton( onPressed: (_retentionTableEnabled && !_retentionActionsBusy) - ? () => _saveRowRetention(id) + ? () => _saveRowRetention(vt) : null, style: TextButton.styleFrom( foregroundColor: const Color(0xFF2E7D6E), diff --git a/lib/presentation/screens/dashboard/partner_portal_dashboard.dart b/lib/presentation/screens/dashboard/partner_portal_dashboard.dart index 563d4f6..2ae3089 100644 --- a/lib/presentation/screens/dashboard/partner_portal_dashboard.dart +++ b/lib/presentation/screens/dashboard/partner_portal_dashboard.dart @@ -444,6 +444,7 @@ class _RenewalAlertsCard extends StatelessWidget { const SizedBox(width: 8), Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Renewal Alerts', style: _chartHeader), Text( @@ -512,6 +513,7 @@ class _RenewalAlertsCard extends StatelessWidget { children: [ SizedBox(width: 40, child: Text('S.No', style: _tableHeadStyle)), Expanded(flex: 2, child: Text('Policy No.', style: _tableHeadStyle)), + Expanded(flex: 2, child: Text('Vehicle Type', style: _tableHeadStyle)), Expanded(flex: 2, child: Text('Policy Holder Name', style: _tableHeadStyle)), Expanded(flex: 2, child: Text('Expiry Date', style: _tableHeadStyle)), Expanded( @@ -587,6 +589,14 @@ class _RenewalTableRow extends StatelessWidget { overflow: TextOverflow.ellipsis, ), ), + Expanded( + flex: 2, + child: Text( + renewal['vehicle_type']?.toString() ?? '--', + style: _tableTeal, + overflow: TextOverflow.ellipsis, + ), + ), Expanded( flex: 2, child: Text( diff --git a/lib/presentation/screens/payout/invoice_list.dart b/lib/presentation/screens/payout/invoice_list.dart index 010474e..d843ad6 100644 --- a/lib/presentation/screens/payout/invoice_list.dart +++ b/lib/presentation/screens/payout/invoice_list.dart @@ -182,6 +182,9 @@ class _InvoiceListState extends ConsumerState { (item['invoice_no'] ?? '-').toLowerCase().contains( query.toLowerCase(), ) || + (item['vehicle_types'] ?? '-').toLowerCase().contains( + query.toLowerCase(), + ) || (item['invoice_amount_indian_format'] ?? '-') .toLowerCase() .contains(query.toLowerCase()) || @@ -742,6 +745,7 @@ class _InvoiceListState extends ConsumerState { displayHeaders: [ "S.No", "Invoice No", + "Vehicle Type", "Invoice Date", "Broker Name", "POS Name", @@ -756,6 +760,7 @@ class _InvoiceListState extends ConsumerState { keys: [ "id", "invoice_no", + "vehicle_types", "invoice_date", "broker_name", "pos_name", @@ -789,6 +794,10 @@ class _InvoiceListState extends ConsumerState { flex: 3, child: Text('Invoice No', style: _headerStyle), ), + Expanded( + flex: 3, + child: Text('Vehicle Type', style: _headerStyle), + ), Expanded( flex: 2, child: Text('Broker Name', style: _headerStyle), @@ -885,6 +894,15 @@ class _InvoiceListState extends ConsumerState { maxLines: 3, ), ), + Expanded( + flex: 3, + child: Text( + _displayText(item['vehicle_types']), + style: _dataBold, + softWrap: true, + maxLines: 3, + ), + ), Expanded( flex: 2, child: Text( diff --git a/lib/presentation/screens/payout/payout_details_view.dart b/lib/presentation/screens/payout/payout_details_view.dart index 50f7a31..9d31f5c 100644 --- a/lib/presentation/screens/payout/payout_details_view.dart +++ b/lib/presentation/screens/payout/payout_details_view.dart @@ -137,6 +137,7 @@ class _PayOutDetailsViewState extends ConsumerState { } filteredPolicies = masterPolicies.where((item) { return (item['policy_no'] ?? '').toString().contains(q) || + (item['vehicle_type'] ?? '').toString().contains(q) || (item['customer_name'] ?? '').toString().contains(q) || (item['agent_name'] ?? '').toString().contains(q) || (item['insurer_name'] ?? '').toString().contains(q) || @@ -186,10 +187,11 @@ class _PayOutDetailsViewState extends ConsumerState { List _columnWidths(double maxWidth) { const sidePadding = 32.0; // 16 left + 16 right final usable = (maxWidth - sidePadding).clamp(720.0, 2000.0); - const totalFlex = 2 + 14 + 10 + 20 + 16 + 11 + 11; + const totalFlex = 2 + 14 + 12 + 10 + 20 + 16 + 11 + 11; return [ usable * (2 / totalFlex), // S.NO usable * (14 / totalFlex), // POLICY NO + usable * (12 / totalFlex), // VEHICLE TYPE usable * (10 / totalFlex), // POLICY DATE usable * (20 / totalFlex), // PARTNER usable * (16 / totalFlex), // CUSTOMER @@ -252,11 +254,12 @@ class _PayOutDetailsViewState extends ConsumerState { children: [ _headerText('S.NO', w[0]), _headerText('POLICY NO', w[1]), - _headerText('POLICY DATE', w[2]), - _headerText('PARTNER', w[3]), - _headerText('CUSTOMER', w[4]), - _headerText('PREMIUM (₹)', w[5], align: TextAlign.right), - _headerText('PAYOUT (₹)', w[6], align: TextAlign.right), + _headerText('VEHICLE TYPE', w[2]), + _headerText('POLICY DATE', w[3]), + _headerText('PARTNER', w[4]), + _headerText('CUSTOMER', w[5]), + _headerText('PREMIUM (₹)', w[6], align: TextAlign.right), + _headerText('PAYOUT (₹)', w[7], align: TextAlign.right), ], ), ); @@ -274,22 +277,23 @@ class _PayOutDetailsViewState extends ConsumerState { children: [ _cell('${index + 1}', w[0]), _cell(p['policy_no']?.toString(), w[1]), - _cell(_formatDate(p['issued_date']?.toString()), w[2]), + _cell(p['vehicle_type']?.toString(), w[2]), + _cell(_formatDate(p['issued_date']?.toString()), w[3]), _cell( (p['agent_code'] != null && p['agent_name'] != null) ? '${p['agent_code']} - ${p['agent_name']}' : (p['agent_name'] ?? '-').toString(), - w[3], + w[4], ), - _cell(p['customer_name']?.toString(), w[4]), + _cell(p['customer_name']?.toString(), w[5]), _cell( _amountText(p['premium_amount']), - w[5], + w[6], align: TextAlign.right, ), _cell( _amountText(p['commission_amount']), - w[6], + w[7], align: TextAlign.right, color: const Color(0xFF009B77), fontWeight: FontWeight.w600, @@ -321,6 +325,7 @@ class _PayOutDetailsViewState extends ConsumerState { return { 'sno': 0, 'policy_no': p['policy_no'], + 'vehicle_type': p['vehicle_type'], 'policy_date': _formatDate(p['issued_date']?.toString()), 'partner': (p['agent_code'] != null && p['agent_name'] != null) ? '${p['agent_code']} - ${p['agent_name']}' @@ -431,6 +436,7 @@ class _PayOutDetailsViewState extends ConsumerState { displayHeaders: const [ 'S.NO', 'POLICY NO', + 'VEHICLE TYPE', 'POLICY DATE', 'PARTNER', 'CUSTOMER', @@ -440,6 +446,7 @@ class _PayOutDetailsViewState extends ConsumerState { keys: const [ 'sno', 'policy_no', + 'vehicle_type', 'policy_date', 'partner', 'customer', diff --git a/pubspec.lock b/pubspec.lock index abbeba9..ea3eafc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" charcode: dependency: transitive description: @@ -780,26 +780,26 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: @@ -1297,10 +1297,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.10" toastification: dependency: "direct main" description: @@ -1502,5 +1502,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.8.1 <4.0.0" + dart: ">=3.9.0-0 <4.0.0" flutter: ">=3.32.0"