BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -8,8 +8,7 @@ import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/service/cart_provider.dart';
|
||||
import 'package:customer/service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../constant/constant.dart';
|
||||
|
||||
class HomeECommerceController extends GetxController {
|
||||
@@ -27,8 +26,10 @@ class HomeECommerceController extends GetxController {
|
||||
RxBool isListView = true.obs;
|
||||
RxBool isPopular = true.obs;
|
||||
|
||||
Rx<PageController> pageController = PageController(viewportFraction: 0.877).obs;
|
||||
Rx<PageController> pageBottomController = PageController(viewportFraction: 0.877).obs;
|
||||
Rx<PageController> pageController =
|
||||
PageController(viewportFraction: 0.877).obs;
|
||||
Rx<PageController> pageBottomController =
|
||||
PageController(viewportFraction: 0.877).obs;
|
||||
RxInt currentPage = 0.obs;
|
||||
RxInt currentBottomPage = 0.obs;
|
||||
|
||||
@@ -41,7 +42,8 @@ class HomeECommerceController extends GetxController {
|
||||
}
|
||||
|
||||
RxList<VendorCategoryModel> vendorCategoryModel = <VendorCategoryModel>[].obs;
|
||||
RxList<VendorCategoryModel> categoryWiseProductList = <VendorCategoryModel>[].obs;
|
||||
RxList<VendorCategoryModel> categoryWiseProductList =
|
||||
<VendorCategoryModel>[].obs;
|
||||
|
||||
RxList<VendorModel> allNearestRestaurant = <VendorModel>[].obs;
|
||||
RxList<VendorModel> newArrivalRestaurantList = <VendorModel>[].obs;
|
||||
@@ -64,10 +66,22 @@ class HomeECommerceController extends GetxController {
|
||||
allNearestRestaurant.addAll(event);
|
||||
newArrivalRestaurantList.addAll(event);
|
||||
Constant.restaurantList = allNearestRestaurant;
|
||||
List<String> usedCategoryIds = allNearestRestaurant.expand((vendor) => vendor.categoryID ?? []).whereType<String>().toSet().toList();
|
||||
vendorCategoryModel.value = vendorCategoryModel.where((category) => usedCategoryIds.contains(category.id)).toList();
|
||||
List<String> usedCategoryIds =
|
||||
allNearestRestaurant
|
||||
.expand((vendor) => vendor.categoryID ?? [])
|
||||
.whereType<String>()
|
||||
.toSet()
|
||||
.toList();
|
||||
vendorCategoryModel.value =
|
||||
vendorCategoryModel
|
||||
.where((category) => usedCategoryIds.contains(category.id))
|
||||
.toList();
|
||||
|
||||
newArrivalRestaurantList.sort((a, b) => (b.createdAt ?? Timestamp.now()).toDate().compareTo((a.createdAt ?? Timestamp.now()).toDate()));
|
||||
newArrivalRestaurantList.sort(
|
||||
(a, b) => (b.createdAt ?? Timestamp.now()).toDate().compareTo(
|
||||
(a.createdAt ?? Timestamp.now()).toDate(),
|
||||
),
|
||||
);
|
||||
|
||||
if (Constant.isEnableAdsFeature == true) {
|
||||
await FireStoreUtils.getAllAdvertisement().then((value) {
|
||||
|
||||
Reference in New Issue
Block a user