BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/models/user_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:intl/intl.dart';
|
||||
import '../models/favorite_ondemand_service_model.dart';
|
||||
import '../models/provider_serivce_model.dart';
|
||||
@@ -14,7 +14,8 @@ class OnDemandDetailsController extends GetxController {
|
||||
final RxString subCategoryTitle = ''.obs;
|
||||
final RxString categoryTitle = ''.obs;
|
||||
final RxList<RatingModel> ratingService = <RatingModel>[].obs;
|
||||
final RxList<FavouriteOndemandServiceModel> lstFav = <FavouriteOndemandServiceModel>[].obs;
|
||||
final RxList<FavouriteOndemandServiceModel> lstFav =
|
||||
<FavouriteOndemandServiceModel>[].obs;
|
||||
final RxBool isLoading = true.obs;
|
||||
final RxBool isOpen = false.obs;
|
||||
final RxString tabString = "About".obs;
|
||||
@@ -27,35 +28,44 @@ class OnDemandDetailsController extends GetxController {
|
||||
getData();
|
||||
}
|
||||
|
||||
|
||||
Future<void> getData() async {
|
||||
await getReviewList();
|
||||
await getAuthor(); //fetch and set provider author here
|
||||
if (Constant.userModel != null) {
|
||||
lstFav.value = await FireStoreUtils.getFavouritesServiceList(FireStoreUtils.getCurrentUid());
|
||||
lstFav.value = await FireStoreUtils.getFavouritesServiceList(
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
}
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
Future<void> getReviewList() async {
|
||||
await FireStoreUtils.getCategoryById(provider.categoryId.toString()).then((value) {
|
||||
await FireStoreUtils.getCategoryById(provider.categoryId.toString()).then((
|
||||
value,
|
||||
) {
|
||||
if (value != null) {
|
||||
categoryTitle.value = value.title.toString();
|
||||
}
|
||||
});
|
||||
|
||||
await FireStoreUtils.getSubCategoryById(provider.subCategoryId.toString()).then((value) {
|
||||
await FireStoreUtils.getSubCategoryById(
|
||||
provider.subCategoryId.toString(),
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
subCategoryTitle.value = value.title.toString();
|
||||
}
|
||||
});
|
||||
|
||||
await FireStoreUtils.getReviewByProviderServiceId(provider.id.toString()).then((value) {
|
||||
await FireStoreUtils.getReviewByProviderServiceId(
|
||||
provider.id.toString(),
|
||||
).then((value) {
|
||||
ratingService.value = value;
|
||||
});
|
||||
|
||||
if (Constant.userModel != null) {
|
||||
await FireStoreUtils.getFavouritesServiceList(FireStoreUtils.getCurrentUid()).then((value) {
|
||||
await FireStoreUtils.getFavouritesServiceList(
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
).then((value) {
|
||||
lstFav.value = value;
|
||||
});
|
||||
}
|
||||
@@ -78,8 +88,12 @@ class OnDemandDetailsController extends GetxController {
|
||||
|
||||
for (var element in provider.days) {
|
||||
if (day == element.toString()) {
|
||||
final start = DateFormat("dd-MM-yyyy HH:mm").parse("$date ${provider.startTime}");
|
||||
final end = DateFormat("dd-MM-yyyy HH:mm").parse("$date ${provider.endTime}");
|
||||
final start = DateFormat(
|
||||
"dd-MM-yyyy HH:mm",
|
||||
).parse("$date ${provider.startTime}");
|
||||
final end = DateFormat(
|
||||
"dd-MM-yyyy HH:mm",
|
||||
).parse("$date ${provider.endTime}");
|
||||
if (isCurrentDateInRange(start, end)) {
|
||||
isOpen.value = true;
|
||||
}
|
||||
@@ -96,5 +110,3 @@ class OnDemandDetailsController extends GetxController {
|
||||
tabString.value = tab;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user