final category discuss

This commit is contained in:
2025-05-09 15:02:13 +05:30
parent f863a81bb1
commit 873c73143b
12 changed files with 653 additions and 684 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
3.24.3 3.24.1

View File

@@ -1,63 +1,63 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
connectivity_plus=/Users/apple/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/ connectivity_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/
file_selector_linux=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/ file_selector_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/
file_selector_macos=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/ file_selector_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/
file_selector_windows=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/ file_selector_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/
firebase_core=/Users/apple/.pub-cache/hosted/pub.dev/firebase_core-3.13.0/ firebase_core=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core-3.13.0/
firebase_core_web=/Users/apple/.pub-cache/hosted/pub.dev/firebase_core_web-2.22.0/ firebase_core_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core_web-2.22.0/
firebase_messaging=/Users/apple/.pub-cache/hosted/pub.dev/firebase_messaging-15.2.5/ firebase_messaging=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging-15.2.5/
firebase_messaging_web=/Users/apple/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.10.5/ firebase_messaging_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.10.5/
flutter_inappwebview=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview-6.0.0/ flutter_inappwebview=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview-6.0.0/
flutter_inappwebview_android=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/ flutter_inappwebview_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/
flutter_inappwebview_ios=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ flutter_inappwebview_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/
flutter_inappwebview_macos=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/ flutter_inappwebview_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/
flutter_inappwebview_web=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/ flutter_inappwebview_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/
flutter_local_notifications=/Users/apple/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/ flutter_local_notifications=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/
flutter_local_notifications_linux=/Users/apple/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/ flutter_local_notifications_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/
flutter_plugin_android_lifecycle=/Users/apple/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/ flutter_plugin_android_lifecycle=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/
fluttertoast=/Users/apple/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/ fluttertoast=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/
geocoding=/Users/apple/.pub-cache/hosted/pub.dev/geocoding-3.0.0/ geocoding=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding-3.0.0/
geocoding_android=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/ geocoding_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/
geocoding_ios=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/ geocoding_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/
geolocator=/Users/apple/.pub-cache/hosted/pub.dev/geolocator-13.0.2/ geolocator=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator-13.0.2/
geolocator_android=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/ geolocator_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/
geolocator_apple=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/ geolocator_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/
geolocator_web=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/ geolocator_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/
geolocator_windows=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/ geolocator_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/
google_api_headers=/Users/apple/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/ google_api_headers=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/
google_maps_flutter=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter-2.10.0/ google_maps_flutter=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter-2.10.0/
google_maps_flutter_android=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/ google_maps_flutter_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/
google_maps_flutter_ios=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/ google_maps_flutter_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/
google_maps_flutter_web=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/ google_maps_flutter_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/
image_picker=/Users/apple/.pub-cache/hosted/pub.dev/image_picker-1.1.2/ image_picker=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker-1.1.2/
image_picker_android=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/ image_picker_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/
image_picker_for_web=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/ image_picker_for_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/
image_picker_ios=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/ image_picker_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/
image_picker_linux=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/ image_picker_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/
image_picker_macos=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/ image_picker_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/
image_picker_windows=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/ image_picker_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/
package_info_plus=/Users/apple/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/ package_info_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/
path_provider=/Users/apple/.pub-cache/hosted/pub.dev/path_provider-2.1.5/ path_provider=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider-2.1.5/
path_provider_android=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/ path_provider_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/
path_provider_foundation=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/ path_provider_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/
path_provider_linux=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ path_provider_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ path_provider_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
permission_handler=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/ permission_handler=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/
permission_handler_android=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.13/ permission_handler_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.13/
permission_handler_apple=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.7/ permission_handler_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.7/
permission_handler_html=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/ permission_handler_html=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/
permission_handler_windows=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/ permission_handler_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/
shared_preferences=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/ shared_preferences=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/
shared_preferences_android=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/ shared_preferences_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/
shared_preferences_foundation=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/ shared_preferences_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/
shared_preferences_linux=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/ shared_preferences_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
shared_preferences_web=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/ shared_preferences_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/
shared_preferences_windows=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/ shared_preferences_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
sqflite=/Users/apple/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/ sqflite=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/
url_launcher=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher-6.3.1/ url_launcher=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher-6.3.1/
url_launcher_android=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/ url_launcher_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/
url_launcher_ios=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/ url_launcher_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/
url_launcher_linux=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/ url_launcher_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/
url_launcher_macos=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/ url_launcher_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/
url_launcher_web=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/ url_launcher_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/
url_launcher_windows=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/ url_launcher_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/

