refactor: update SDK version to 3.10.0 and clean up unused variables

fix: fix some analyze issue
This commit is contained in:
2025-11-18 08:56:45 +03:30
parent c4bc31029f
commit 246b64c562
33 changed files with 454 additions and 444 deletions

View File

@@ -25,6 +25,7 @@ class DioErrorHandler {
}
//wrong captcha => "detail": "Captcha code is incorrect" - 403
// ignore: unused_element
void _handle403() {}
void _handleGeneric(DioException error) {

View File

@@ -1,4 +1,3 @@
import 'package:rasadyar_chicken/chicken.dart';
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
import 'package:rasadyar_core/core.dart';
@@ -15,7 +14,7 @@ class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
@override
Future<void> initWidleyUsed() async {
List<WidelyUsedLocalItem> tmpList = [
/* List<WidelyUsedLocalItem> tmpList = [
WidelyUsedLocalItem(
index: 0,
pathId: 0,
@@ -43,7 +42,7 @@ class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
iconPath: Assets.vec.cubeRotateSvg.path,
path: ChickenRoutes.buysInProvinceSteward,
),
];
]; */
}
@override

View File

@@ -1,4 +1,4 @@
import 'package:rasadyar_chicken/data/models/response/captcha/captcha_response_model.dart';
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart';

View File

@@ -142,7 +142,7 @@ class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource {
required String token,
required Map<String, dynamic> allocation,
}) async {
var res = await _httpClient.put(
await _httpClient.put(
'/steward-allocation/0/',
headers: {'Authorization': 'Bearer $token'},
data: allocation,
@@ -312,7 +312,7 @@ class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource {
required String token,
required CreateStewardFreeBar body,
}) async {
var res = await _httpClient.post(
await _httpClient.post(
'/steward_free_bar/',
headers: {'Authorization': 'Bearer $token'},
data: body.toJson()..removeWhere((key, value) => value==null,),

View File

@@ -14,6 +14,7 @@ abstract class KillRegistrationRequest with _$KillRegistrationRequest {
int? quantity,
String? sendDate,
String? chickenBreed,
// ignore: invalid_annotation_target
@JsonKey(name: "Index_weight") double? indexWeight,
String? losses,
List<dynamic>? auctionList,

View File

@@ -20,6 +20,7 @@ abstract class PoultryOrder with _$PoultryOrder {
double? amount,
String? financialOperation,
int? remainQuantity,
// ignore: invalid_annotation_target
@JsonKey(name: "Index_weight") double? indexWeight,
Hatching? hatching,
String? finalState,

View File

@@ -9,20 +9,10 @@ class RoleLogic extends GetxController {
void onInit() {
super.onInit();
List<String> items = tokenService.getUserLocal(Module.chicken)!.roles ?? [];
if (items.isNotEmpty ?? false) {
if (items.isNotEmpty) {
roles.assignAll(items);
}
}
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:get/get.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/info_card/info_card.dart';
@@ -397,7 +396,6 @@ class PoultryFarmInspectionHomePage
const hallRemain = '۱۷,۹۴۰';
const losses = '۵۶۰';
const vetInfo = 'دکتر حمید نادری(۰۹۱۳۴۴۵۵۶۶۷)';
const showReportButton = false;
const reportStatus = 'بازدید تایید شده';
final reportColor = AppColor.greenNormal;
return Container(

View File

@@ -136,7 +136,7 @@ class GenocidePage extends GetView<GenocideLogic> {
),
Text(
'تعداد:${item.quantity.separatedByComma ?? '-'} (قطعه)',
'تعداد:${item.quantity.separatedByComma} (قطعه)',
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
],
@@ -149,7 +149,7 @@ class GenocidePage extends GetView<GenocideLogic> {
value: (item.freeSaleInProvince ?? false) ? 'آزاد' : 'دولتی ',
),
buildRow(title: 'نوع کشتار ', value: controller.getKillType(item)),
buildRow(title: 'درخواست', value: controller.getRequestType(item) ?? 'N/A'),
buildRow(title: 'درخواست', value: controller.getRequestType(item)),
buildRow(title: 'میانگین وزنی', value: '${(item.indexWeight)} (کیلوگرم)'),
buildRow(title: 'قیمت مرغدار', value: '${item.amount.separatedByComma} (ریال)'),
@@ -231,7 +231,7 @@ class GenocidePage extends GetView<GenocideLogic> {
),
Text(
'تعداد:${item.quantity.separatedByComma ?? '-'} (قطعه)',
'تعداد:${item.quantity.separatedByComma} (قطعه)',
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
),
],

View File

@@ -465,7 +465,7 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
visible: item.realQuantity != null,
child: buildRow(
title: 'تعداد تاییده',
value: item.realQuantity.separatedByComma ?? '-',
value: item.realQuantity.separatedByComma,
),
),
},

View File

@@ -4,7 +4,6 @@ import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart';
import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';

View File

@@ -83,7 +83,6 @@ class BuyInProvinceLogic extends GetxController {
}
Future<void> onRefresh() async {
final isWaiting = selectedSegmentIndex.value == 0;
await rootLogic.onRefresh();
await Future.wait([buyWaitingLogic.getWaitingArrivals(), buyAllLogic.getAllArrivals()]);
}

View File

@@ -42,11 +42,7 @@ class BuyInProvinceAllLogic extends GetxController {
});
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
Future<void> getAllArrivals([bool isLoadingMore = false]) async {
if (isLoadingMore) {
@@ -71,8 +67,8 @@ class BuyInProvinceAllLogic extends GetxController {
search: 'filter',
role: 'Steward',
value: searchedValue.value,
fromDate: fromDateFilter.value?.toDateTime(),
toDate: toDateFilter.value?.toDateTime(),
fromDate: fromDateFilter.value.toDateTime(),
toDate: toDateFilter.value.toDateTime(),
),
),
onSuccess: (res) async {

View File

@@ -48,10 +48,7 @@ class BuyInProvinceWaitingLogic extends GetxController {
});
}
@override
void onClose() {
super.onClose();
}
void setSearchValue(String? data) {
searchedValue.value = data?.trim();
@@ -80,8 +77,8 @@ class BuyInProvinceWaitingLogic extends GetxController {
search: 'filter',
role: 'Steward',
value: searchedValue.value,
fromDate: fromDateFilter.value?.toDateTime(),
toDate: toDateFilter.value?.toDateTime(),
fromDate: fromDateFilter.value.toDateTime(),
toDate: toDateFilter.value.toDateTime(),
),
),
onSuccess: (res) async {

View File

@@ -428,7 +428,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
enabled: controller.isSubmitButtonEnabled.value,
onPressed: isOnEdit
? () async {
var res = await controller.editStewardPurchaseOutOfProvince();
await controller.editStewardPurchaseOutOfProvince();
Get.back();
}
: () async {

View File

@@ -1,6 +1,5 @@
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
import 'package:rasadyar_core/core.dart';

View File

@@ -225,9 +225,6 @@ class StewardRootLogic extends GetxController {
final nestedKeyId = getNestedKey();
GlobalKey<NavigatorState>? currentNestedKey = Get.nestedKey(nestedKeyId);
final currentRoute = currentNestedKey?.currentState;
fLog("onPopScopTaped ==> ${currentNestedKey?.currentState?.canPop()}");
if (currentNestedKey?.currentState?.canPop() == true) {
iLog(currentNestedKey?.currentState?.canPop());
iLog(currentNestedKey?.currentContext);

View File

@@ -25,8 +25,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () =>
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.buySteward),
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.buySteward,
),
);
return buildRouteFromGetPage(page);
@@ -37,8 +38,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () =>
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.saleSteward),
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.saleSteward,
),
);
return buildRouteFromGetPage(page);
@@ -46,15 +48,18 @@ class StewardRootPage extends GetView<StewardRootLogic> {
),
Navigator(
key: Get.nestedKey(stewardThirdKey),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[2]),
),
Navigator(
key: Get.nestedKey(stewardFourthKey),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[3]),
),
Navigator(
key: Get.nestedKey(stewardFifthKey),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[4]),
),
],
index: data.value,
@@ -150,7 +155,10 @@ class StewardRootPage extends GetView<StewardRootLogic> {
return Container(
height: 70,
width: Get.width / 2,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
clipBehavior: Clip.hardEdge,
child: Row(
children: [
@@ -171,7 +179,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
Text(
'بارهای امروز',
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan14.copyWith(
color: AppColor.blueNormal,
),
),
],
),
@@ -238,7 +248,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
],
),
@@ -261,12 +273,16 @@ class StewardRootPage extends GetView<StewardRootLogic> {
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,
),
),
],
),
@@ -311,17 +327,23 @@ class StewardRootPage extends GetView<StewardRootLogic> {
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
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,
),
),
],
),
@@ -369,14 +391,18 @@ class StewardRootPage extends GetView<StewardRootLogic> {
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: const Color(0xFFBECDFF),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
color: AppColor.blueNormal,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: SvgGenImage.vec(iconPath).svg(
width: 24,
@@ -386,7 +412,10 @@ class StewardRootPage extends GetView<StewardRootLogic> {
),
),
),
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
Text(
title,
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
),
],
);
}
@@ -403,16 +432,24 @@ class StewardRootPage extends GetView<StewardRootLogic> {
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: const Color(0xFFD9F7F0),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Assets.vec.messageAddSvg.svg(
width: 40,
height: 40,
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
colorFilter: ColorFilter.mode(
AppColor.greenNormal,
BlendMode.srcIn,
),
fit: BoxFit.cover,
),
),
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
Text(
'افزودن',
style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover),
),
],
);
}
@@ -559,7 +596,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
child: Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
),
Flexible(
@@ -567,7 +606,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
child: Text(
value,
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
),
],
@@ -593,7 +634,9 @@ class StewardRootPage extends GetView<StewardRootLogic> {
Text(
'اطلاعات ارسالی',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
const SizedBox(height: 12),
buildRow(

View File

@@ -474,7 +474,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
Expanded(
child: ObxValue((data) {
return Text(
date.value?.formatCompactDate() ?? Jalali.now().formatCompactDate(),
date.value.formatCompactDate(),
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive),
);

View File

@@ -46,7 +46,7 @@ Widget addOrEditBottomSheet(SalesInProvinceLogic controller, {bool isEditMode =
);
},
borderColor: AppColor.darkGreyLight,
initText: (data.value ?? Jalali.now()).formatCompactDate(),
initText: (data.value).formatCompactDate(),
);
}, controller.fromDateFilter),
Visibility(

View File

@@ -36,7 +36,8 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
ObxValue((data) {
return RPaginatedListView(
onLoadMore: () async => controller.getOutProvinceSales(true),
onLoadMore: () async =>
controller.getOutProvinceSales(true),
hasMore: data.value.data?.next != null,
listType: ListType.separated,
resource: data.value,
@@ -70,19 +71,27 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
children: [
RFab.add(
onPressed: () {
Get.bottomSheet(addOrEditSaleBottomSheet(), isScrollControlled: true).then((
value,
) {
Get.bottomSheet(
addOrEditSaleBottomSheet(),
isScrollControlled: true,
).then((value) {
controller.clearSaleForm();
});
},
),
Spacer(),
RFab(
icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w),
icon: Icon(
CupertinoIcons.person_add_solid,
color: Colors.white,
size: 35.w,
),
backgroundColor: AppColor.blueNormal,
onPressed: () {
Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyerSteward, id: stewardSecondKey);
Get.toNamed(
ChickenRoutes.salesOutOfProvinceBuyerSteward,
id: stewardSecondKey,
);
},
),
SizedBox(width: 25),
@@ -176,7 +185,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
itemListExpandedWidget(StewardFreeSaleBar item, int index) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
spacing: 8,
children: [
@@ -208,12 +220,16 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
children: [
Text(
item.date?.toJalali.formatter.wN ?? 'ندارد',
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
style: AppFonts.yekan14.copyWith(
color: AppColor.textColor,
),
),
Text(
'${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'ندارد'}',
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan14.copyWith(
color: AppColor.blueNormal,
),
),
],
),
@@ -230,7 +246,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
],
),
),
buildRow(title: 'مشخصات خریدار', value: item.buyer?.fullname ?? 'ندارد'),
buildRow(
title: 'مشخصات خریدار',
value: item.buyer?.fullname ?? 'ندارد',
),
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'ندارد'),
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'ندارد'),
buildRow(
@@ -248,7 +267,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
value: item.productionDate?.toJalali.formatCompactDate() ?? 'ندارد',
),
buildRow(title: 'انبار فروش', value: '${item.quota?.faTitle}'),
buildRow(title: 'کد قرنطینه ', value: item.clearanceCode ?? 'بدون کد'),
buildRow(
title: 'کد قرنطینه ',
value: item.clearanceCode ?? 'بدون کد',
),
buildRow(
title: 'حجم تقریبی لاشه ',
@@ -261,7 +283,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
children: [
Text(
'کد احراز',
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
Spacer(),
RElevated(
@@ -271,7 +295,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
backgroundColor: AppColor.blueDarkHover,
text: 'ارسال کد',
onPressed: () {
Get.bottomSheet(bottomSendOtpSheetSellCode(item)).then((value) {
Get.bottomSheet(bottomSendOtpSheetSellCode(item)).then((
value,
) {
controller.otpCode.value = '';
controller.otpCodeSell.clear();
});
@@ -280,7 +306,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
],
)
: buildRow(title: 'کد احراز ', value: '${item.registerCode}'),
buildRow(title: 'کد قرنطینه ', value: item.clearanceCode ?? 'بدون کد'),
buildRow(
title: 'کد قرنطینه ',
value: item.clearanceCode ?? 'بدون کد',
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -338,7 +367,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
children: [
Text(
isOnEdit ? 'ویرایش فروش' : 'افزودن فروش',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
_productDropDown(),
@@ -360,7 +391,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
label: 'تاریخ',
onTap: () {
Get.bottomSheet(
modalDatePicker((value) => controller.setSaleDate(value)),
modalDatePicker(
(value) => controller.setSaleDate(value),
),
);
},
borderColor: AppColor.darkGreyLight,
@@ -375,7 +408,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
border: Border.all(
color: AppColor.darkGreyLight,
width: 1,
),
),
child: Stack(
fit: StackFit.expand,
@@ -383,7 +419,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
clipBehavior: Clip.none,
children: [
Positioned(
child: Container(color: Colors.white, child: Text("انبار")),
child: Container(
color: Colors.white,
child: Text("انبار"),
),
top: -10,
right: 8,
),
@@ -404,7 +443,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
child: Row(
children: [
Radio(value: 1),
Text('دولتی', style: AppFonts.yekan14),
Text(
'دولتی',
style: AppFonts.yekan14,
),
],
),
),
@@ -418,7 +460,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
child: Row(
children: [
Radio(value: 2),
Text('آزاد', style: AppFonts.yekan14),
Text(
'آزاد',
style: AppFonts.yekan14,
),
],
),
),
@@ -435,7 +480,8 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
Obx(() {
return MonthlyDataCalendar(
label: 'تاریخ تولید گوشت',
selectedDate: controller.productionDate.value?.formatCompactDate(),
selectedDate: controller.productionDate.value
?.formatCompactDate(),
onDateSelect: (value) {
controller.setProductionDate(value);
},
@@ -445,7 +491,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
);
}),
Visibility(visible: isOnEdit == false, child: _buyerWidget()),
Visibility(
visible: isOnEdit == false,
child: _buyerWidget(),
),
RTextField(
controller: controller.saleWeightController,
@@ -500,7 +549,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
border: Border.all(
color: AppColor.darkGreyLight,
width: 1,
),
),
child: Stack(
fit: StackFit.expand,
@@ -508,7 +560,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
clipBehavior: Clip.none,
children: [
Positioned(
child: Container(color: Colors.white, child: Text("فروش")),
child: Container(
color: Colors.white,
child: Text("فروش"),
),
top: -10,
right: 8,
),
@@ -522,7 +577,12 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
children: [
Expanded(
child: GestureDetector(
onTap: (controller.broadcastPrice.value?.active ?? false)
onTap:
(controller
.broadcastPrice
.value
?.active ??
false)
? () {
controller.saleType.value = 2;
}
@@ -532,13 +592,20 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
Radio(
value: 1,
enabled:
controller.broadcastPrice.value?.active ?? false,
controller
.broadcastPrice
.value
?.active ??
false,
),
Text(
'قیمت مصوب',
style: AppFonts.yekan14.copyWith(
color:
(controller.broadcastPrice.value?.active ??
(controller
.broadcastPrice
.value
?.active ??
false)
? AppColor.textColor
: AppColor.labelTextColor,
@@ -557,7 +624,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
child: Row(
children: [
Radio(value: 2),
Text('قیمت آزاد', style: AppFonts.yekan14),
Text(
'قیمت آزاد',
style: AppFonts.yekan14,
),
],
),
),
@@ -584,7 +654,8 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
filled: true,
readonly: data.value == 1,
onChanged: (p0) {
controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0;
controller.pricePerKilo.value =
int.tryParse(p0.clearComma) ?? 0;
},
keyboardType: TextInputType.number,
label: 'قیمت هر کیلو (ريال)',
@@ -639,7 +710,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
text: isOnEdit ? 'ویرایش' : 'ثبت',
onPressed: data.value
? () async {
var res = isOnEdit ? await controller.editSale() : await controller.createSale();
isOnEdit
? await controller.editSale()
: await controller.createSale();
}
: null,
height: 40,
@@ -684,7 +757,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
Text(item?.name ?? 'انتخاب محصول'),
Spacer(),
ObxValue((data) {
return Visibility(visible: data.value != null, child: Text('موجودی: $data'));
return Visibility(
visible: data.value != null,
child: Text('موجودی: $data'),
);
}, controller.remainingStock),
],
),
@@ -716,15 +792,23 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
Assets.vec.calendarSvg.svg(
width: 24,
height: 24,
colorFilter: const ColorFilter.mode(AppColor.bgDark, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(
AppColor.bgDark,
BlendMode.srcIn,
),
),
Text(
title ?? 'تاریخ',
style: AppFonts.yekan16.copyWith(color: AppColor.bgDark),
),
Text(title ?? 'تاریخ', style: AppFonts.yekan16.copyWith(color: AppColor.bgDark)),
Expanded(
child: ObxValue((data) {
return Text(
date.value.formatCompactDate(),
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark),
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDark,
),
);
}, date),
),
@@ -806,7 +890,9 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
height: 40.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(
@@ -868,12 +954,16 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
maxLines: 1,
textDirection: TextDirection.ltr,
overflow: TextOverflow.ellipsis,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
Text(
unit,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
style: AppFonts.yekan12.copyWith(
color: AppColor.mediumGreyDarkActive,
),
),
],
),

View File

@@ -175,7 +175,7 @@ class SalesOutOfProvinceBuyersLogic extends GetxController {
mobile: buyerPhoneController.text,
role: 'Steward',
);
final res = await rootLogic.chickenRepository.createOutProvinceCarcassesBuyer(
await rootLogic.chickenRepository.createOutProvinceCarcassesBuyer(
token: rootLogic.tokenService.accessToken.value!,
body: buyer,
);

View File

@@ -4,27 +4,14 @@ import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart';
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart';
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.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/kill_house_poultry/kill_house_poultry.dart';
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
import 'package:rasadyar_chicken/data/models/response/steward_sales_info_dashboard/steward_sales_info_dashboard.dart';
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart';
import 'package:rasadyar_core/core.dart';