Files
daily_mobileapp_merchant/lib/Controller/Customers/Customercontroller.dart
2026-05-27 10:35:09 +05:30

43 lines
1.1 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import '../../Data/Repository/Customers/getCustomerbytenantidrepository.dart';
import '../../Model/Response/Customers/GetCustomerById/GetCustomerByTenantId.dart';
class CustomerController extends GetxController{
RxBool progress = true.obs;
List <GetCustomerByTenantIdDetails> getCustomerBytenantId =[];
GetCustomersByTenantIdRepository getCustomersByNumberTenantIdRepository = GetCustomersByTenantIdRepository();
TextEditingController searchController = TextEditingController();
getCustomerByTenantId()async {
GetCustomerByTenantId? result = await getCustomersByNumberTenantIdRepository.getCustomerByTenantId();
getCustomerByTenantIdResult(result!);
}
RxBool hasLoadedCustomerOnce = false.obs;
getCustomerByTenantIdResult(GetCustomerByTenantId data) {
if (!hasLoadedCustomerOnce.value) {
progress.value = true;
update();
}
getCustomerBytenantId = data.details ?? [];
progress.value = false;
hasLoadedCustomerOnce.value = true;
update();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
}