File diff suppressed because one or more lines are too long

BIN
android/.DS_Store vendored

Binary file not shown.

View File

@@ -12,7 +12,7 @@ class APIURL {
static const String getBestDealProduct = "${BASE_URL}products/best-deals"; static const String getBestDealProduct = "${BASE_URL}products/best-deals";
static const String getAllcategory = "${BASE_URL}categories"; static const String getAllcategory = "${BASE_URL}categories";
static const String addToWish = "${BASE_URL}carts/wishlist/items"; static const String addToWish = "${BASE_URL}carts/wishlist/items";
static const String getSubcategory = "${BASE_URL}categories/by-level/2"; static const String getSubcategory = "${BASE_URL}categories/by-level/3";
static const String deleteToWish = "${BASE_URL}carts/wishlist/items"; static const String deleteToWish = "${BASE_URL}carts/wishlist/items";
static const String addToCart = "${BASE_URL}carts/items"; static const String addToCart = "${BASE_URL}carts/items";
static const String gettAllWishList = "${BASE_URL}carts/wishlist"; static const String gettAllWishList = "${BASE_URL}carts/wishlist";
@@ -53,7 +53,4 @@ class APIURL {
static const String productReview = "${BASE_URL}products/"; static const String productReview = "${BASE_URL}products/";
static const String upDateDeviceToken = "${BASE_URL}devices/register"; static const String upDateDeviceToken = "${BASE_URL}devices/register";
} }

View File

