feat: warehouse_and_distribution in killhouse module
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:rasadyar_chicken/presentation/pages/steward/buy_in_province_all/
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/buy_in_province_waiting/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory/inventory_widget.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -25,7 +25,10 @@ class BuyInProvincePage extends GetView<BuyInProvinceLogic> {
|
||||
onRefresh: controller.onRefresh,
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(controller.rootLogic),
|
||||
ObxValue((data) {
|
||||
return InventoryWidget(inventoryModel: data.value!);
|
||||
}, controller.rootLogic.inventoryModel),
|
||||
|
||||
segmentWidget(),
|
||||
ObxValue((index) {
|
||||
return Expanded(
|
||||
|
||||
@@ -8,7 +8,8 @@ import 'package:rasadyar_chicken/data/models/response/roles_products/roles_produ
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory/inventory_widget.dart';
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -32,7 +33,10 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
||||
Positioned.fill(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(controller.rootLogic),
|
||||
ObxValue((data) {
|
||||
return InventoryWidget(inventoryModel: data.value!);
|
||||
}, controller.rootLogic.inventoryModel),
|
||||
|
||||
ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
|
||||
@@ -28,12 +28,22 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
class StewardRootLogic extends GetxController {
|
||||
DateTime? _lastBackPressed;
|
||||
RxInt currentPage = 2.obs;
|
||||
List<Widget> pages = [BuyPage(), SalePage(), HomePage(), SegmentationPage(), ProfilePage()];
|
||||
List<Widget> pages = [
|
||||
BuyPage(),
|
||||
SalePage(),
|
||||
HomePage(),
|
||||
SegmentationPage(),
|
||||
ProfilePage(),
|
||||
];
|
||||
|
||||
final defaultRoutes = <int, String>{0: ChickenRoutes.buySteward, 1: ChickenRoutes.saleSteward};
|
||||
final defaultRoutes = <int, String>{
|
||||
0: ChickenRoutes.buySteward,
|
||||
1: ChickenRoutes.saleSteward,
|
||||
};
|
||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||
Rxn<WidelyUsedLocalModel> widelyUsedList = Rxn<WidelyUsedLocalModel>();
|
||||
Rxn<StewardSalesInfoDashboard> stewardSalesInfoDashboard = Rxn<StewardSalesInfoDashboard>();
|
||||
Rxn<StewardSalesInfoDashboard> stewardSalesInfoDashboard =
|
||||
Rxn<StewardSalesInfoDashboard>();
|
||||
Rxn<StewardRemainWeight> stewardRemainWeight = Rxn<StewardRemainWeight>();
|
||||
|
||||
late DioRemote dioRemote;
|
||||
@@ -75,7 +85,9 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
if (widelyUsedList.value?.hasInit != true) {
|
||||
//TODO
|
||||
localDatasource.initWidleyUsed().then((value) => localDatasource.getAllWidely());
|
||||
localDatasource.initWidleyUsed().then(
|
||||
(value) => localDatasource.getAllWidely(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +127,7 @@ class StewardRootLogic extends GetxController {
|
||||
call: () async => await chickenRepository.getInventory(
|
||||
token: tokenService.accessToken.value!,
|
||||
cancelToken: _inventoryCancelToken,
|
||||
role: 'Steward',
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
@@ -146,7 +159,9 @@ class StewardRootLogic extends GetxController {
|
||||
_provincesCancelToken = CancelToken();
|
||||
|
||||
try {
|
||||
final res = await chickenRepository.getProvince(cancelToken: _provincesCancelToken);
|
||||
final res = await chickenRepository.getProvince(
|
||||
cancelToken: _provincesCancelToken,
|
||||
);
|
||||
if (res != null) {
|
||||
provinces.clear();
|
||||
provinces.value = res;
|
||||
@@ -162,8 +177,9 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
Future<void> getRolesProducts() async {
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await chickenRepository.getRolesProducts(token: tokenService.accessToken.value!),
|
||||
call: () async => await chickenRepository.getRolesProducts(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
rolesProductsModel.value = result;
|
||||
@@ -190,8 +206,9 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
Future<void> getStewardRemainWeightData() async {
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await chickenRepository.getStewardRemainWeight(token: tokenService.accessToken.value!),
|
||||
call: () async => await chickenRepository.getStewardRemainWeight(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
stewardRemainWeight.value = result;
|
||||
@@ -231,7 +248,8 @@ class StewardRootLogic extends GetxController {
|
||||
currentNestedKey?.currentState?.popUntil((route) => route.isFirst);
|
||||
} else {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
|
||||
@@ -4,7 +4,8 @@ import 'package:rasadyar_chicken/presentation/pages/steward/sales_in_province/wi
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory/inventory_widget.dart';
|
||||
|
||||
import 'package:rasadyar_core/core.dart' hide modalDatePicker;
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -27,7 +28,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
Positioned.fill(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(controller.rootLogic),
|
||||
ObxValue((data) {
|
||||
return InventoryWidget(inventoryModel: data.value!);
|
||||
}, controller.rootLogic.inventoryModel),
|
||||
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/steward/inventory_widget.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/inventory/inventory_widget.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -32,7 +32,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
||||
Positioned.fill(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(controller.rootLogic),
|
||||
ObxValue((data) {
|
||||
return InventoryWidget(inventoryModel: data.value!);
|
||||
}, controller.rootLogic.inventoryModel),
|
||||
|
||||
ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
|
||||
Reference in New Issue
Block a user