BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../models/banner_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
|
||||
class DineInController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
@@ -28,7 +28,8 @@ class DineInController extends GetxController {
|
||||
RxList<VendorModel> popularRestaurantList = <VendorModel>[].obs;
|
||||
|
||||
RxList<BannerModel> bannerBottomModel = <BannerModel>[].obs;
|
||||
Rx<PageController> pageBottomController = PageController(viewportFraction: 0.877).obs;
|
||||
Rx<PageController> pageBottomController =
|
||||
PageController(viewportFraction: 0.877).obs;
|
||||
RxInt currentBottomPage = 0.obs;
|
||||
|
||||
RxList<FavouriteModel> favouriteList = <FavouriteModel>[].obs;
|
||||
@@ -37,7 +38,9 @@ class DineInController extends GetxController {
|
||||
isLoading.value = true;
|
||||
await getZone();
|
||||
|
||||
FireStoreUtils.getAllNearestRestaurant(isDining: true).listen((event) async {
|
||||
FireStoreUtils.getAllNearestRestaurant(isDining: true).listen((
|
||||
event,
|
||||
) async {
|
||||
newArrivalRestaurantList.clear();
|
||||
allNearestRestaurant.clear();
|
||||
popularRestaurantList.clear();
|
||||
@@ -47,12 +50,21 @@ class DineInController extends GetxController {
|
||||
popularRestaurantList.addAll(event);
|
||||
|
||||
popularRestaurantList.sort(
|
||||
(a, b) => Constant.calculateReview(reviewCount: b.reviewsCount.toString(), reviewSum: b.reviewsSum.toString())
|
||||
.compareTo(Constant.calculateReview(reviewCount: a.reviewsCount.toString(), reviewSum: a.reviewsSum.toString())),
|
||||
(a, b) => Constant.calculateReview(
|
||||
reviewCount: b.reviewsCount.toString(),
|
||||
reviewSum: b.reviewsSum.toString(),
|
||||
).compareTo(
|
||||
Constant.calculateReview(
|
||||
reviewCount: a.reviewsCount.toString(),
|
||||
reviewSum: a.reviewsSum.toString(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
newArrivalRestaurantList.sort(
|
||||
(a, b) => (b.createdAt ?? Timestamp.now()).toDate().compareTo((a.createdAt ?? Timestamp.now()).toDate()),
|
||||
(a, b) => (b.createdAt ?? Timestamp.now()).toDate().compareTo(
|
||||
(a.createdAt ?? Timestamp.now()).toDate(),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -61,23 +73,17 @@ class DineInController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getCategory() async {
|
||||
await FireStoreUtils.getHomeVendorCategory().then(
|
||||
(value) {
|
||||
vendorCategoryModel.value = value;
|
||||
},
|
||||
);
|
||||
await FireStoreUtils.getHomeVendorCategory().then((value) {
|
||||
vendorCategoryModel.value = value;
|
||||
});
|
||||
|
||||
await FireStoreUtils.getHomeBottomBanner().then(
|
||||
(value) {
|
||||
bannerBottomModel.value = value;
|
||||
},
|
||||
);
|
||||
await FireStoreUtils.getHomeBottomBanner().then((value) {
|
||||
bannerBottomModel.value = value;
|
||||
});
|
||||
if (Constant.userModel != null) {
|
||||
await FireStoreUtils.getFavouriteRestaurant().then(
|
||||
(value) {
|
||||
favouriteList.value = value;
|
||||
},
|
||||
);
|
||||
await FireStoreUtils.getFavouriteRestaurant().then((value) {
|
||||
favouriteList.value = value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +91,13 @@ class DineInController extends GetxController {
|
||||
await FireStoreUtils.getZone().then((value) {
|
||||
if (value != null) {
|
||||
for (int i = 0; i < value.length; i++) {
|
||||
if (Constant.isPointInPolygon(LatLng(Constant.selectedLocation.location!.latitude ?? 0.0, Constant.selectedLocation.location!.longitude ?? 0.0), value[i].area!)) {
|
||||
if (Constant.isPointInPolygon(
|
||||
LatLng(
|
||||
Constant.selectedLocation.location!.latitude ?? 0.0,
|
||||
Constant.selectedLocation.location!.longitude ?? 0.0,
|
||||
),
|
||||
value[i].area!,
|
||||
)) {
|
||||
Constant.selectedZone = value[i];
|
||||
Constant.isZoneAvailable = true;
|
||||
break;
|
||||
@@ -96,5 +108,4 @@ class DineInController extends GetxController {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user