INFRA: Set Up Project.
This commit is contained in:
34
lib/controllers/dine_in_booking_controller.dart
Normal file
34
lib/controllers/dine_in_booking_controller.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import '../models/dine_in_booking_model.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class DineInBookingController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
|
||||
RxBool isFeature = true.obs;
|
||||
|
||||
RxList<DineInBookingModel> featureList = <DineInBookingModel>[].obs;
|
||||
RxList<DineInBookingModel> historyList = <DineInBookingModel>[].obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
getDineInBooking();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
Future<void> getDineInBooking() async {
|
||||
await FireStoreUtils.getDineInBooking(true).then(
|
||||
(value) {
|
||||
featureList.value = value;
|
||||
},
|
||||
);
|
||||
await FireStoreUtils.getDineInBooking(false).then(
|
||||
(value) {
|
||||
historyList.value = value;
|
||||
},
|
||||
);
|
||||
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user