feat: new date picker and new logic
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart'
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_sales_info_dashboard/steward_sales_info_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
@@ -33,6 +34,7 @@ class StewardRootLogic extends GetxController {
|
||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||
Rxn<WidelyUsedLocalModel> widelyUsedList = Rxn<WidelyUsedLocalModel>();
|
||||
Rxn<StewardSalesInfoDashboard> stewardSalesInfoDashboard = Rxn<StewardSalesInfoDashboard>();
|
||||
Rxn<StewardRemainWeight> stewardRemainWeight = Rxn<StewardRemainWeight>();
|
||||
|
||||
late DioRemote dioRemote;
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
@@ -53,10 +55,6 @@ class StewardRootLogic extends GetxController {
|
||||
super.onInit();
|
||||
localDatasource = diChicken.get<ChickenLocalDataSource>();
|
||||
chickenRepository = diChicken.get<ChickenRepository>();
|
||||
|
||||
/*localDatasource.openBox().then((value) async {
|
||||
widelyUsedList.value = localDatasource.getAllWidely();
|
||||
});*/
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -73,6 +71,7 @@ class StewardRootLogic extends GetxController {
|
||||
getRolesProducts();
|
||||
}
|
||||
getStewardSaleDashboard();
|
||||
getStewardRemainWeightData();
|
||||
|
||||
if (widelyUsedList.value?.hasInit != true) {
|
||||
//TODO
|
||||
@@ -93,7 +92,9 @@ class StewardRootLogic extends GetxController {
|
||||
getInventory(),
|
||||
getRolesProducts(),
|
||||
getStewardSaleDashboard(),
|
||||
getStewardRemainWeightData(),
|
||||
getProvinces(),
|
||||
getStewardRemainWeightData(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -187,6 +188,19 @@ class StewardRootLogic extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getStewardRemainWeightData() async {
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await chickenRepository.getStewardRemainWeight(token: tokenService.accessToken.value!),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
stewardRemainWeight.value = result;
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
int getNestedKey() {
|
||||
switch (currentPage.value) {
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user