refactor: replace InventoryModel with ProductModel across the application, removing unused inventory model files and updating related repository and UI components

This commit is contained in:
2025-12-03 09:15:44 +03:30
parent ac2d8da95e
commit 8c9517b529
23 changed files with 296 additions and 728 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
@@ -13,6 +14,7 @@ class KillHouseRootLogic extends GetxController {
var tokenService = Get.find<TokenStorageService>();
late KillHouseRepository killHouseRepository;
Rxn<BroadcastPrice> broadcastPrice = Rxn<BroadcastPrice>();
@override
void onInit() {
@@ -26,8 +28,9 @@ class KillHouseRootLogic extends GetxController {
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () =>
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.actionKillHouse),
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.actionKillHouse,
),
);
return buildRouteFromGetPage(page);
@@ -52,4 +55,16 @@ class KillHouseRootLogic extends GetxController {
void changePage(int i) {
currentPage.value = i;
}
Future<void> getBroadcastPrice() async {
safeCall(
call: () async => await killHouseRepository.getBroadcastPrice(
token: tokenService.accessToken.value!,
),
onSuccess: (result) {
broadcastPrice.value = result;
},
onError: (error, stacktrace) {},
);
}
}

View File

@@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart' hide LinearGradient;
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/steward/widely_used/view.dart';
@@ -8,7 +7,8 @@ import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionHomeLogic> {
class WarehouseAndDistributionHomePage
extends GetView<WarehouseAndDistributionHomeLogic> {
const WarehouseAndDistributionHomePage({super.key});
@override
@@ -75,7 +75,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
child: Icon(
CupertinoIcons.chevron_up,
size: 18,
),
),
],
),
@@ -99,7 +102,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Row(
spacing: 8,
mainAxisAlignment: MainAxisAlignment.end,
children: [Icon(CupertinoIcons.chevron_down, size: 18)],
children: [
Icon(CupertinoIcons.chevron_down, size: 18),
],
),
_todayShipmentWidget(),
_todayShipmentWidget2(),
@@ -127,12 +132,17 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Assets.vec.chicken2Svg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueDark, BlendMode.srcIn),
colorFilter: ColorFilter.mode(
AppColor.blueDark,
BlendMode.srcIn,
),
),
Text(
'اطلاعات مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.iconColor,
),
),
],
),
@@ -151,7 +161,11 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Row(
children: [
SizedBox(width: 5.w),
Text('اطلاعات پخش', textAlign: TextAlign.right, style: AppFonts.yekan16),
Text(
'اطلاعات پخش',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
SizedBox(height: 8.h),
@@ -164,7 +178,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
title: 'وزن دولتی',
titleBgColor: const Color(0xFFB8E7DC),
valueBgColor: const Color(0xFFE6FAF5),
value: data.value?.totalGovernmentalInputWeight.separatedByComma,
value:
data.value?.totalGovernmentalInputWeight.separatedByComma,
),
),
Expanded(
@@ -178,7 +193,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Expanded(
child: broadcastItem(
title: 'فروش دولتی',
value: data.value?.totalGovernmentalOutputWeight.separatedByComma,
value: data
.value
?.totalGovernmentalOutputWeight
.separatedByComma,
titleBgColor: const Color(0xFFEBC4CE),
valueBgColor: const Color(0xFFEDDCE0),
),
@@ -202,7 +220,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Expanded(
child: broadcastItem(
title: 'مانده دولتی',
value: data.value?.totalGovernmentalRemainWeight.separatedByComma,
value: data
.value
?.totalGovernmentalRemainWeight
.separatedByComma,
titleBgColor: const Color(0xFFB8E7DC),
valueBgColor: const Color(0xFFE6FAF5),
),
@@ -218,7 +239,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Expanded(
child: broadcastItem(
title: 'فروش خارج استان',
value: data.value?.totalStewardFreeSaleBarCarcassesWeight.separatedByComma,
value: data
.value
?.totalStewardFreeSaleBarCarcassesWeight
.separatedByComma,
titleBgColor: const Color(0xFFEBC4CE),
valueBgColor: const Color(0xFFEDDCE0),
),
@@ -242,7 +266,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationIconCard(
title: 'توزیع داخل استان',
isLoading: data.value == null,
description: data.value?.freeSalesWeight.separatedByCommaFa ?? '0',
description:
data.value?.freeSalesWeight.separatedByCommaFa ?? '0',
iconPath: Assets.vec.truckSvg.path,
iconColor: const Color.fromRGBO(85, 97, 93, 1),
bgDescriptionColor: const Color(0xFFE6FAF5),
@@ -253,7 +278,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationIconCard(
title: 'توزیع خارج استان',
isLoading: data.value == null,
description: data.value?.stewardAllocationsWeight.separatedByCommaFa ?? '0',
description:
data.value?.stewardAllocationsWeight.separatedByCommaFa ??
'0',
iconPath: Assets.vec.truckFastSvg.path,
iconColor: Color(0xFF647379),
bgDescriptionColor: const Color(0xFFEAEFFF),
@@ -302,7 +329,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationLabelCard(
title: 'خارج استان',
isLoading: data.value == null,
description: data.value?.freeBuyingCarcassesWeight.separatedByCommaFa ?? '0',
description:
data.value?.freeBuyingCarcassesWeight.separatedByCommaFa ??
'0',
iconPath: Assets.vec.cubeSearchSvg.path,
iconColor: Color(0xFF2D5FFF),
bgLabelColor: const Color(0xFFAFCBFF),
@@ -326,7 +355,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationLabelCard(
title: 'مانده انبار',
isLoading: data.value == null,
description: data.value?.totalRemainWeight.separatedByCommaFa ?? '0',
description:
data.value?.totalRemainWeight.separatedByCommaFa ?? '0',
iconPath: Assets.vec.cubeSearchSvg.path,
bgDescriptionColor: const Color(0xFFEAEFFF),
bgLabelColor: const Color(0xFFBDD4FF),
@@ -337,7 +367,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationLabelCard(
title: 'توزیع شده',
isLoading: data.value == null,
description: data.value?.realAllocatedWeight.separatedByCommaFa ?? '0',
description:
data.value?.realAllocatedWeight.separatedByCommaFa ?? '0',
iconPath: Assets.vec.cubeRotateSvg.path,
iconColor: Color(0xFF5C4D64),
bgLabelColor: Color(0xFFC8B8D1),
@@ -375,7 +406,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: Assets.vec.cubeScanSvg.svg(
width: 12.w,
height: 12.h,
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
),
),
bgDescriptionColor: Colors.white,
@@ -395,7 +429,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
title: 'درانتظار',
borderColor: const Color(0xFF9758FF),
isLoading: data.value == null,
description: data.value?.totalNotEnteredBars.separatedByCommaFa ?? '0',
description:
data.value?.totalNotEnteredBars.separatedByCommaFa ?? '0',
unit:
'(${data.value?.totalNotEnteredKillHouseRequestsWeight.separatedByCommaFa})\nکیلوگرم',
icon: Container(
@@ -409,7 +444,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: Assets.vec.cubeCardFreeSvg.svg(
width: 12.w,
height: 12.h,
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(
Colors.white,
BlendMode.srcIn,
),
),
),
bgDescriptionColor: Colors.white,
@@ -437,7 +475,12 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationLabelCard(
title: 'مانده دولتی',
isLoading: data.value == null,
description: data.value?.totalGovernmentalRemainWeight?.separatedByCommaFa ?? '0',
description:
data
.value
?.totalGovernmentalRemainWeight
?.separatedByCommaFa ??
'0',
iconPath: Assets.vec.cubeCardGovermentSvg.path,
iconColor: AppColor.textColor,
bgDescriptionColor: const Color(0xFFF5ECEE),
@@ -448,7 +491,8 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: _informationLabelCard(
title: 'مانده آزاد',
isLoading: data.value == null,
description: data.value?.totalFreeRemainWeight.separatedByCommaFa ?? '0',
description:
data.value?.totalFreeRemainWeight.separatedByCommaFa ?? '0',
unit: 'کیلوگرم',
iconPath: Assets.vec.cubeCardFreeSvg.path,
iconColor: AppColor.textColor,
@@ -496,7 +540,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
),
Divider(),
inventoryListItem(title: 'کل فروش', value: model.realAllocatedWeight?.separatedByComma),
inventoryListItem(
title: 'کل فروش',
value: model.realAllocatedWeight?.separatedByComma,
),
Divider(),
inventoryListItem(
title: 'مانده انبار',
@@ -515,14 +562,25 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
children: [
Text(
title,
style: AppFonts.yekan14.copyWith(color: const Color(0xFF353535), height: 1.2),
style: AppFonts.yekan14.copyWith(
color: const Color(0xFF353535),
height: 1.2,
),
),
Spacer(),
value == null
? Center(child: CupertinoActivityIndicator())
: Text(value, style: AppFonts.yekan14.copyWith(color: const Color(0xFF353535))),
: Text(
value,
style: AppFonts.yekan14.copyWith(
color: const Color(0xFF353535),
),
),
SizedBox(width: 20.w),
Text('کیلوگرم', style: AppFonts.yekan10.copyWith(color: const Color(0xFF353535))),
Text(
'کیلوگرم',
style: AppFonts.yekan10.copyWith(color: const Color(0xFF353535)),
),
],
),
);
@@ -546,7 +604,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
height: 65.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: borderColor != null ? Border.all(width: 1, color: borderColor) : null,
border: borderColor != null
? Border.all(width: 1, color: borderColor)
: null,
),
clipBehavior: Clip.hardEdge,
child: Row(
@@ -605,12 +665,16 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Text(
description,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan16.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
Text(
unit,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan12.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
],
),
@@ -656,7 +720,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
isLoading
@@ -664,12 +730,16 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
: Text(
description,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan16.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
Text(
unit,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan12.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
],
),
@@ -704,7 +774,7 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Widget inventoryItem({
required bool isExpanded,
required int index,
required InventoryModel model,
required ProductModel model,
}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -729,8 +799,14 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
'کل ورودی به انبار (کیلوگرم)',
model.totalFreeBarsCarcassesWeight.toString(),
),
buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()),
buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()),
buildRow(
'کل فروش (کیلوگرم)',
model.realAllocatedWeight.toString(),
),
buildRow(
'مانده انبار (کیلوگرم)',
model.totalRemainWeight.toString(),
),
],
),
),
@@ -749,7 +825,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
),
Flexible(
@@ -757,7 +835,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: Text(
value,
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
),
],
@@ -783,7 +863,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Text(
'اطلاعات ارسالی',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
const SizedBox(height: 12),
buildRow(
@@ -816,7 +898,10 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
return Container(
height: height?.h ?? 73.h,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(color: valueBgColor, borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(
color: valueBgColor,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
@@ -829,7 +914,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Text(
title ?? 'بدون تیتر',
textAlign: TextAlign.center,
style: titleStyle ?? AppFonts.yekan12.copyWith(color: const Color(0xFF3E3E3E)),
style:
titleStyle ??
AppFonts.yekan12.copyWith(color: const Color(0xFF3E3E3E)),
),
],
),
@@ -842,7 +929,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
child: Text(
value,
textAlign: TextAlign.right,
style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.textColor),
style:
valueStyle ??
AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
)
: Center(child: CupertinoActivityIndicator()),
@@ -850,7 +939,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Text(
unit ?? 'کیلوگرم',
textAlign: TextAlign.center,
style: unitStyle ?? AppFonts.yekan10.copyWith(color: Color(0xFF717171)),
style:
unitStyle ??
AppFonts.yekan10.copyWith(color: Color(0xFF717171)),
),
SizedBox(height: 4.h),
],
@@ -902,19 +993,29 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
Row(
children: [
SizedBox(width: 5.w),
Text('تعهدات', textAlign: TextAlign.right, style: AppFonts.yekan16),
Text(
'تعهدات',
textAlign: TextAlign.right,
style: AppFonts.yekan16,
),
],
),
commitmentsItemList(
title: 'تعهد دولتی توزیع داخل استان',
value: data.value?.totalCommitmentSellingInProvinceGovernmentalWeight.separatedByComma,
value: data
.value
?.totalCommitmentSellingInProvinceGovernmentalWeight
.separatedByComma,
labelColor: const Color(0xFFB9E8DC),
bgColor: const Color(0xFFF3F9F8),
),
commitmentsItemList(
title: 'توزیع دولتی داخل استان',
value: data.value?.totalSellingInProvinceGovernmentalWeight.separatedByComma,
value: data
.value
?.totalSellingInProvinceGovernmentalWeight
.separatedByComma,
labelColor: const Color(0xFFC3D4F3),
bgColor: const Color(0xFFECF3FF),
),
@@ -929,19 +1030,26 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
),
commitmentsItemList(
title: 'تعهد آزاد توزیع داخل استان',
value: data.value?.totalCommitmentSellingInProvinceFreeWeight.separatedByComma,
value: data
.value
?.totalCommitmentSellingInProvinceFreeWeight
.separatedByComma,
labelColor: const Color(0xFFC7DADA),
bgColor: const Color(0xFFE5F7F7),
),
commitmentsItemList(
title: 'توزیع آزاد داخل استان',
value: data.value?.totalSellingInProvinceFreeWeight.separatedByComma,
value:
data.value?.totalSellingInProvinceFreeWeight.separatedByComma,
labelColor: const Color(0xFFE0D6ED),
bgColor: const Color(0xFFF5EDFF),
),
commitmentsItemList(
title: 'باقیمانده تعهد آزاد توزیع داخل استان',
value: data.value?.totalCommitmentSellingInProvinceFreeRemainWeight.separatedByComma,
value: data
.value
?.totalCommitmentSellingInProvinceFreeRemainWeight
.separatedByComma,
labelColor: const Color(0xFFEBC5CE),
bgColor: const Color(0xFFFFF1F4),
),
@@ -986,7 +1094,9 @@ class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionH
: Text(
value,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.textColor),
style: AppFonts.yekan16.copyWith(
color: AppColor.textColor,
),
),
SizedBox(width: 8.w),

View File

@@ -6,7 +6,6 @@ import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_sales_info_dashboard.dart';
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';
@@ -57,7 +56,7 @@ class WarehouseAndDistributionRootLogic extends GetxController {
RxList<ErrorLocationType> errorLocationType = RxList();
RxMap<int, dynamic> inventoryExpandedList = RxMap();
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
Rxn<ProductModel> inventoryModel = Rxn<ProductModel>();
Rxn<KillHouseSalesInfoDashboard> killHouseSalesInfoDashboard =
Rxn<KillHouseSalesInfoDashboard>();
RxList<IranProvinceCityModel> provinces = <IranProvinceCityModel>[].obs;

View File

@@ -565,7 +565,7 @@ class WarehouseAndDistributionRootPage
);
}
Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) {
Widget inventoryItem({required bool isExpanded, required int index, required ProductModel model}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 8,

View File

@@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart' hide LinearGradient;
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/steward/widely_used/view.dart';
@@ -704,7 +703,7 @@ class HomePage extends GetView<HomeLogic> {
Widget inventoryItem({
required bool isExpanded,
required int index,
required InventoryModel model,
required ProductModel model,
}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -5,7 +5,6 @@ import 'package:flutter/widgets.dart';
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
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';
@@ -53,7 +52,7 @@ class StewardRootLogic extends GetxController {
RxList<ErrorLocationType> errorLocationType = RxList();
RxMap<int, dynamic> inventoryExpandedList = RxMap();
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
Rxn<ProductModel> inventoryModel = Rxn<ProductModel>();
RxList<IranProvinceCityModel> provinces = <IranProvinceCityModel>[].obs;
// Cancel tokens for API calls
@@ -123,7 +122,7 @@ class StewardRootLogic extends GetxController {
_inventoryCancelToken?.cancel();
_inventoryCancelToken = CancelToken();
await safeCall<List<InventoryModel>?>(
await safeCall<List<ProductModel>?>(
call: () async => await chickenRepository.getInventory(
token: tokenService.accessToken.value!,
cancelToken: _inventoryCancelToken,

View File

@@ -561,7 +561,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
);
}
Widget inventoryItem({required bool isExpanded, required int index, required InventoryModel model}) {
Widget inventoryItem({required bool isExpanded, required int index, required ProductModel model}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 8,

View File

@@ -1,12 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_core/core.dart';
class InventoryWidget extends StatelessWidget {
final InventoryModel? inventoryModel;
final ProductModel? inventoryModel;
const InventoryWidget({super.key, required this.inventoryModel});