diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index c74d280..3634139 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -992,7 +992,7 @@ "languageVersion": "3.4" } ], - "generated": "2025-02-13T11:54:46.039722Z", + "generated": "2025-02-14T13:22:19.642868Z", "generator": "pub", "generatorVersion": "3.4.4", "flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter", diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 744aff7..9a329e9 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":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","native_build":true,"dependencies":[]},{"name":"geocoding_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/","native_build":true,"dependencies":[]},{"name":"geolocator_apple","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/","native_build":true,"dependencies":[]},{"name":"image_picker_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/","native_build":true,"dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","native_build":true,"dependencies":[]},{"name":"geocoding_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/","native_build":true,"dependencies":[]},{"name":"google_api_headers","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/","native_build":true,"dependencies":["package_info_plus"]},{"name":"google_maps_flutter_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"file_selector_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/","native_build":true,"dependencies":[]},{"name":"geolocator_apple","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/","native_build":true,"dependencies":[]},{"name":"image_picker_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/","native_build":false,"dependencies":["file_selector_macos"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":false,"dependencies":[]},{"name":"file_selector_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/","native_build":true,"dependencies":[]},{"name":"image_picker_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/","native_build":false,"dependencies":["file_selector_linux"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"file_selector_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/","native_build":true,"dependencies":[]},{"name":"geolocator_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/","native_build":true,"dependencies":[]},{"name":"image_picker_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/","native_build":false,"dependencies":["file_selector_windows"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","dependencies":[]},{"name":"flutter_inappwebview_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/","dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","dependencies":[]},{"name":"geolocator_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/","dependencies":[]},{"name":"google_maps_flutter_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/","dependencies":[]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"file_selector_linux","dependencies":[]},{"name":"file_selector_macos","dependencies":[]},{"name":"file_selector_windows","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["flutter_inappwebview_android","flutter_inappwebview_ios","flutter_inappwebview_macos","flutter_inappwebview_web"]},{"name":"flutter_inappwebview_android","dependencies":[]},{"name":"flutter_inappwebview_ios","dependencies":[]},{"name":"flutter_inappwebview_macos","dependencies":[]},{"name":"flutter_inappwebview_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"geocoding","dependencies":["geocoding_android","geocoding_ios"]},{"name":"geocoding_android","dependencies":[]},{"name":"geocoding_ios","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_api_headers","dependencies":["package_info_plus"]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]},{"name":"image_picker","dependencies":["image_picker_android","image_picker_for_web","image_picker_ios","image_picker_linux","image_picker_macos","image_picker_windows"]},{"name":"image_picker_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"image_picker_ios","dependencies":[]},{"name":"image_picker_linux","dependencies":["file_selector_linux"]},{"name":"image_picker_macos","dependencies":["file_selector_macos"]},{"name":"image_picker_windows","dependencies":["file_selector_windows"]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","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":"2025-02-13 17:24:46.275057","version":"3.22.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","native_build":true,"dependencies":[]},{"name":"geocoding_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/","native_build":true,"dependencies":[]},{"name":"geolocator_apple","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/","native_build":true,"dependencies":[]},{"name":"image_picker_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/","native_build":true,"dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","native_build":true,"dependencies":[]},{"name":"geocoding_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/","native_build":true,"dependencies":[]},{"name":"google_api_headers","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/","native_build":true,"dependencies":["package_info_plus"]},{"name":"google_maps_flutter_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"file_selector_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/","native_build":true,"dependencies":[]},{"name":"flutter_inappwebview_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/","native_build":true,"dependencies":[]},{"name":"geolocator_apple","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/","native_build":true,"dependencies":[]},{"name":"image_picker_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/","native_build":false,"dependencies":["file_selector_macos"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":false,"dependencies":[]},{"name":"file_selector_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/","native_build":true,"dependencies":[]},{"name":"image_picker_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/","native_build":false,"dependencies":["file_selector_linux"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]},{"name":"file_selector_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/","native_build":true,"dependencies":[]},{"name":"geolocator_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/","native_build":true,"dependencies":[]},{"name":"image_picker_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/","native_build":false,"dependencies":["file_selector_windows"]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","dependencies":[]},{"name":"flutter_inappwebview_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/","dependencies":[]},{"name":"fluttertoast","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/","dependencies":[]},{"name":"geolocator_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/","dependencies":[]},{"name":"google_maps_flutter_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/","dependencies":[]},{"name":"package_info_plus","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"file_selector_linux","dependencies":[]},{"name":"file_selector_macos","dependencies":[]},{"name":"file_selector_windows","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["flutter_inappwebview_android","flutter_inappwebview_ios","flutter_inappwebview_macos","flutter_inappwebview_web"]},{"name":"flutter_inappwebview_android","dependencies":[]},{"name":"flutter_inappwebview_ios","dependencies":[]},{"name":"flutter_inappwebview_macos","dependencies":[]},{"name":"flutter_inappwebview_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"geocoding","dependencies":["geocoding_android","geocoding_ios"]},{"name":"geocoding_android","dependencies":[]},{"name":"geocoding_ios","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_api_headers","dependencies":["package_info_plus"]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]},{"name":"image_picker","dependencies":["image_picker_android","image_picker_for_web","image_picker_ios","image_picker_linux","image_picker_macos","image_picker_windows"]},{"name":"image_picker_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"image_picker_ios","dependencies":[]},{"name":"image_picker_linux","dependencies":["file_selector_linux"]},{"name":"image_picker_macos","dependencies":["file_selector_macos"]},{"name":"image_picker_windows","dependencies":["file_selector_windows"]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","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":"2025-02-14 18:52:19.891429","version":"3.22.3"} \ No newline at end of file diff --git a/lib/src/core/constant/api.dart b/lib/src/core/constant/api.dart index bdf1e53..946509d 100644 --- a/lib/src/core/constant/api.dart +++ b/lib/src/core/constant/api.dart @@ -30,9 +30,6 @@ class APIURL { static const String myOrder = "${BASE_URL}orders/my-orders"; static const String offerCoupon = "${BASE_URL}coupons"; static const String applyCoupon = "${BASE_URL}coupons/validate"; - - - static const String forgetPassword = "${BASE_URL}auth/forgot-password/vendor"; static const String verifyForgetPassword = "${BASE_URL}auth/forgot-password-verify-otp/vendor"; diff --git a/lib/src/core/network_services/dio_client.dart b/lib/src/core/network_services/dio_client.dart index ec1ae47..b682afd 100644 --- a/lib/src/core/network_services/dio_client.dart +++ b/lib/src/core/network_services/dio_client.dart @@ -29,8 +29,10 @@ class DioClient { CancelToken? cancelToken, ProgressCallback? onReceiveProgress, bool hideSoftKeyboard = true, - required data}) async { - if (hideSoftKeyboard) { + required data}) async + { + if (hideSoftKeyboard) + { // hideKeyBoard(); } @@ -41,7 +43,8 @@ class DioClient { url, queryParameters: queryParameters, options: options ?? - Options(headers: { + Options(headers: + { "authorization": "Bearer ${await SharedPrefUtils.getToken()}" }), cancelToken: cancelToken, @@ -61,7 +64,7 @@ class DioClient { CancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, - bool hideSoftKeyboard = true}) async { + bool hideSoftKeyboard = true}) async { if (hideSoftKeyboard) { hideKeyBoard(); } diff --git a/lib/src/logic/provider/home_provider.dart b/lib/src/logic/provider/home_provider.dart index 305f652..a8087ae 100644 --- a/lib/src/logic/provider/home_provider.dart +++ b/lib/src/logic/provider/home_provider.dart @@ -16,15 +16,41 @@ import 'package:grocery_app/utils/extensions/extensions.dart'; class ProductProvider extends ChangeNotifier { final _homeRepo = getIt(); - bool isLoadingg = true; + String searchValue = ''; + + bool isLoadingg = false; List products = []; - Future gettAllProduct(BuildContext context, String id) async { - var data = {}; + int page = 1; + final int limit = 8; - print("skdjhfgkf ${id}"); + bool hasMore = true; + bool iscroll = true; + Future gettAllProduct( + BuildContext context, String id, bool status, String search) async { + if (isLoadingg || !hasMore) return; + print("kjldfgjklfjkdgjkhlfg"); + if (id.isNotEmpty) { + products.clear(); + + hasMore = true; + } + + if (status) { + isLoadingg = true; + } + ; + + notifyListeners(); + var data = { + "page": page, + "limit": limit, + "minPrice": "", + "minPrice": "", + "search": search + }; var result = await _homeRepo.getAllProduct(data, context, id); return result.fold( (error) { @@ -32,13 +58,66 @@ class ProductProvider extends ChangeNotifier { notifyListeners(); }, (response) { - products = response.data!; + // products = response.data!; + // page++; + // print( + // "jksdhfgkjdfkhjghkjdfhgkjdf ${response.data} ${response.data!.isNotEmpty}"); + // if (response.data != null && response.data!.isNotEmpty) { + // products.addAll(response.data!); + // // products = response.data!; + // page++; + // } else { + // hasMore = false; + // } + + if (response.data != null && response.data!.isNotEmpty) { + if (id.isNotEmpty) { + products = response.data!; + } else { + products.addAll(response.data!); + } + page++; + + if (response.data!.length < limit) { + hasMore = false; + } + } else { + hasMore = false; + } + isLoadingg = false; notifyListeners(); }, ); } + bool isHomeLoadingg = false; + + List homeproducts = []; + + + Future getHomeProduct(BuildContext context,String id, String search) async + { + isHomeLoadingg = true; + + notifyListeners(); + var data = {"minPrice": "", "minPrice": "", "search": search}; + var result = await _homeRepo.getAllProduct(data, context,id); + return result.fold( + (error) { + isLoadingg = false; + notifyListeners(); + }, + (response) + { + homeproducts = response.data!; + + isHomeLoadingg = false; + notifyListeners(); + }, + ); + } + ProductDetailsData productDetails = ProductDetailsData(); bool isProductLoading = true; @@ -68,11 +147,11 @@ class ProductProvider extends ChangeNotifier { bool isBestdealingloading = true; - Future getBestDealProduct(BuildContext context) async { - isBestdealingloading = true; - notifyListeners(); - var data = {}; - + Future getBestDealProduct(BuildContext context,String search) async + { + isBestdealingloading = true; + notifyListeners(); + var data = {"minPrice": "", "minPrice": "", "search": search}; var result = await _homeRepo.getBestDealProduct(data, context); return result.fold( (error) { @@ -87,6 +166,9 @@ class ProductProvider extends ChangeNotifier { ); } + + + List categoryList = []; bool iscategroyloading = true; @@ -254,7 +336,7 @@ class ProductProvider extends ChangeNotifier { } } - // void toggleWishlist1(String productId) + // void toggleWishlist1(String productId) // { // for (var product in products) { // if (product.id == productId) { @@ -396,8 +478,7 @@ class ProductProvider extends ChangeNotifier { notifyListeners(); // Update UI after adding to cart }, ); - } catch (e) - { + } catch (e) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text("Product already added"), @@ -584,5 +665,14 @@ class ProductProvider extends ChangeNotifier { ); } - ///////////////////////////////////////////////////// all carts//////////////////////// + ///////////////////////////////////////////////////// all filter //////////////////////// + + int _selectedIndex = 0; + + int get selectedIndex => _selectedIndex; + + void setSelectedIndex(BuildContext context, int index) { + _selectedIndex = index; + notifyListeners(); + } } diff --git a/lib/src/logic/services/home_locator.dart b/lib/src/logic/services/home_locator.dart index 16a3dfb..75819ba 100644 --- a/lib/src/logic/services/home_locator.dart +++ b/lib/src/logic/services/home_locator.dart @@ -23,7 +23,8 @@ class ProductService extends ApiService { var response; if (id.isEmpty) { - response = await api.get(APIURL.getAllProduct, data: jsonEncode(data)); + response = await api.get(APIURL.getAllProduct, + queryParameters: data, data: data); } else { response = await api.get(APIURL.getAllProduct + id, data: jsonEncode(data)); @@ -42,8 +43,8 @@ class ProductService extends ApiService { // Future getBestDealProduct(data) async { - var response = - await api.get(APIURL.getBestDealProduct, data: jsonEncode(data)); + var response = await api.get(APIURL.getBestDealProduct, + queryParameters: data, data: jsonEncode(data)); return response; } @@ -80,22 +81,18 @@ class ProductService extends ApiService { return response; } - Future offerCoupon(data) async { + + Future offerCoupon(data) async { var response = await api.get(APIURL.offerCoupon, data: jsonEncode(data)); return response; } - Future applyCoupon(data) async { + Future applyCoupon(data) async { var response = await api.post(APIURL.applyCoupon, data: jsonEncode(data)); return response; } - - - - - Future checkPin(data, pin) async { var response = await api.get(APIURL.checkPin + pin, data: jsonEncode(data)); diff --git a/lib/src/ui/bestdeal/bestdeal_screen.dart b/lib/src/ui/bestdeal/bestdeal_screen.dart index 50f8c3a..d63a4fe 100644 --- a/lib/src/ui/bestdeal/bestdeal_screen.dart +++ b/lib/src/ui/bestdeal/bestdeal_screen.dart @@ -14,6 +14,7 @@ import 'package:grocery_app/utils/constants/shared_pref_utils.dart'; import 'package:grocery_app/utils/extensions/uicontext.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:provider/provider.dart'; +import 'package:shimmer/shimmer.dart'; class BestDealScreen extends StatefulWidget { const BestDealScreen({super.key}); @@ -23,10 +24,12 @@ class BestDealScreen extends StatefulWidget { } class _BestDealScreenState extends State { + bool _isSearching = false; + TextEditingController _searchController = TextEditingController(); @override void initState() { Provider.of(context, listen: false) - .getBestDealProduct(context); + .getBestDealProduct(context, ''); super.initState(); } @@ -56,31 +59,69 @@ class _BestDealScreenState extends State { height: 20, width: 20, child: InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: SvgPicture.asset( - APPASSETS.back, - height: 20, - width: 20, - )), - ), - ), - title: const Text( - "Best Deal", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w700, - ), - ), - actions: [ - InkWell( - onTap: () {}, - child: Icon( - MdiIcons.magnify, - size: 35, + onTap: () { + Navigator.of(context).pop(); + }, + child: SvgPicture.asset( + APPASSETS.back, + height: 20, + width: 20, + ), ), - ) + ), + ), + title: _isSearching + ? TextField( + controller: _searchController, + autofocus: true, // Focus on search field when opened + decoration: InputDecoration( + hintText: "Search...", + border: InputBorder.none, + ), + style: TextStyle(fontSize: 18), + onChanged: (query) { + // You can call a search function here + }, + ) + : const Text( + "Best Deal", + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w700, + ), + ), + actions: [ + if (_isSearching) // Show search icon only when searching + InkWell( + onTap: () { + Provider.of(context, listen: false) + .getBestDealProduct(context, _searchController.text); + }, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Icon( + MdiIcons.magnify, + size: 35, + ), + ), + ), + InkWell( + onTap: () { + setState(() { + _isSearching = !_isSearching; + if (!_isSearching) { + _searchController.clear(); // Clear search when closed + } + }); + }, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Icon( + _isSearching ? Icons.close : MdiIcons.magnify, + size: 35, + ), + ), + ), ], ), floatingActionButton: floatingAction(), @@ -180,11 +221,68 @@ class _BestDealScreenState extends State { Widget itemBestdeal() { return Consumer(builder: (context, provider, child) { if (provider.isBestdealingloading) { - return Center(child: CircularProgressIndicator()); + return Padding( + padding: const EdgeInsets.all(15), + child: GridView.builder( + itemCount: 6, // Number of shimmer items + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: MediaQuery.of(context).size.width / + (MediaQuery.of(context).size.height / 1.5), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + ), + itemBuilder: (context, index) { + return Shimmer.fromColors( + baseColor: Colors.grey[300]!, + highlightColor: Colors.grey[100]!, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + ), + child: Padding( + padding: const EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.15, + width: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(15), + ), + ), + SizedBox(height: 8), + Container( + height: 10, + width: MediaQuery.of(context).size.width * 0.35, + color: Colors.grey[300], + ), + SizedBox(height: 5), + Container( + height: 10, + width: MediaQuery.of(context).size.width * 0.25, + color: Colors.grey[300], + ), + SizedBox(height: 10), + Container( + height: 15, + width: MediaQuery.of(context).size.width * 0.3, + color: Colors.grey[300], + ), + ], + ), + ), + ), + ); + }, + ), + ); } else if (provider.bestdeal.isEmpty) { return Center(child: Text('No products available')); } else { - print("kjhfgjkdfkjghdhjfgk ${provider.bestdeal.first.additionalInfo}"); return Padding( padding: const EdgeInsets.all(15), child: GridView.builder( @@ -380,6 +478,75 @@ class _BestDealScreenState extends State { }, ), ); + + // Padding( + // padding: const EdgeInsets.all(15), + // child: GridView.builder( + // itemCount: provider.bestdeal.length, + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 2, + // childAspectRatio: MediaQuery.of(context).size.width / + // (MediaQuery.of(context).size.height / 1.5), + // crossAxisSpacing: 10, + // mainAxisSpacing: 10, + // ), + // itemBuilder: (context, index) { + // var bestdealproduct = provider.bestdeal[index]; + // return InkWell( + // onTap: () { + // context.push(MyRoutes.PRODUCTDETAILS, + // extra: bestdealproduct.id); + // }, + // child: Container( + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(15), + // ), + // child: Padding( + // padding: const EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // height: MediaQuery.of(context).size.height * 0.15, + // width: MediaQuery.of(context).size.width * 0.4, + // decoration: BoxDecoration( + // color: APPCOLOR.bgGrey, + // borderRadius: BorderRadius.circular(15), + // ), + // child: AppNetworkImage( + // height: MediaQuery.of(context).size.height * 0.13, + // width: MediaQuery.of(context).size.width * 0.35, + // imageUrl: + // bestdealproduct.productImages?.first.url ?? "", + // backGroundColor: Colors.transparent, + // ), + // ), + // SizedBox(height: 8), + // Text(bestdealproduct.name ?? ""), + // Text(bestdealproduct.unit ?? ""), + // Text(bestdealproduct.quantity > 0 + // ? "In Stock" + // : "Out of Stock"), + // Row( + // children: [ + // Text("₹${bestdealproduct.discountPrice ?? ""}"), + // Text( + // "₹${bestdealproduct.basePrice ?? ""}", + // style: TextStyle( + // decoration: TextDecoration.lineThrough, + // ), + // ), + // ], + // ), + // ], + // ), + // ), + // ), + // ); + // }, + // ), + // ); } }); } diff --git a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart index 8fa4b2c..b364f0b 100644 --- a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart +++ b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart @@ -21,14 +21,36 @@ class FruitVeggieDetail extends StatefulWidget { } class _FruitVeggieDetailState extends State { + final ScrollController _scrollController = ScrollController(); @override void initState() { - Provider.of(context, listen: false) - .getAllcategory(context); + // Ensuring the context is available before accessing the provider + WidgetsBinding.instance.addPostFrameCallback((_) { + final productProvider = + Provider.of(context, listen: false); + productProvider.getAllcategory(context); + + productProvider.gettAllProduct(context, "", true, ''); + }); + + _scrollController.addListener(() { + if (_scrollController.position.pixels == + _scrollController.position.maxScrollExtent) { + final productProvider = + Provider.of(context, listen: false); + productProvider.gettAllProduct(context, "", false, ''); + } + }); super.initState(); } + @override + void dispose() { + _scrollController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -41,8 +63,6 @@ class _FruitVeggieDetailState extends State { width: 20, child: InkWell( onTap: () { - Provider.of(context, listen: false) - .gettAllProduct(context, ""); Navigator.of(context).pop(); }, child: SvgPicture.asset( @@ -60,16 +80,16 @@ class _FruitVeggieDetailState extends State { ), ), actions: [ - Padding( - padding: const EdgeInsets.only(right: 10), - child: InkWell( - onTap: () {}, - child: Icon( - MdiIcons.magnify, - size: 35, - ), - ), - ) + // Padding( + // padding: const EdgeInsets.only(right: 10), + // child: InkWell( + // onTap: () {}, + // child: Icon( + // MdiIcons.magnify, + // size: 35, + // ), + // ), + // ) ], ), body: Row( @@ -114,7 +134,11 @@ class _FruitVeggieDetailState extends State { final itemHeight = itemWidth * 1.5; return GridView.builder( - itemCount: provider.products.length, + controller: _scrollController, + // itemCount: provider.products.length, + + itemCount: + provider.products.length + (provider.hasMore ? 1 : 0), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, childAspectRatio: itemWidth / itemHeight, @@ -122,8 +146,30 @@ class _FruitVeggieDetailState extends State { mainAxisSpacing: 10, ), itemBuilder: (context, index) { + if (index == provider.products.length) { + return SizedBox.shrink(); + // return Center( + // child: Padding( + // padding: const EdgeInsets.only(left: 120), + // child: Center( + // child: Container( + // width: 30, + // height: 30, + // decoration: BoxDecoration( + // color: Colors.transparent, + // borderRadius: BorderRadius.circular(20), + // border: Border.all( + // color: APPCOLOR.bgGrey, + // width: 1, + // )), + // child: const Center( + // child: CupertinoActivityIndicator(), + // ), + // )), + // ) + // ); // Show loader when fetching more data + } var product = provider.products[index]; - return InkWell( onTap: () { context.push(MyRoutes.PRODUCTDETAILS, @@ -425,9 +471,20 @@ class _FruitVeggieDetailState extends State { var category = provider.categoryList[index]; return InkWell( onTap: () { - provider.isLoadingg = true; - provider.gettAllProduct(context, "/category/${category.id}"); + provider.iscroll = true; + provider.products.clear(); // Clear existing products + provider.isLoadingg = false; + provider.hasMore = true; + provider.page = 1; // Reset page for new category + provider + .notifyListeners(); // Notify listeners before fetching data + provider.gettAllProduct( + context, "/category/${category.id}", true, ''); activeIndexProvider.setActiveIndex(index); + // provider.isLoadingg = false; + // provider.hasMore = false; + // provider.gettAllProduct(context, "/category/${category.id}"); + // activeIndexProvider.setActiveIndex(index); }, child: SizedBox( height: 150, diff --git a/lib/src/ui/home/home_screen.dart b/lib/src/ui/home/home_screen.dart index 2092870..7475643 100644 --- a/lib/src/ui/home/home_screen.dart +++ b/lib/src/ui/home/home_screen.dart @@ -30,21 +30,22 @@ class _HomeScreenState extends State { void initState() { super.initState(); - Provider.of(context, listen: false).getBanners(context); - Provider.of(context, listen: false) - .gettAllProduct(context, ""); - Provider.of(context, listen: false) - .getBestDealProduct(context); - Provider.of(context, listen: false) - .getAllcategory(context); - getUserDetails(); + WidgetsBinding.instance.addPostFrameCallback((_) { + final productProvider = + Provider.of(context, listen: false); + + productProvider.getBanners(context); + productProvider.getHomeProduct(context, "", ''); + productProvider.getBestDealProduct(context,''); + productProvider.getAllcategory(context); + + getUserDetails(); + }); } getUserDetails() async { APPSTRING.userName = (await SharedPrefUtils.getFirstName())!; - print("kdjfkgjhdkfgj ${await SharedPrefUtils.getFirstName()}"); - APPSTRING.emailName = (await SharedPrefUtils.getUserEmail())!; APPSTRING.userProfile = (await SharedPrefUtils.getUserProfile())!; APPSTRING.userLastName = (await SharedPrefUtils.getLastName())!; @@ -67,42 +68,58 @@ class _HomeScreenState extends State { ), Row( children: [ - Expanded( - child: Container( - height: 50, - decoration: BoxDecoration( - color: APPCOLOR.bgGrey, - borderRadius: BorderRadius.circular(5), - ), - child: TextFormField( - decoration: InputDecoration( - border: InputBorder.none, - fillColor: Colors.transparent, - prefixIcon: Icon(MdiIcons.magnify), - hintText: 'Search', - hintStyle: - context.customRegular(APPCOLOR.grey666666, 18), - isCollapsed: true, - contentPadding: const EdgeInsets.symmetric( - vertical: 10, horizontal: 10), + Consumer( + builder: (context, provider, child) { + return Expanded( + child: Container( + height: 50, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: BorderRadius.circular(5), + ), + child: TextFormField( + onChanged: (value) { + provider.searchValue = value; + }, + decoration: InputDecoration( + border: InputBorder.none, + fillColor: Colors.transparent, + suffixIcon: InkWell( + onTap: () { + provider.getHomeProduct( + context, "", provider.searchValue); + }, + child: Icon(MdiIcons.magnify)), + hintText: 'Search', + hintStyle: context.customRegular( + APPCOLOR.grey666666, 18), + isCollapsed: true, + contentPadding: const EdgeInsets.symmetric( + vertical: 10, horizontal: 10), + ), ), ), - ), - ), + ); + }), const SizedBox( width: 10, ), - Container( - height: 50, - width: 50, - decoration: BoxDecoration( - color: APPCOLOR.lightGreen, - borderRadius: BorderRadius.circular(5), - ), - child: Center( - child: Icon( - MdiIcons.tuneVariant, - color: Colors.white, + InkWell( + onTap: () { + showSortBottomSheet(context); + }, + child: Container( + height: 50, + width: 50, + decoration: BoxDecoration( + color: APPCOLOR.lightGreen, + borderRadius: BorderRadius.circular(5), + ), + child: Center( + child: Icon( + MdiIcons.tuneVariant, + color: Colors.white, + ), ), ), ), @@ -594,11 +611,6 @@ class _HomeScreenState extends State { }); } - // Future _launchUrl(url) async { - // if (!await launchUrl(url)) { - // throw Exception('Could not launch $url'); - // } - // } Future _launchUrl(url) async { print("jdhfjkgh ${url}"); final Uri uri = Uri.parse(url); @@ -607,71 +619,9 @@ class _HomeScreenState extends State { } } - // Widget categoriesProduct() { - // return Consumer(builder: (context, provider, child) { - // if (provider.isLoadingg) { - // return Center(child: CircularProgressIndicator()); - // } else if (provider.products.isEmpty) { - // return Center(child: Text('No products available')); - // } else { - // return GridView.builder( - // shrinkWrap: true, - // itemCount: provider.products.length, - // physics: const NeverScrollableScrollPhysics(), - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - // crossAxisCount: 4, - // crossAxisSpacing: 5, - // mainAxisSpacing: 5, - // childAspectRatio: MediaQuery.of(context).size.width / - // (MediaQuery.of(context).size.height / 1.2), - // ), - // itemBuilder: (context, index) { - // var product = provider.products[index]; - // return InkWell( - // onTap: () { - // context.push(MyRoutes.PRODUCTDETAILS, extra: product.id); - // }, - // child: SizedBox( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Container( - // decoration: BoxDecoration( - // color: APPCOLOR.bgGrey, - // borderRadius: BorderRadius.circular(5), - // ), - // child: AppNetworkImage( - // height: 80, - // width: 80, - // imageUrl: product.productImages!.first.url, - // //'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', - // backGroundColor: APPCOLOR.bgGrey, - // radius: 10, - // ), - // ), - // const SizedBox( - // height: 10, - // ), - // Text( - // product.name ?? "", - // textAlign: TextAlign.center, - // maxLines: 2, - // overflow: TextOverflow.ellipsis, - // style: context.customMedium(APPCOLOR.balck1A1A1A, 14), - // ) - // ], - // ), - // ), - // ); - // }, - // ); - // } - // }); - // } - Widget categoriesProduct() { return Consumer(builder: (context, provider, child) { - return provider.isLoadingg + return provider.isHomeLoadingg ? GridView.builder( shrinkWrap: true, itemCount: 8, @@ -685,7 +635,7 @@ class _HomeScreenState extends State { ), itemBuilder: (context, index) { return Skeletonizer( - enabled: provider.isLoadingg, + enabled: provider.isHomeLoadingg, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -708,11 +658,11 @@ class _HomeScreenState extends State { ); }, ) - : provider.products.isEmpty + : provider.homeproducts.isEmpty ? Center(child: Text('No products available')) : GridView.builder( shrinkWrap: true, - itemCount: provider.products.length, + itemCount: provider.homeproducts.length, physics: const NeverScrollableScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 4, @@ -722,7 +672,7 @@ class _HomeScreenState extends State { (MediaQuery.of(context).size.height / 1.2), ), itemBuilder: (context, index) { - var product = provider.products[index]; + var product = provider.homeproducts[index]; return InkWell( onTap: () { context.push(MyRoutes.PRODUCTDETAILS, @@ -762,4 +712,56 @@ class _HomeScreenState extends State { ); }); } + + void showSortBottomSheet(BuildContext context) { + showModalBottomSheet( + context: context, + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(50)), + ), + builder: (context) { + return Consumer( + builder: (context, sortProvider, child) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "Sort By", + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + Divider( + thickness: 0.2, + ), + _buildSortOption(context, sortProvider, 0, "Relevance"), + _buildSortOption(context, sortProvider, 1, "Popularity"), + _buildSortOption( + context, sortProvider, 2, "Price: Low to High"), + ], + ), + ); + }, + ); + }, + ); + } + + Widget _buildSortOption( + BuildContext context, ProductProvider provider, int index, String title) { + bool isSelected = provider.selectedIndex == index; + + return ListTile( + title: Text(title), + trailing: isSelected + ? Icon(Icons.check_circle, color: Colors.green) + : Icon(Icons.radio_button_unchecked, color: Colors.grey), + onTap: () { + provider.getHomeProduct(context, '', ''); + provider.setSelectedIndex(context, index); + Navigator.pop(context); // Close the bottom sheet + }, + ); + } }