INFRA: Set Up Project.

This commit is contained in:
2025-11-28 11:10:49 +05:00
commit c798279f7d
609 changed files with 77436 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import 'dart:async';
import 'package:customer/models/order_model.dart';
import 'package:get/get.dart';
import '../service/database_helper.dart';
class OrderPlacingController extends GetxController {
RxBool isLoading = true.obs;
@override
void onInit() {
// TODO: implement onInit
getArgument();
startTimer();
super.onInit();
}
Rx<OrderModel> orderModel = OrderModel().obs;
Future<void> getArgument() async {
DatabaseHelper.instance.deleteAllCartProducts();
dynamic argumentData = Get.arguments;
if (argumentData != null) {
orderModel.value = argumentData['orderModel'];
}
isLoading.value = false;
update();
}
Timer? timer;
RxInt counter = 0.obs;
RxBool isPlacing = false.obs;
void startTimer() {
timer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (counter.value == 3) {
timer.cancel();
isPlacing.value = true;
}
counter++;
});
}
}