@@ -25,6 +25,12 @@ import 'package:http/http.dart' as http;
class ProductProvider extends ChangeNotifier { class ProductProvider extends ChangeNotifier {
final _homeRepo = getIt<ProductRepo>(); final _homeRepo = getIt<ProductRepo>();
String searchValue = ''; String searchValue = '';
bool isLoadingg = false; bool isLoadingg = false;
@@ -39,7 +45,8 @@ class ProductProvider extends ChangeNotifier {
bool iscroll = true; bool iscroll = true;
Future<void> gettAllProduct(BuildContext context, String id, bool status, Future<void> gettAllProduct(BuildContext context, String id, bool status,
String search, bool first) async { String search, bool first) async
{
print("kdjfhgkfkjdghkjkdfg"); print("kdjfhgkfkjdghkjkdfg");
// if (isLoadingg || !hasMore) return; // if (isLoadingg || !hasMore) return;
@@ -174,6 +181,7 @@ class ProductProvider extends ChangeNotifier {
}, },
); );
} }
int selectedImage = 0;
ProductDetailsData productDetails = ProductDetailsData(); ProductDetailsData productDetails = ProductDetailsData();
bool isProductLoading = true; bool isProductLoading = true;
@@ -281,7 +289,8 @@ class ProductProvider extends ChangeNotifier {
print("Error fetching categories: $error"); print("Error fetching categories: $error");
notifyListeners(); notifyListeners();
}, },
(categoryList) { (categoryList)
{
if (categoryList.isNotEmpty) { if (categoryList.isNotEmpty) {
final categories = [ProductCategoryModel(id: "all", name: "ALL")]; final categories = [ProductCategoryModel(id: "all", name: "ALL")];
categories.addAll(categoryList.cast<ProductCategoryModel>()); categories.addAll(categoryList.cast<ProductCategoryModel>());

View File

@@ -143,7 +143,7 @@ class ProductRepo {
.map((item) => ProductCategoryModel.fromJson(item)) .map((item) => ProductCategoryModel.fromJson(item))
.toList(); .toList();
if (response != null && response.data != null) { if (response != null && response.data != null) {
// Parse the response data into a list of ProductCategoryModel
final List<ProductCategoryModel> productModels = (response.data as List) final List<ProductCategoryModel> productModels = (response.data as List)
.map((item) => ProductCategoryModel.fromJson(item)) .map((item) => ProductCategoryModel.fromJson(item))
.toList(); .toList();

View File

@@ -28,37 +28,7 @@ class FruitVeggieDetail extends StatefulWidget {
class _FruitVeggieDetailState extends State<FruitVeggieDetail> { class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
final ScrollController _scrollController = ScrollController(); final ScrollController _scrollController = ScrollController();
// @override
// void initState() {
// final productProvider = Provider.of<ProductProvider>(context, listen: false)
// .gettAllProduct(context, "", true, '', true);
// WidgetsBinding.instance.addPostFrameCallback((_) {
// final productProvider =
// Provider.of<ProductProvider>(context, listen: false);
// productProvider.getAllcategory(context);
// productProvider.getCategoryByLevel();
// productProvider.setActiveIndex(0);
// });
// _scrollController.addListener(() {
// if (_scrollController.position.pixels ==
// _scrollController.position.maxScrollExtent) {
// final productProvider =
// Provider.of<ProductProvider>(context, listen: false);
// productProvider.gettAllProduct(context, "", false, '', false);
// }
// });
// super.initState();
// }
// @override
// void dispose() {
// _scrollController.dispose();
// super.dispose();
// }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@@ -66,15 +36,13 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
final productProvider = final productProvider =
Provider.of<ProductProvider>(context, listen: false); Provider.of<ProductProvider>(context, listen: false);
productProvider.page = 1;
// Initial product fetch
productProvider.gettAllProduct(context, "", true, '', true); productProvider.gettAllProduct(context, "", true, '', true);
// Fetch categories
productProvider.getAllcategory(context); productProvider.getAllcategory(context);
productProvider.getCategoryByLevel(); productProvider.getCategoryByLevel();
// Set initial tab/index
productProvider.setActiveIndex(0); productProvider.setActiveIndex(0);
}); });
@@ -84,7 +52,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
final productProvider = final productProvider =
Provider.of<ProductProvider>(context, listen: false); Provider.of<ProductProvider>(context, listen: false);
// Load more products on scroll
productProvider.gettAllProduct(context, "", false, '', false); productProvider.gettAllProduct(context, "", false, '', false);
} }
}); });
@@ -236,9 +203,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
"https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg", "https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg",
backGroundColor: Colors.transparent, backGroundColor: Colors.transparent,
radius: 10, radius: 10,
boxFit:BoxFit.fill boxFit: BoxFit.fill),
),
Positioned( Positioned(
right: 1, right: 1,
bottom: 0, bottom: 0,
@@ -263,7 +228,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
), ),
), ),
) )
], ],
), ),
), ),

View File

@@ -41,7 +41,6 @@ class ProductDetails extends StatefulWidget {
class _ProductDetailsState extends State<ProductDetails> { class _ProductDetailsState extends State<ProductDetails> {
int quantity = 1; int quantity = 1;
int selectedImage = 0;
String productId = ''; String productId = '';
@override @override
@@ -158,16 +157,14 @@ class _ProductDetailsState extends State<ProductDetails> {
}, },
options: CarouselOptions( options: CarouselOptions(
height: 300, height: 300,
initialPage: selectedImage, initialPage: provider.selectedImage,
enableInfiniteScroll: true, enableInfiniteScroll: true,
autoPlay: true, autoPlay: true,
autoPlayInterval: Duration(seconds: 3), autoPlayInterval: Duration(seconds: 3),
autoPlayAnimationDuration: Duration(milliseconds: 800), autoPlayAnimationDuration: Duration(milliseconds: 800),
enlargeCenterPage: true, enlargeCenterPage: true,
onPageChanged: (index, reason) { onPageChanged: (index, reason) {
setState(() { provider.selectedImage = index;
selectedImage = index;
});
}, },
), ),
), ),
@@ -183,7 +180,9 @@ class _ProductDetailsState extends State<ProductDetails> {
height: 8, height: 8,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: selectedImage == index ? Colors.red : Colors.grey, color: provider.selectedImage == index
? Colors.red
: Colors.grey,
), ),
); );
}).toList(), }).toList(),