chore: remove unused assets and data source files related to the kill house module, and update import paths for better organization

This commit is contained in:
2025-12-27 16:35:37 +03:30
parent 60c58ef17e
commit 0b49302434
70 changed files with 1393 additions and 2088 deletions

View File

@@ -1,244 +0,0 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
import 'package:rasadyar_chicken/features/common/data/repositories/auth/auth_repository.dart';
import 'package:rasadyar_chicken/features/common/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
import 'package:rasadyar_core/core.dart';
enum AuthType { useAndPass, otp }
enum AuthStatus { init }
enum OtpStatus { init, sent, verified, reSend }
class AuthLogic extends GetxController with GetTickerProviderStateMixin {
GlobalKey<FormState> formKey = GlobalKey<FormState>();
late AnimationController _textAnimationController;
late Animation<double> textAnimation;
RxBool showCard = false.obs;
RxBool rememberMe = false.obs;
Rx<GlobalKey<FormState>> formKeyOtp = GlobalKey<FormState>().obs;
Rx<GlobalKey<FormState>> formKeySentOtp = GlobalKey<FormState>().obs;
Rx<TextEditingController> usernameController = TextEditingController().obs;
Rx<TextEditingController> passwordController = TextEditingController().obs;
Rx<TextEditingController> phoneOtpNumberController =
TextEditingController().obs;
Rx<TextEditingController> otpCodeController = TextEditingController().obs;
var captchaController = Get.find<CaptchaWidgetLogic>();
RxnString phoneNumber = RxnString(null);
RxBool isLoading = false.obs;
RxBool isDisabled = true.obs;
GService gService = Get.find<GService>();
TokenStorageService tokenStorageService = Get.find<TokenStorageService>();
Rx<AuthType> authType = AuthType.useAndPass.obs;
Rx<AuthStatus> authStatus = AuthStatus.init.obs;
Rx<OtpStatus> otpStatus = OtpStatus.init.obs;
RxnString deviceName = RxnString(null);
RxInt secondsRemaining = 120.obs;
Timer? _timer;
AuthRepository authRepository = diChicken.get<AuthRepository>();
final Module _module = Get.arguments;
@override
void onInit() {
super.onInit();
_textAnimationController =
AnimationController(
vsync: this,
duration: const Duration(milliseconds: 1200),
)
..repeat(reverse: true, count: 2).whenComplete(() {
showCard.value = true;
});
textAnimation = CurvedAnimation(
parent: _textAnimationController,
curve: Curves.easeInOut,
);
initUserPassData();
getDeviceModel();
}
@override
void onClose() {
_textAnimationController.dispose();
_timer?.cancel();
super.onClose();
}
void startTimer() {
_timer?.cancel();
secondsRemaining.value = 120;
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (secondsRemaining.value > 0) {
secondsRemaining.value--;
} else {
timer.cancel();
}
});
}
void stopTimer() {
_timer?.cancel();
}
String get timeFormatted {
final minutes = secondsRemaining.value ~/ 60;
final seconds = secondsRemaining.value % 60;
return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
}
bool _isFormValid() {
final isCaptchaValid =
captchaController.formKey.currentState?.validate() ?? false;
final isFormValid = formKey.currentState?.validate() ?? false;
return isCaptchaValid && isFormValid;
}
Future<void> submitLoginForm() async {
if (!_isFormValid()) return;
AuthRepository authTmp = diChicken.get<AuthRepository>();
isLoading.value = true;
await safeCall<UserProfileModel?>(
call: () => authTmp.login(
authRequest: {
"username": usernameController.value.text,
"password": passwordController.value.text,
},
),
onSuccess: (result) async {
await gService.saveSelectedModule(_module);
await tokenStorageService.saveModule(_module);
await tokenStorageService.saveAccessToken(
_module,
result?.accessToken ?? '',
);
await tokenStorageService.saveRefreshToken(
_module,
result?.accessToken ?? '',
);
var tmpRoles = result?.role?.where((element) {
final allowedRoles = {
'poultryscience',
'steward',
'killhouse',
'provinceinspector',
'cityjahad',
'jahad',
'vetfarm',
'provincesupervisor',
'superadmin',
};
final lowerElement = element.toString().toLowerCase().trim();
return allowedRoles.contains(lowerElement);
}).toList();
if (tmpRoles?.length==1) {
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
}
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
if (rememberMe.value) {
await tokenStorageService.saveUserPass(
_module,
usernameController.value.text,
passwordController.value.text,
);
}
authTmp.stewardAppLogin(
token: result?.accessToken ?? '',
queryParameters: {
"mobile": usernameController.value.text,
"device_name": deviceName.value,
},
);
Get.offAndToNamed(CommonRoutes.role);
/* if (tmpRoles!.length > 1) {
Get.offAndToNamed(CommonRoutes.role);
} else {
Get.offAllNamed(StewardRoutes.initSteward);
} */
},
onError: (error, stackTrace) {
if (error is DioException) {
diChicken.get<DioErrorHandler>().handle(error);
if ((error.type == DioExceptionType.unknown) ||
(error.type == DioExceptionType.connectionError)) {
getUserInfo(usernameController.value.text);
}
}
captchaController.getCaptcha();
},
);
isLoading.value = false;
}
Future<void> getUserInfo(String value) async {
isLoading.value = true;
await safeCall<UserInfoModel?>(
call: () async => await authRepository.getUserInfo(value),
onSuccess: (result) async {
if (result != null) {
await newSetupAuthDI(result.backend ?? '');
await diChicken.allReady();
}
},
onError: (error, stackTrace) {
if (error is DioException) {
diChicken.get<DioErrorHandler>().handle(error);
}
captchaController.getCaptcha();
},
);
isLoading.value = false;
}
void initUserPassData() {
UserLocalModel? userLocalModel = tokenStorageService.getUserLocal(
Module.chicken,
);
if (userLocalModel?.username != null && userLocalModel?.password != null) {
usernameController.value.text = userLocalModel?.username ?? '';
passwordController.value.text = userLocalModel?.password ?? '';
rememberMe.value = true;
}
}
Future<void> getDeviceModel() async {
final deviceInfo = DeviceInfoPlugin();
if (Platform.isAndroid) {
final info = await deviceInfo.androidInfo;
deviceName.value =
'Device:${info.manufacturer} Model:${info.model} version ${info.version.release}';
} else if (Platform.isIOS) {
final info = await deviceInfo.iosInfo;
deviceName.value =
'Device:${info.utsname.machine} Model:${info.model} version ${info.systemVersion}';
} else {}
}
}

View File

@@ -1,394 +0,0 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/captcha/view.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class AuthPage extends GetView<AuthLogic> {
const AuthPage({super.key});
@override
Widget build(BuildContext context) {
return ChickenBasePage(
isFullScreen: true,
backGroundWidget: backGroundDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
const Color(0xFFB2C9FF).withValues(alpha: 1.0), // 0%
const Color(0xFF40BB93).withValues(alpha: 0.11), // 50%
const Color(0xFF93B6D3).withValues(alpha: 1.0), // 100%
],
stops: const [0.0, 0.5, 1.0],
),
backgroundPath: Assets.images.patternChicken.path,
),
onPopScopTaped: () => Get.back(result: -1),
child: Stack(
children: [
Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.r),
child: FadeTransition(
opacity: controller.textAnimation,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
spacing: 12,
children: [
Text(
'به سامانه رصدطیور خوش آمدید!',
textAlign: TextAlign.right,
style: AppFonts.yekan25Bold.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
Text(
'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی',
textAlign: TextAlign.center,
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDarkActive,
),
),
],
),
),
),
),
Obx(() {
final screenHeight = MediaQuery.of(context).size.height;
final targetTop = (screenHeight - 676) / 2;
return AnimatedPositioned(
duration: const Duration(milliseconds: 1200),
curve: Curves.linear,
top: controller.showCard.value ? targetTop : screenHeight,
left: 10.r,
right: 10.r,
child: Container(
width: 381.w,
height: 676.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(40),
),
child: Column(
children: [
SizedBox(height: 50.h),
LogoWidget(
vecPath: Assets.vec.rasadToyorSvg.path,
width: 85.w,
height: 85.h,
titleStyle: AppFonts.yekan20Bold.copyWith(
color: Color(0xFF4665AF),
),
title: 'رصدطیور',
),
SizedBox(height: 20.h),
useAndPassFrom(),
SizedBox(height: 24.h),
RichText(
text: TextSpan(
children: [
TextSpan(
text: 'مطالعه بیانیه ',
style: AppFonts.yekan16.copyWith(
color: AppColor.darkGreyDark,
),
),
TextSpan(
recognizer: TapGestureRecognizer()
..onTap = () {
Get.bottomSheet(
privacyPolicyWidget(),
isScrollControlled: true,
enableDrag: true,
ignoreSafeArea: false,
);
},
text: 'حریم خصوصی',
style: AppFonts.yekan16.copyWith(
color: AppColor.blueNormal,
),
),
],
),
),
],
),
),
);
}),
],
),
);
}
Widget useAndPassFrom() {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 30.r),
child: Form(
key: controller.formKey,
child: AutofillGroup(
child: Column(
children: [
RTextField(
height: 40.h,
label: 'نام کاربری',
maxLength: 11,
maxLines: 1,
controller: controller.usernameController.value,
keyboardType: TextInputType.number,
inputFormatters: [PersianFormatter()],
initText: controller.usernameController.value.text,
autofillHints: [AutofillHints.username],
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppColor.textColor, width: 1),
),
onChanged: (value) async {
controller.usernameController.value.text = value;
if (value.length == 11) {
await controller.getUserInfo(value);
}
},
prefixIcon: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
child: Assets.vec.callSvg.svg(width: 12, height: 12),
),
suffixIcon:
controller.usernameController.value.text.trim().isNotEmpty
? clearButton(() {
controller.usernameController.value.clear();
controller.usernameController.refresh();
})
: null,
validator: (value) {
if (value == null || value.isEmpty) {
return '⚠️ شماره موبایل را وارد کنید';
} else if (value.length < 10) {
return '⚠️ شماره موبایل باید 11 رقم باشد';
}
return null;
},
style: AppFonts.yekan13,
errorStyle: AppFonts.yekan13.copyWith(
color: AppColor.redNormal,
),
labelStyle: AppFonts.yekan13,
boxConstraints: const BoxConstraints(
maxHeight: 40,
minHeight: 40,
maxWidth: 40,
minWidth: 40,
),
),
const SizedBox(height: 26),
ObxValue(
(passwordController) => RTextField(
height: 40.h,
label: 'رمز عبور',
filled: false,
obscure: true,
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppColor.textColor, width: 1),
),
controller: passwordController.value,
autofillHints: [AutofillHints.password],
variant: RTextFieldVariant.password,
initText: passwordController.value.text,
inputFormatters: [PersianFormatter()],
onChanged: (value) {
passwordController.refresh();
},
validator: (value) {
if (value == null || value.isEmpty) {
return '⚠️ رمز عبور را وارد کنید';
}
return null;
},
style: AppFonts.yekan13,
errorStyle: AppFonts.yekan13.copyWith(
color: AppColor.redNormal,
),
labelStyle: AppFonts.yekan13,
prefixIcon: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
child: Assets.vec.keySvg.svg(width: 12, height: 12),
),
boxConstraints: const BoxConstraints(
maxHeight: 34,
minHeight: 34,
maxWidth: 34,
minWidth: 34,
),
),
controller.passwordController,
),
SizedBox(height: 26),
CaptchaWidget(),
GestureDetector(
onTap: () {
controller.rememberMe.value = !controller.rememberMe.value;
},
child: Row(
children: [
ObxValue((data) {
return Checkbox(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity(
horizontal: -4,
vertical: 4,
),
tristate: true,
value: data.value,
onChanged: (value) {
data.value = value ?? false;
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
activeColor: AppColor.blueNormal,
);
}, controller.rememberMe),
Text(
'مرا به خاطر بسپار',
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDark,
),
),
],
),
),
Obx(() {
return RElevated(
text: 'ورود',
isLoading: controller.isLoading.value,
onPressed: controller.isDisabled.value
? null
: () async {
await controller.submitLoginForm();
},
width: Get.width,
height: 48,
);
}),
],
),
),
),
);
}
Widget privacyPolicyWidget() {
return BaseBottomSheet(
child: Column(
spacing: 5,
children: [
Container(
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(
spacing: 3,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'بيانيه حريم خصوصی',
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب می‌شود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران می‌شود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیت‌های جاری می‌گردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت می‌گردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت می‌کند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.',
style: AppFonts.yekan14.copyWith(
color: AppColor.bgDark,
height: 1.8,
),
),
],
),
),
Container(
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'چگونگی جمع آوری و استفاده از اطلاعات کاربران',
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار می‌دهيد، شامل موارد زيرهستند:
اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد.
ب: برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير می‌باشد:
⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده می‌نمایید( تلفن همراه، تبلت، رایانه).
⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما.
⦁ اطلاعات صفحات بازدید شده.
⦁ تعداد بازدیدهای روزانه در درگاه.
⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم.
''',
style: AppFonts.yekan14.copyWith(
color: AppColor.bgDark,
height: 1.8,
),
),
],
),
),
Container(
padding: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'امنیت اطلاعات',
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوه‌‌های لازم استفاده می‌کنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری می‌کنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینک‌ها از سامانه ما خارج می‌شوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.',
style: AppFonts.yekan14.copyWith(
color: AppColor.bgDark,
height: 1.8,
),
),
],
),
),
],
),
);
}
}

View File

@@ -1,257 +0,0 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
import 'package:rasadyar_chicken/features/common/data/repositories/common/common_repository.dart';
import 'package:rasadyar_core/core.dart';
class ProfileLogic extends GetxController {
CommonRepository commonRepository = diChicken.get<CommonRepository>();
GService gService = Get.find<GService>();
TokenStorageService tokenService = Get.find<TokenStorageService>();
RxInt selectedInformationType = 0.obs;
Rxn<Jalali> birthDate = Rxn<Jalali>();
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(
Resource.loading(),
);
Rx<Resource<UserLocalModel>> userLocal = Rx<Resource<UserLocalModel>>(
Resource.loading(),
);
TextEditingController nameController = TextEditingController();
TextEditingController lastNameController = TextEditingController();
TextEditingController nationalCodeController = TextEditingController();
TextEditingController nationalIdController = TextEditingController();
TextEditingController birthdayController = TextEditingController();
TextEditingController oldPasswordController = TextEditingController();
TextEditingController newPasswordController = TextEditingController();
TextEditingController retryNewPasswordController = TextEditingController();
RxList<IranProvinceCityModel> cites = <IranProvinceCityModel>[].obs;
Rxn<IranProvinceCityModel> selectedProvince = Rxn();
Rxn<IranProvinceCityModel> selectedCity = Rxn();
GlobalKey<FormState> formKey = GlobalKey();
ImagePicker imagePicker = ImagePicker();
Rxn<XFile> selectedImage = Rxn<XFile>();
final RxnString _base64Image = RxnString();
RxBool isOnLoading = false.obs;
RxBool isUserInformationOpen = true.obs;
RxBool isUnitInformationOpen = false.obs;
ScrollController scrollController = ScrollController();
@override
void onInit() {
super.onInit();
ever(selectedImage, (data) async {
if (data?.path != null) {
_base64Image.value = await convertImageToBase64(data!.path);
}
});
}
@override
void onReady() {
super.onReady();
getUserProfile();
getUserRole();
selectedProvince.listen((p0) => getCites());
userProfile.listen((data) {
nameController.text = data.data?.firstName ?? '';
lastNameController.text = data.data?.lastName ?? '';
nationalCodeController.text = data.data?.nationalCode ?? '';
nationalIdController.text = data.data?.nationalId ?? '';
birthdayController.text =
data.data?.birthday?.toJalali.formatCompactDate() ?? '';
birthDate.value = data.data?.birthday?.toJalali;
selectedProvince.value = IranProvinceCityModel(
name: data.data?.province ?? '',
id: data.data?.provinceNumber ?? 0,
);
selectedCity.value = IranProvinceCityModel(
name: data.data?.city ?? '',
id: data.data?.cityNumber ?? 0,
);
});
}
Future<void> getUserProfile() async {
userProfile.value = Resource.loading();
await safeCall<UserProfile?>(
call: () async => await commonRepository.getUserProfile(
token: tokenService.accessToken.value!,
),
onSuccess: (result) {
if (result != null) {
userProfile.value = Resource.success(result);
}
},
onError: (error, stackTrace) {},
);
}
Future<void> getCites() async {
await safeCall(
call: () => commonRepository.getCity(
provinceName: selectedProvince.value?.name ?? '',
),
onSuccess: (result) {
if (result != null && result.isNotEmpty) {
cites.value = result;
}
},
);
}
Future<void> updateUserProfile() async {
UserProfile userProfile = UserProfile(
firstName: nameController.text,
lastName: lastNameController.text,
nationalCode: nationalCodeController.text,
nationalId: nationalIdController.text,
birthday: birthDate.value
?.toDateTime()
.formattedDashedGregorian
.toString(),
image: _base64Image.value,
personType: 'self',
type: 'self_profile',
);
isOnLoading.value = true;
await safeCall(
call: () async => await commonRepository.updateUserProfile(
token: tokenService.accessToken.value!,
userProfile: userProfile,
),
onSuccess: (result) {
isOnLoading.value = false;
},
onError: (error, stackTrace) {
isOnLoading.value = false;
},
);
}
Future<void> updatePassword() async {
if (formKey.currentState?.validate() ?? false) {
ChangePasswordRequestModel model = ChangePasswordRequestModel(
username: userProfile.value.data?.mobile,
password: newPasswordController.text,
);
await safeCall(
call: () async => await commonRepository.updatePassword(
token: tokenService.accessToken.value!,
model: model,
),
);
}
}
Future<void> getUserRole() async {
userLocal.value = Resource.loading();
await safeCall<UserLocalModel?>(
call: () async => tokenService.getUserLocal(Module.chicken),
onSuccess: (result) {
if (result != null) {
userLocal.value = Resource.success(result);
}
},
onError: (error, stackTrace) {},
);
}
void clearPasswordForm() {
oldPasswordController.clear();
newPasswordController.clear();
retryNewPasswordController.clear();
}
Future<void> changeUserRole(String newRole) async {
dLog(newRole);
await gService.saveRoute(Module.chicken, newRole);
Get.offAllNamed(newRole);
}
void scrollToSelectedItem(
int index, {
double chipWidth = 100,
double spacing = 8,
GlobalKey? itemKey,
}) {
if (!scrollController.hasClients) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_performScroll(index, chipWidth, spacing, itemKey);
});
} else {
_performScroll(index, chipWidth, spacing, itemKey);
}
}
void _performScroll(
int index,
double chipWidth,
double spacing,
GlobalKey? itemKey,
) {
if (!scrollController.hasClients) return;
double targetOffset;
// If we have a GlobalKey, use it for precise positioning
if (itemKey?.currentContext != null) {
final RenderBox? renderBox =
itemKey!.currentContext?.findRenderObject() as RenderBox?;
if (renderBox != null) {
final position = renderBox.localToGlobal(Offset.zero);
final scrollPosition = scrollController.position;
final viewportWidth = scrollPosition.viewportDimension;
final chipWidth = renderBox.size.width;
// Get the scroll position of the item
final itemScrollPosition = position.dx - scrollPosition.pixels;
// Center the item
targetOffset =
scrollPosition.pixels +
itemScrollPosition -
(viewportWidth / 2) +
(chipWidth / 2);
} else {
// Fallback to estimated position
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
}
} else {
// Use estimated position
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
}
scrollController.animateTo(
targetOffset.clamp(0.0, scrollController.position.maxScrollExtent),
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
double _calculateEstimatedPosition(
int index,
double chipWidth,
double spacing,
) {
final double itemPosition = (chipWidth + spacing) * index;
final double viewportWidth = scrollController.position.viewportDimension;
return itemPosition - (viewportWidth / 2) + (chipWidth / 2);
}
@override
void onClose() {
scrollController.dispose();
super.onClose();
}
}

View File

@@ -1,902 +0,0 @@
import 'dart:io';
import 'package:flutter/cupertino.dart' hide Image;
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class ProfilePage extends GetView<ProfileLogic> {
const ProfilePage({super.key});
@override
Widget build(BuildContext context) {
return Column(
spacing: 30,
children: [
Expanded(
child: Container(
color: AppColor.blueNormal,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(),
ObxValue((data) {
final status = data.value.status;
if (status == ResourceStatus.loading) {
return Container(
width: 128.w,
height: 128.h,
child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)),
);
}
if (status == ResourceStatus.error) {
return Container(
width: 128.w,
height: 128.h,
child: Center(child: Text('خطا در دریافت اطلاعات')),
);
}
// Default UI
return Container(
width: 128.w,
height: 128.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColor.blueLightActive,
),
child: Center(
child: data.value.data?.image != null
? CircleAvatar(
radius: 64.w,
backgroundImage: NetworkImage(data.value.data!.image!),
)
: Icon(Icons.person, size: 64.w),
),
);
}, controller.userProfile),
],
),
),
),
Expanded(
flex: 3,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
rolesWidget(),
SizedBox(height: 12.h),
ObxValue((data) {
if (data.value.status == ResourceStatus.loading) {
return LoadingWidget();
} else if (data.value.status == ResourceStatus.error) {
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
} else if (data.value.status == ResourceStatus.success) {
return Column(
spacing: 6,
children: [
ObxValue((isOpen) {
return GestureDetector(
onTap: () => isOpen.toggle(),
child: AnimatedContainer(
height: isOpen.value ? 320.h : 47.h,
duration: Duration(milliseconds: 500),
curve: Curves.linear,
child: userProfileInformation(data.value),
),
);
}, controller.isUserInformationOpen),
Visibility(
visible:
data.value.data?.unitName != null ||
data.value.data?.unitAddress != null ||
data.value.data?.unitPostalCode != null ||
data.value.data?.unitRegistrationNumber != null ||
data.value.data?.unitEconomicalNumber != null ||
data.value.data?.unitCity != null ||
data.value.data?.unitProvince != null ||
data.value.data?.unitNationalId != null,
child: ObxValue((isOpen) {
return GestureDetector(
onTap: () => isOpen.toggle(),
child: AnimatedContainer(
height: isOpen.value ? 320.h : 47.h,
duration: Duration(milliseconds: 500),
curve: Curves.linear,
child: unitInformation(data.value),
),
);
}, controller.isUnitInformationOpen),
),
],
);
} else {
return SizedBox.shrink();
}
}, controller.userProfile),
GestureDetector(
onTap: () {
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
},
child: Container(
height: 47.h,
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8.h),
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
),
child: Row(
spacing: 6,
children: [
Assets.vec.lockSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
Text(
'تغییر رمز عبور',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
),
],
),
),
),
GestureDetector(
onTap: () {
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
},
child: Container(
height: 47.h,
margin: EdgeInsets.symmetric(horizontal: 8),
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
),
child: Row(
spacing: 6,
children: [
Assets.vec.logoutSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.redNormal, BlendMode.srcIn),
),
Text(
'خروج',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(color: AppColor.redNormal),
),
],
),
),
),
SizedBox(height: 100),
],
),
),
),
],
);
}
Container invoiceIssuanceInformation() => Container();
Widget bankInformationWidget() => Column(
spacing: 16,
children: [
itemList(title: 'نام بانک', content: 'سامان'),
itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'),
itemList(title: 'شماره کارت ', content: '54154545415'),
itemList(title: 'شماره حساب', content: '62565263263652'),
itemList(title: 'شماره شبا', content: '62565263263652'),
],
);
Widget userProfileInformation(Resource<UserProfile> value) {
UserProfile item = value.data!;
return Stack(
clipBehavior: Clip.none,
children: [
Positioned.fill(
child: ObxValue(
(val) => Container(
height: val.value ? 320.h : 47.h,
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 8 : 0),
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
),
child: val.value
? Column(
spacing: 6,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Get.bottomSheet(
userInformationBottomSheet(),
isScrollControlled: true,
ignoreSafeArea: false,
);
},
child: Assets.vec.editSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
child: Column(
children: [
itemList(
title: 'نام و نام خانوادگی',
content: item.fullname ?? 'نامشخص',
icon: Assets.vec.userSvg.path,
hasColoredBox: true,
),
itemList(
title: 'کدملی',
content: item.nationalId ?? 'نامشخص',
icon: Assets.vec.tagUserSvg.path,
),
itemList(
title: 'موبایل',
content: item.mobile ?? 'نامشخص',
icon: Assets.vec.callSvg.path,
),
itemList(
title: 'شماره شناسنامه',
content: item.nationalCode ?? 'نامشخص',
icon: Assets.vec.userSquareSvg.path,
),
itemList(
title: 'تاریخ تولد',
content: item.birthday?.toJalali.formatCompactDate() ?? 'نامشخص',
icon: Assets.vec.calendarSvg.path,
),
//todo
itemList(
title: 'استان',
content: item.province ?? 'نامشخص',
icon: Assets.vec.pictureFrameSvg.path,
),
itemList(
title: 'شهر',
content: item.city ?? 'نامشخص',
icon: Assets.vec.mapSvg.path,
),
],
),
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
),
),
controller.isUserInformationOpen,
),
),
ObxValue(
(isOpen) => AnimatedPositioned(
right: 16,
top: isOpen.value ? -7 : 11,
duration: Duration(milliseconds: 500),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: isOpen.value
? BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
)
: null,
child: Text(
'اطلاعات هویتی',
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
),
),
),
controller.isUserInformationOpen,
),
],
);
}
Widget unitInformation(Resource<UserProfile> value) {
UserProfile item = value.data!;
return Stack(
clipBehavior: Clip.none,
children: [
Positioned.fill(
child: ObxValue(
(val) => Container(
height: val.value ? 320.h : 47.h,
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 12 : 0),
padding: EdgeInsets.symmetric(horizontal: 11.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
),
child: val.value
? Column(
children: [
SizedBox(height: 5.h),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Get.bottomSheet(
userInformationBottomSheet(),
isScrollControlled: true,
ignoreSafeArea: false,
);
},
child: Assets.vec.editSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
child: Column(
spacing: 2,
children: [
itemList(
title: 'نام صنفی',
content: item.unitName ?? 'نامشخص',
hasColoredBox: true,
visible: item.unitName != null,
),
itemList(
title: 'شناسنامه ملی',
content: item.unitNationalId ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(
title: 'شماره ثبت',
content: item.unitRegistrationNumber ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(
title: 'کد اقتصادی',
content: item.unitEconomicalNumber ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(
title: 'کد پستی',
content: item.unitPostalCode ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(
title: 'استان',
content: item.province ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(
title: 'شهر',
content: item.city ?? 'نامشخص',
visible: item.unitName != null,
),
itemList(title: 'آدرس', content: item.unitAddress ?? 'نامشخص'),
],
),
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
),
),
controller.isUnitInformationOpen,
),
),
ObxValue(
(isOpen) => AnimatedPositioned(
right: 16,
top: isOpen.value ? -2 : 11,
duration: Duration(milliseconds: 500),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: isOpen.value
? BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
)
: null,
child: Text(
'اطلاعات صنفی',
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
),
),
),
controller.isUnitInformationOpen,
),
],
);
}
Widget itemList({
required String title,
required String content,
String? icon,
bool hasColoredBox = false,
bool? visible,
}) => Visibility(
visible: visible ?? true,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h),
decoration: BoxDecoration(
color: hasColoredBox ? AppColor.greenLight : Colors.transparent,
borderRadius: BorderRadius.circular(8),
border: hasColoredBox
? Border.all(width: 0.25, color: AppColor.bgDark)
: Border.all(width: 0, color: Colors.transparent),
),
child: Row(
spacing: 4,
children: [
if (icon != null)
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: SvgGenImage.vec(icon).svg(
width: 20.w,
height: 20.h,
colorFilter: ColorFilter.mode(AppColor.textColor, BlendMode.srcIn),
),
),
Text(title, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
Spacer(),
Text(content, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
],
),
),
);
Widget cardActionWidget({
required String title,
required VoidCallback onPressed,
required String icon,
bool selected = false,
ColorFilter? color,
Color? cardColor,
Color? cardIconColor,
Color? textColor,
}) {
return GestureDetector(
onTap: onPressed,
child: Column(
spacing: 4,
children: [
Container(
width: 52.w,
height: 52.h,
padding: EdgeInsets.all(6),
decoration: ShapeDecoration(
color: cardColor ?? AppColor.blueLight,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: cardIconColor,
borderRadius: BorderRadius.circular(8),
),
child: SvgGenImage.vec(icon).svg(
width: 40.w,
height: 40.h,
colorFilter: color ?? ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
),
),
SizedBox(height: 2),
Text(
title,
style: AppFonts.yekan10.copyWith(color: AppColor.textColor),
textAlign: TextAlign.center,
),
],
),
);
}
Widget userInformationBottomSheet() {
return BaseBottomSheet(
height: 750.h,
child: SingleChildScrollView(
child: Column(
spacing: 8,
children: [
Text(
'ویرایش اطلاعات هویتی',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
),
Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(
spacing: 12,
children: [
RTextField(
controller: controller.nameController,
label: 'نام',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
),
RTextField(
controller: controller.lastNameController,
label: 'نام خانوادگی',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
),
RTextField(
controller: controller.nationalCodeController,
label: 'شماره شناسنامه',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
),
RTextField(
controller: controller.nationalIdController,
label: 'کد ملی',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
),
ObxValue((data) {
return RTextField(
controller: controller.birthdayController,
label: 'تاریخ تولد',
initText: data.value?.formatCompactDate() ?? '',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
onTap: () {},
);
}, controller.birthDate),
SizedBox(),
],
),
),
SizedBox(),
Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.darkGreyLight, width: 1),
),
child: Column(
spacing: 8,
children: [
Text(
'عکس پروفایل',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
),
ObxValue((data) {
return Container(
width: Get.width,
height: 270,
decoration: BoxDecoration(
color: AppColor.lightGreyNormal,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.blackLight),
),
child: Center(
child: data.value == null
? Padding(
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
child: Image.network(
controller.userProfile.value.data?.image ?? '',
),
)
: Image.file(File(data.value!.path), fit: BoxFit.cover),
),
);
}, controller.selectedImage),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RElevated(
text: 'گالری',
width: 150.w,
height: 40.h,
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
onPressed: () async {
controller.selectedImage.value = await controller.imagePicker.pickImage(
source: ImageSource.gallery,
imageQuality: 60,
maxWidth: 1080,
maxHeight: 720,
);
},
),
SizedBox(width: 16),
ROutlinedElevated(
text: 'دوربین',
width: 150.w,
height: 40.h,
textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal),
onPressed: () async {
controller.selectedImage.value = await controller.imagePicker.pickImage(
source: ImageSource.camera,
imageQuality: 60,
maxWidth: 1080,
maxHeight: 720,
);
},
),
],
),
],
),
),
Row(
spacing: 16,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ObxValue((data) {
return RElevated(
height: 40.h,
text: 'ویرایش',
isLoading: data.value,
onPressed: () async {
await controller.updateUserProfile();
controller.getUserProfile();
Get.back();
},
);
}, controller.isOnLoading),
ROutlinedElevated(
height: 40.h,
text: 'انصراف',
borderColor: AppColor.blueNormal,
onPressed: () {
Get.back();
},
),
],
),
],
),
),
);
}
Widget changePasswordBottomSheet() {
return BaseBottomSheet(
height: 400.h,
child: SingleChildScrollView(
child: Form(
key: controller.formKey,
child: Column(
spacing: 8,
children: [
Text(
'تغییر رمز عبور',
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
),
SizedBox(),
RTextField(
controller: controller.oldPasswordController,
hintText: 'رمز عبور قبلی',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
validator: (value) {
if (value == null || value.isEmpty) {
return 'رمز عبور را وارد کنید';
} else if (controller.userProfile.value.data?.password != value) {
return 'رمز عبور صحیح نیست';
}
return null;
},
),
RTextField(
controller: controller.newPasswordController,
hintText: 'رمز عبور جدید',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
validator: (value) {
if (value == null || value.isEmpty) {
return 'رمز عبور را وارد کنید';
} else if (value.length < 6) {
return 'رمز عبور باید بیش از 6 کارکتر باشد.';
}
return null;
},
),
RTextField(
controller: controller.retryNewPasswordController,
hintText: 'تکرار رمز عبور جدید',
borderColor: AppColor.darkGreyLight,
filledColor: AppColor.bgLight,
filled: true,
validator: (value) {
if (value == null || value.isEmpty) {
return 'رمز عبور را وارد کنید';
} else if (value.length < 6) {
return 'رمز عبور باید بیش از 6 کارکتر باشد.';
} else if (controller.newPasswordController.text != value) {
return 'رمز عبور جدید یکسان نیست';
}
return null;
},
),
SizedBox(),
Row(
spacing: 16,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RElevated(
height: 40.h,
text: 'ویرایش',
onPressed: () async {
if (controller.formKey.currentState?.validate() != true) {
return;
}
await controller.updatePassword();
controller.getUserProfile();
controller.clearPasswordForm();
Get.back();
},
),
ROutlinedElevated(
height: 40.h,
text: 'انصراف',
borderColor: AppColor.blueNormal,
onPressed: () {
Get.back();
},
),
],
),
],
),
),
),
);
}
Widget exitBottomSheet() {
return BaseBottomSheet(
height: 220.h,
child: SingleChildScrollView(
child: Form(
key: controller.formKey,
child: Column(
spacing: 8,
children: [
Text('خروج', style: AppFonts.yekan16Bold.copyWith(color: AppColor.error)),
SizedBox(),
Text(
'آیا مطمئن هستید که می‌خواهید از حساب کاربری خود خارج شوید؟',
textAlign: TextAlign.center,
style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor),
),
SizedBox(),
Row(
spacing: 16,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RElevated(
height: 40.h,
text: 'خروج',
backgroundColor: AppColor.error,
onPressed: () async {
await Future.wait([
controller.tokenService.deleteModuleTokens(Module.chicken),
controller.gService.clearSelectedModule(),
]).then((value) async {
await removeChickenDI();
Get.offAllNamed("/moduleList");
});
},
),
ROutlinedElevated(
height: 40.h,
text: 'انصراف',
borderColor: AppColor.blueNormal,
onPressed: () {
Get.back();
},
),
],
),
],
),
),
),
);
}
Widget rolesWidget() {
return ObxValue((data) {
if (data.value.status == ResourceStatus.loading) {
return CupertinoActivityIndicator();
} else if (data.value.status == ResourceStatus.error) {
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
} else if (data.value.status == ResourceStatus.success) {
List<String>? item = data.value.data?.roles;
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(horizontal: 8.w),
physics: BouncingScrollPhysics(),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 8.w,
children: List.generate(item?.length ?? 0, (index) {
Map tmpRole = getFaUserRoleWithOnTap(item?[index]);
return CustomChip(
isSelected: controller.gService.getRoute(Module.chicken) == tmpRole.values.first,
title: tmpRole.keys.first,
index: index,
onTap: (int p1) {
controller.changeUserRole(tmpRole.values.first);
},
);
}),
),
);
} else {
return SizedBox.shrink();
}
}, controller.userLocal);
}
}

View File

@@ -1,18 +0,0 @@
import 'package:rasadyar_core/core.dart';
class RoleLogic extends GetxController {
TokenStorageService tokenService = Get.find<TokenStorageService>();
GService gService = Get.find<GService>();
RxList<String> roles = <String>[].obs;
@override
void onInit() {
super.onInit();
List<String> items = tokenService.getUserLocal(Module.chicken)!.roles ?? [];
if (items.isNotEmpty) {
roles.assignAll(items);
}
}
}

View File

@@ -1,79 +0,0 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class RolePage extends GetView<RoleLogic> {
const RolePage({super.key});
@override
Widget build(BuildContext context) {
return ChickenBasePage(
isBase: true,
child: Column(
children: [
Assets.images.selectRole.image(height: 212.h, width: Get.width.w, fit: BoxFit.cover),
ObxValue((data) {
return Expanded(
child: GridView.builder(
physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 12.h,
crossAxisSpacing: 12.w,
childAspectRatio: 2,
),
itemCount: data.length,
hitTestBehavior: HitTestBehavior.opaque,
itemBuilder: (BuildContext context, int index) {
Map role = getFaUserRoleWithOnTap(data[index]);
return roleCard(
title: role.keys.first,
onTap: () async {
try {
String route = role.values.first;
await controller.gService.saveRoute(Module.chicken, route);
await controller.gService.saveRole(Module.chicken, data[index]);
Get.offAllNamed(route);
} catch (e) {
eLog(
"احتمالا در\n ``getFaUserRoleWithOnTap`` \nروت اش را تعریف نکردی 👻👻 ==>$e ",
);
}
},
);
},
),
);
}, controller.roles),
],
),
);
}
}
Widget roleCard({required String title, Function()? onTap, int? width, int? height}) {
return Container(
width: width?.w ?? 128.w,
height: height?.h ?? 48.h,
margin: EdgeInsets.all(8.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.r),
border: Border.all(color: AppColor.blueNormal, width: 1.w),
),
child: InkWell(
onTap: onTap,
child: Center(
child: Text(
title,
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
textAlign: TextAlign.center,
),
),
),
);
}

View File

@@ -0,0 +1,51 @@
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_core/core.dart';
abstract class KillHouseRemoteDataSource {
//region requestKill
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> submitKillHouseRequest({
required String token,
required Map<String, dynamic> data,
});
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> deleteKillRequest({
required String token,
required int requestId,
});
//endregion
//region warehouseAndDistribution
Future<KillHouseSalesInfoDashboard?> getInfoDashboard({
required String token,
CancelToken? cancelToken,
Map<String, dynamic>? queryParameters,
});
Future<PaginationModel<KillHouseBarsResponse>?> getBarsForKillHouse({
required String token,
Map<String, dynamic>? queryParameters,
});
//endregion
}

View File

@@ -0,0 +1,133 @@
import 'package:rasadyar_chicken/features/kill_house/data/data_source/remote/kill_house/kill_house_remote.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_core/core.dart';
class KillHouseRemoteDataSourceImpl extends KillHouseRemoteDataSource {
final DioRemote _httpClient;
KillHouseRemoteDataSourceImpl(this._httpClient);
@override
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/chicken-commission-prices/',
headers: {'Authorization': 'Bearer $token'},
fromJson: (json) {
var data = json['results'] as List<dynamic>;
return ChickenCommissionPrices.fromJson(
data.first as Map<String, dynamic>,
);
},
);
return res.data;
}
@override
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/kill_house/?kill_house',
headers: {'Authorization': 'Bearer $token'},
fromJsonList: (json) => json
.map((e) => KillHouseResponse.fromJson(e as Map<String, dynamic>))
.toList(),
);
return res.data;
}
@override
Future<void> submitKillHouseRequest({
required String token,
required Map<String, dynamic> data,
}) async {
await _httpClient.post(
'/kill_request/',
headers: {'Authorization': 'Bearer $token'},
data: data,
);
}
@override
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/kill_request/',
headers: {'Authorization': 'Bearer $token'},
queryParameters: queryParameters,
fromJsonList: (json) => json
.map(
(e) =>
listModel.KillRequestList.fromJson(e as Map<String, dynamic>),
)
.toList(),
);
return res.data;
}
@override
Future<void> deleteKillRequest({
required String token,
required int requestId,
}) async {
await _httpClient.delete(
'/kill_request/$requestId/',
headers: {'Authorization': 'Bearer $token'},
);
}
//endregion
//region warehouseAndDistribution
@override
Future<KillHouseSalesInfoDashboard?> getInfoDashboard({
required String token,
CancelToken? cancelToken,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/kill-house-sales-info-dashboard/?role=KillHouse',
cancelToken: cancelToken,
headers: {'Authorization': 'Bearer $token'},
queryParameters: queryParameters,
fromJson: KillHouseSalesInfoDashboard.fromJson,
);
return res.data;
}
@override
Future<PaginationModel<KillHouseBarsResponse>?> getBarsForKillHouse({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
var res = await _httpClient.get(
'/bars_for_kill_house/',
headers: {'Authorization': 'Bearer $token'},
queryParameters: queryParameters,
fromJson: (json) => PaginationModel<KillHouseBarsResponse>.fromJson(
json,
(json) => KillHouseBarsResponse.fromJson(json as Map<String, dynamic>),
),
);
return res.data;
}
//endregion
}

View File

@@ -0,0 +1,26 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_request_response.freezed.dart';
part 'kill_request_response.g.dart';
@freezed
abstract class KillRequestResponse with _$KillRequestResponse {
const factory KillRequestResponse({
int? killCapacity,
String? reciveTime,
String? reciveDate,
bool? lowWeight,
bool? highWeight,
@JsonKey(name: "Index_weight") double? indexWeight,
String? chickenBreed,
bool? cash,
bool? credit,
bool? smsPayment,
String? killHouseKey,
String? killerKillHouseKey,
String? role,
}) = _KillRequestResponse;
factory KillRequestResponse.fromJson(Map<String, dynamic> json) =>
_$KillRequestResponseFromJson(json);
}

View File

@@ -0,0 +1,313 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_request_response.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillRequestResponse {
int? get killCapacity; String? get reciveTime; String? get reciveDate; bool? get lowWeight; bool? get highWeight;@JsonKey(name: "Index_weight") double? get indexWeight; String? get chickenBreed; bool? get cash; bool? get credit; bool? get smsPayment; String? get killHouseKey; String? get killerKillHouseKey; String? get role;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillRequestResponseCopyWith<KillRequestResponse> get copyWith => _$KillRequestResponseCopyWithImpl<KillRequestResponse>(this as KillRequestResponse, _$identity);
/// Serializes this KillRequestResponse to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role);
@override
String toString() {
return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)';
}
}
/// @nodoc
abstract mixin class $KillRequestResponseCopyWith<$Res> {
factory $KillRequestResponseCopyWith(KillRequestResponse value, $Res Function(KillRequestResponse) _then) = _$KillRequestResponseCopyWithImpl;
@useResult
$Res call({
int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role
});
}
/// @nodoc
class _$KillRequestResponseCopyWithImpl<$Res>
implements $KillRequestResponseCopyWith<$Res> {
_$KillRequestResponseCopyWithImpl(this._self, this._then);
final KillRequestResponse _self;
final $Res Function(KillRequestResponse) _then;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) {
return _then(_self.copyWith(
killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable
as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable
as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable
as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable
as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable
as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable
as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable
as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable
as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable
as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable
as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable
as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [KillRequestResponse].
extension KillRequestResponsePatterns on KillRequestResponse {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillRequestResponse value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillRequestResponse value) $default,){
final _that = this;
switch (_that) {
case _KillRequestResponse():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillRequestResponse value)? $default,){
final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role) $default,) {final _that = this;
switch (_that) {
case _KillRequestResponse():
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,) {final _that = this;
switch (_that) {
case _KillRequestResponse() when $default != null:
return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _KillRequestResponse implements KillRequestResponse {
const _KillRequestResponse({this.killCapacity, this.reciveTime, this.reciveDate, this.lowWeight, this.highWeight, @JsonKey(name: "Index_weight") this.indexWeight, this.chickenBreed, this.cash, this.credit, this.smsPayment, this.killHouseKey, this.killerKillHouseKey, this.role});
factory _KillRequestResponse.fromJson(Map<String, dynamic> json) => _$KillRequestResponseFromJson(json);
@override final int? killCapacity;
@override final String? reciveTime;
@override final String? reciveDate;
@override final bool? lowWeight;
@override final bool? highWeight;
@override@JsonKey(name: "Index_weight") final double? indexWeight;
@override final String? chickenBreed;
@override final bool? cash;
@override final bool? credit;
@override final bool? smsPayment;
@override final String? killHouseKey;
@override final String? killerKillHouseKey;
@override final String? role;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillRequestResponseCopyWith<_KillRequestResponse> get copyWith => __$KillRequestResponseCopyWithImpl<_KillRequestResponse>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillRequestResponseToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role);
@override
String toString() {
return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)';
}
}
/// @nodoc
abstract mixin class _$KillRequestResponseCopyWith<$Res> implements $KillRequestResponseCopyWith<$Res> {
factory _$KillRequestResponseCopyWith(_KillRequestResponse value, $Res Function(_KillRequestResponse) _then) = __$KillRequestResponseCopyWithImpl;
@override @useResult
$Res call({
int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role
});
}
/// @nodoc
class __$KillRequestResponseCopyWithImpl<$Res>
implements _$KillRequestResponseCopyWith<$Res> {
__$KillRequestResponseCopyWithImpl(this._self, this._then);
final _KillRequestResponse _self;
final $Res Function(_KillRequestResponse) _then;
/// Create a copy of KillRequestResponse
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) {
return _then(_KillRequestResponse(
killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable
as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable
as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable
as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable
as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable
as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable
as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable
as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable
as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable
as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable
as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable
as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,42 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_request_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillRequestResponse _$KillRequestResponseFromJson(Map<String, dynamic> json) =>
_KillRequestResponse(
killCapacity: (json['kill_capacity'] as num?)?.toInt(),
reciveTime: json['recive_time'] as String?,
reciveDate: json['recive_date'] as String?,
lowWeight: json['low_weight'] as bool?,
highWeight: json['high_weight'] as bool?,
indexWeight: (json['Index_weight'] as num?)?.toDouble(),
chickenBreed: json['chicken_breed'] as String?,
cash: json['cash'] as bool?,
credit: json['credit'] as bool?,
smsPayment: json['sms_payment'] as bool?,
killHouseKey: json['kill_house_key'] as String?,
killerKillHouseKey: json['killer_kill_house_key'] as String?,
role: json['role'] as String?,
);
Map<String, dynamic> _$KillRequestResponseToJson(
_KillRequestResponse instance,
) => <String, dynamic>{
'kill_capacity': instance.killCapacity,
'recive_time': instance.reciveTime,
'recive_date': instance.reciveDate,
'low_weight': instance.lowWeight,
'high_weight': instance.highWeight,
'Index_weight': instance.indexWeight,
'chicken_breed': instance.chickenBreed,
'cash': instance.cash,
'credit': instance.credit,
'sms_payment': instance.smsPayment,
'kill_house_key': instance.killHouseKey,
'killer_kill_house_key': instance.killerKillHouseKey,
'role': instance.role,
};

View File

@@ -0,0 +1,12 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'chicken_commission_prices.freezed.dart';
part 'chicken_commission_prices.g.dart';
@freezed
abstract class ChickenCommissionPrices with _$ChickenCommissionPrices {
const factory ChickenCommissionPrices({double? chickenAveragePrice}) = _ChickenCommissionPrices;
factory ChickenCommissionPrices.fromJson(Map<String, dynamic> json) =>
_$ChickenCommissionPricesFromJson(json);
}

View File

@@ -0,0 +1,277 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'chicken_commission_prices.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ChickenCommissionPrices {
double? get chickenAveragePrice;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ChickenCommissionPricesCopyWith<ChickenCommissionPrices> get copyWith => _$ChickenCommissionPricesCopyWithImpl<ChickenCommissionPrices>(this as ChickenCommissionPrices, _$identity);
/// Serializes this ChickenCommissionPrices to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,chickenAveragePrice);
@override
String toString() {
return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)';
}
}
/// @nodoc
abstract mixin class $ChickenCommissionPricesCopyWith<$Res> {
factory $ChickenCommissionPricesCopyWith(ChickenCommissionPrices value, $Res Function(ChickenCommissionPrices) _then) = _$ChickenCommissionPricesCopyWithImpl;
@useResult
$Res call({
double? chickenAveragePrice
});
}
/// @nodoc
class _$ChickenCommissionPricesCopyWithImpl<$Res>
implements $ChickenCommissionPricesCopyWith<$Res> {
_$ChickenCommissionPricesCopyWithImpl(this._self, this._then);
final ChickenCommissionPrices _self;
final $Res Function(ChickenCommissionPrices) _then;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? chickenAveragePrice = freezed,}) {
return _then(_self.copyWith(
chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// Adds pattern-matching-related methods to [ChickenCommissionPrices].
extension ChickenCommissionPricesPatterns on ChickenCommissionPrices {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ChickenCommissionPrices value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ChickenCommissionPrices value) $default,){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ChickenCommissionPrices value)? $default,){
final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double? chickenAveragePrice)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that.chickenAveragePrice);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double? chickenAveragePrice) $default,) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices():
return $default(_that.chickenAveragePrice);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double? chickenAveragePrice)? $default,) {final _that = this;
switch (_that) {
case _ChickenCommissionPrices() when $default != null:
return $default(_that.chickenAveragePrice);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _ChickenCommissionPrices implements ChickenCommissionPrices {
const _ChickenCommissionPrices({this.chickenAveragePrice});
factory _ChickenCommissionPrices.fromJson(Map<String, dynamic> json) => _$ChickenCommissionPricesFromJson(json);
@override final double? chickenAveragePrice;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ChickenCommissionPricesCopyWith<_ChickenCommissionPrices> get copyWith => __$ChickenCommissionPricesCopyWithImpl<_ChickenCommissionPrices>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$ChickenCommissionPricesToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,chickenAveragePrice);
@override
String toString() {
return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)';
}
}
/// @nodoc
abstract mixin class _$ChickenCommissionPricesCopyWith<$Res> implements $ChickenCommissionPricesCopyWith<$Res> {
factory _$ChickenCommissionPricesCopyWith(_ChickenCommissionPrices value, $Res Function(_ChickenCommissionPrices) _then) = __$ChickenCommissionPricesCopyWithImpl;
@override @useResult
$Res call({
double? chickenAveragePrice
});
}
/// @nodoc
class __$ChickenCommissionPricesCopyWithImpl<$Res>
implements _$ChickenCommissionPricesCopyWith<$Res> {
__$ChickenCommissionPricesCopyWithImpl(this._self, this._then);
final _ChickenCommissionPrices _self;
final $Res Function(_ChickenCommissionPrices) _then;
/// Create a copy of ChickenCommissionPrices
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? chickenAveragePrice = freezed,}) {
return _then(_ChickenCommissionPrices(
chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on

View File

@@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'chicken_commission_prices.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_ChickenCommissionPrices _$ChickenCommissionPricesFromJson(
Map<String, dynamic> json,
) => _ChickenCommissionPrices(
chickenAveragePrice: (json['chicken_average_price'] as num?)?.toDouble(),
);
Map<String, dynamic> _$ChickenCommissionPricesToJson(
_ChickenCommissionPrices instance,
) => <String, dynamic>{'chicken_average_price': instance.chickenAveragePrice};

View File

@@ -0,0 +1,12 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_house_response.freezed.dart';
part 'kill_house_response.g.dart';
@freezed
abstract class KillHouseResponse with _$KillHouseResponse {
const factory KillHouseResponse({String? name, String? key}) = _KillHouseResponse;
factory KillHouseResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseResponseFromJson(json);
}

View File

@@ -0,0 +1,280 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_house_response.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillHouseResponse {
String? get name; String? get key;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillHouseResponseCopyWith<KillHouseResponse> get copyWith => _$KillHouseResponseCopyWithImpl<KillHouseResponse>(this as KillHouseResponse, _$identity);
/// Serializes this KillHouseResponse to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,key);
@override
String toString() {
return 'KillHouseResponse(name: $name, key: $key)';
}
}
/// @nodoc
abstract mixin class $KillHouseResponseCopyWith<$Res> {
factory $KillHouseResponseCopyWith(KillHouseResponse value, $Res Function(KillHouseResponse) _then) = _$KillHouseResponseCopyWithImpl;
@useResult
$Res call({
String? name, String? key
});
}
/// @nodoc
class _$KillHouseResponseCopyWithImpl<$Res>
implements $KillHouseResponseCopyWith<$Res> {
_$KillHouseResponseCopyWithImpl(this._self, this._then);
final KillHouseResponse _self;
final $Res Function(KillHouseResponse) _then;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? key = freezed,}) {
return _then(_self.copyWith(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [KillHouseResponse].
extension KillHouseResponsePatterns on KillHouseResponse {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillHouseResponse value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillHouseResponse value) $default,){
final _that = this;
switch (_that) {
case _KillHouseResponse():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillHouseResponse value)? $default,){
final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? name, String? key)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that.name,_that.key);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? name, String? key) $default,) {final _that = this;
switch (_that) {
case _KillHouseResponse():
return $default(_that.name,_that.key);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? name, String? key)? $default,) {final _that = this;
switch (_that) {
case _KillHouseResponse() when $default != null:
return $default(_that.name,_that.key);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _KillHouseResponse implements KillHouseResponse {
const _KillHouseResponse({this.name, this.key});
factory _KillHouseResponse.fromJson(Map<String, dynamic> json) => _$KillHouseResponseFromJson(json);
@override final String? name;
@override final String? key;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillHouseResponseCopyWith<_KillHouseResponse> get copyWith => __$KillHouseResponseCopyWithImpl<_KillHouseResponse>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillHouseResponseToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,name,key);
@override
String toString() {
return 'KillHouseResponse(name: $name, key: $key)';
}
}
/// @nodoc
abstract mixin class _$KillHouseResponseCopyWith<$Res> implements $KillHouseResponseCopyWith<$Res> {
factory _$KillHouseResponseCopyWith(_KillHouseResponse value, $Res Function(_KillHouseResponse) _then) = __$KillHouseResponseCopyWithImpl;
@override @useResult
$Res call({
String? name, String? key
});
}
/// @nodoc
class __$KillHouseResponseCopyWithImpl<$Res>
implements _$KillHouseResponseCopyWith<$Res> {
__$KillHouseResponseCopyWithImpl(this._self, this._then);
final _KillHouseResponse _self;
final $Res Function(_KillHouseResponse) _then;
/// Create a copy of KillHouseResponse
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? key = freezed,}) {
return _then(_KillHouseResponse(
name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_house_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillHouseResponse _$KillHouseResponseFromJson(Map<String, dynamic> json) =>
_KillHouseResponse(
name: json['name'] as String?,
key: json['key'] as String?,
);
Map<String, dynamic> _$KillHouseResponseToJson(_KillHouseResponse instance) =>
<String, dynamic>{'name': instance.name, 'key': instance.key};

View File

@@ -0,0 +1,125 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_request_list.freezed.dart';
part 'kill_request_list.g.dart';
@freezed
abstract class KillRequestList with _$KillRequestList {
const factory KillRequestList({
int? id,
KillHouseResponse? killHouse,
KillHouseVetResponse? killHouseVet,
int? numberOfAllocated,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? killCapacity,
int? previousKillCapacity,
int? remainQuantityForPoultry,
int? remainQuantity,
String? reciveTime,
String? reciveDate,
String? state,
String? provinceState,
BuyTypeResponse? buyType,
WeightTypeResponse? weightType,
String? chickenBreed,
double? indexWeight,
bool? smsPayment,
RegistrarResponse? registrar,
}) = _KillRequestList;
factory KillRequestList.fromJson(Map<String, dynamic> json) => _$KillRequestListFromJson(json);
}
///////////////////////////////////////////////////
/// SUB MODELS
///////////////////////////////////////////////////
@freezed
abstract class KillHouseResponse with _$KillHouseResponse {
const factory KillHouseResponse({
KillHouseOperator? killHouseOperator,
String? name,
bool? killer,
String? key,
}) = _KillHouseResponse;
factory KillHouseResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseResponseFromJson(json);
}
@freezed
abstract class KillHouseOperator with _$KillHouseOperator {
const factory KillHouseOperator({UserResponse? user}) = _KillHouseOperator;
factory KillHouseOperator.fromJson(Map<String, dynamic> json) =>
_$KillHouseOperatorFromJson(json);
}
@freezed
abstract class UserResponse with _$UserResponse {
const factory UserResponse({
String? fullname,
String? firstName,
String? lastName,
String? mobile,
String? key,
CityResponse? city,
}) = _UserResponse;
factory UserResponse.fromJson(Map<String, dynamic> json) => _$UserResponseFromJson(json);
}
@freezed
abstract class CityResponse with _$CityResponse {
const factory CityResponse({int? id, String? name, String? provinceName}) = _CityResponse;
factory CityResponse.fromJson(Map<String, dynamic> json) => _$CityResponseFromJson(json);
}
@freezed
abstract class KillHouseVetResponse with _$KillHouseVetResponse {
const factory KillHouseVetResponse({
int? id,
VetResponse? vet,
KillHouseResponse? killHouse,
String? key,
bool? trash,
}) = _KillHouseVetResponse;
factory KillHouseVetResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseVetResponseFromJson(json);
}
@freezed
abstract class VetResponse with _$VetResponse {
const factory VetResponse({UserResponse? user}) = _VetResponse;
factory VetResponse.fromJson(Map<String, dynamic> json) => _$VetResponseFromJson(json);
}
@freezed
abstract class BuyTypeResponse with _$BuyTypeResponse {
const factory BuyTypeResponse({bool? cash, bool? credit}) = _BuyTypeResponse;
factory BuyTypeResponse.fromJson(Map<String, dynamic> json) => _$BuyTypeResponseFromJson(json);
}
@freezed
abstract class WeightTypeResponse with _$WeightTypeResponse {
const factory WeightTypeResponse({bool? lowWeight, bool? highWeight}) = _WeightTypeResponse;
factory WeightTypeResponse.fromJson(Map<String, dynamic> json) =>
_$WeightTypeResponseFromJson(json);
}
@freezed
abstract class RegistrarResponse with _$RegistrarResponse {
const factory RegistrarResponse({String? date, String? role, String? fullName}) =
_RegistrarResponse;
factory RegistrarResponse.fromJson(Map<String, dynamic> json) =>
_$RegistrarResponseFromJson(json);
}

View File

@@ -0,0 +1,209 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_request_list.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillRequestList _$KillRequestListFromJson(
Map<String, dynamic> json,
) => _KillRequestList(
id: (json['id'] as num?)?.toInt(),
killHouse: json['kill_house'] == null
? null
: KillHouseResponse.fromJson(json['kill_house'] as Map<String, dynamic>),
killHouseVet: json['kill_house_vet'] == null
? null
: KillHouseVetResponse.fromJson(
json['kill_house_vet'] as Map<String, dynamic>,
),
numberOfAllocated: (json['number_of_allocated'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
killCapacity: (json['kill_capacity'] as num?)?.toInt(),
previousKillCapacity: (json['previous_kill_capacity'] as num?)?.toInt(),
remainQuantityForPoultry: (json['remain_quantity_for_poultry'] as num?)
?.toInt(),
remainQuantity: (json['remain_quantity'] as num?)?.toInt(),
reciveTime: json['recive_time'] as String?,
reciveDate: json['recive_date'] as String?,
state: json['state'] as String?,
provinceState: json['province_state'] as String?,
buyType: json['buy_type'] == null
? null
: BuyTypeResponse.fromJson(json['buy_type'] as Map<String, dynamic>),
weightType: json['weight_type'] == null
? null
: WeightTypeResponse.fromJson(
json['weight_type'] as Map<String, dynamic>,
),
chickenBreed: json['chicken_breed'] as String?,
indexWeight: (json['index_weight'] as num?)?.toDouble(),
smsPayment: json['sms_payment'] as bool?,
registrar: json['registrar'] == null
? null
: RegistrarResponse.fromJson(json['registrar'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillRequestListToJson(_KillRequestList instance) =>
<String, dynamic>{
'id': instance.id,
'kill_house': instance.killHouse,
'kill_house_vet': instance.killHouseVet,
'number_of_allocated': instance.numberOfAllocated,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'kill_capacity': instance.killCapacity,
'previous_kill_capacity': instance.previousKillCapacity,
'remain_quantity_for_poultry': instance.remainQuantityForPoultry,
'remain_quantity': instance.remainQuantity,
'recive_time': instance.reciveTime,
'recive_date': instance.reciveDate,
'state': instance.state,
'province_state': instance.provinceState,
'buy_type': instance.buyType,
'weight_type': instance.weightType,
'chicken_breed': instance.chickenBreed,
'index_weight': instance.indexWeight,
'sms_payment': instance.smsPayment,
'registrar': instance.registrar,
};
_KillHouseResponse _$KillHouseResponseFromJson(Map<String, dynamic> json) =>
_KillHouseResponse(
killHouseOperator: json['kill_house_operator'] == null
? null
: KillHouseOperator.fromJson(
json['kill_house_operator'] as Map<String, dynamic>,
),
name: json['name'] as String?,
killer: json['killer'] as bool?,
key: json['key'] as String?,
);
Map<String, dynamic> _$KillHouseResponseToJson(_KillHouseResponse instance) =>
<String, dynamic>{
'kill_house_operator': instance.killHouseOperator,
'name': instance.name,
'killer': instance.killer,
'key': instance.key,
};
_KillHouseOperator _$KillHouseOperatorFromJson(Map<String, dynamic> json) =>
_KillHouseOperator(
user: json['user'] == null
? null
: UserResponse.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillHouseOperatorToJson(_KillHouseOperator instance) =>
<String, dynamic>{'user': instance.user};
_UserResponse _$UserResponseFromJson(Map<String, dynamic> json) =>
_UserResponse(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
mobile: json['mobile'] as String?,
key: json['key'] as String?,
city: json['city'] == null
? null
: CityResponse.fromJson(json['city'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UserResponseToJson(_UserResponse instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'mobile': instance.mobile,
'key': instance.key,
'city': instance.city,
};
_CityResponse _$CityResponseFromJson(Map<String, dynamic> json) =>
_CityResponse(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String?,
provinceName: json['province_name'] as String?,
);
Map<String, dynamic> _$CityResponseToJson(_CityResponse instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'province_name': instance.provinceName,
};
_KillHouseVetResponse _$KillHouseVetResponseFromJson(
Map<String, dynamic> json,
) => _KillHouseVetResponse(
id: (json['id'] as num?)?.toInt(),
vet: json['vet'] == null
? null
: VetResponse.fromJson(json['vet'] as Map<String, dynamic>),
killHouse: json['kill_house'] == null
? null
: KillHouseResponse.fromJson(json['kill_house'] as Map<String, dynamic>),
key: json['key'] as String?,
trash: json['trash'] as bool?,
);
Map<String, dynamic> _$KillHouseVetResponseToJson(
_KillHouseVetResponse instance,
) => <String, dynamic>{
'id': instance.id,
'vet': instance.vet,
'kill_house': instance.killHouse,
'key': instance.key,
'trash': instance.trash,
};
_VetResponse _$VetResponseFromJson(Map<String, dynamic> json) => _VetResponse(
user: json['user'] == null
? null
: UserResponse.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$VetResponseToJson(_VetResponse instance) =>
<String, dynamic>{'user': instance.user};
_BuyTypeResponse _$BuyTypeResponseFromJson(Map<String, dynamic> json) =>
_BuyTypeResponse(
cash: json['cash'] as bool?,
credit: json['credit'] as bool?,
);
Map<String, dynamic> _$BuyTypeResponseToJson(_BuyTypeResponse instance) =>
<String, dynamic>{'cash': instance.cash, 'credit': instance.credit};
_WeightTypeResponse _$WeightTypeResponseFromJson(Map<String, dynamic> json) =>
_WeightTypeResponse(
lowWeight: json['low_weight'] as bool?,
highWeight: json['high_weight'] as bool?,
);
Map<String, dynamic> _$WeightTypeResponseToJson(_WeightTypeResponse instance) =>
<String, dynamic>{
'low_weight': instance.lowWeight,
'high_weight': instance.highWeight,
};
_RegistrarResponse _$RegistrarResponseFromJson(Map<String, dynamic> json) =>
_RegistrarResponse(
date: json['date'] as String?,
role: json['role'] as String?,
fullName: json['full_name'] as String?,
);
Map<String, dynamic> _$RegistrarResponseToJson(_RegistrarResponse instance) =>
<String, dynamic>{
'date': instance.date,
'role': instance.role,
'full_name': instance.fullName,
};

View File

@@ -0,0 +1,272 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_house_bars_response.freezed.dart';
part 'kill_house_bars_response.g.dart';
@freezed
abstract class KillHouseBarsResponse with _$KillHouseBarsResponse {
const factory KillHouseBarsResponse({
KillHouseUserModel? killhouseUser,
KillHouseUserModel? killer,
AddCarModel? addCar,
PoultryRequestModel? poultryRequest,
WeightInfoModel? weightInfo,
String? key,
String? createDate,
bool? trash,
int? quantity,
int? barCode,
int? quarantineQuantity,
String? quarantineCodeState,
double? fee,
String? time,
String? state,
String? vetState,
String? activeState,
String? assignmentStateArchive,
String? showKillHouse,
CarModel? car,
String? killHouseMessage,
String? allocationState,
bool? auction,
String? role,
String? clearanceCode,
String? trafficCode,
RegistrarClearanceCode? registrarClearanceCode,
String? editorTrafficCode,
String? barRemover,
int? extraKilledQuantity,
int? acceptedRealQuantity,
double? acceptedRealWeight,
double? extraKilledWeight,
int? vetAcceptedRealQuantity,
double? vetAcceptedRealWeight,
int? acceptedAssignmentRealQuantity,
double? acceptedAssignmentRealWeight,
String? message,
bool? wareHouseConfirmation,
int? wareHouseAcceptedRealQuantity,
double? wareHouseAcceptedRealWeight,
String? dateOfWareHouse,
bool? freezing,
bool? archiveWage,
double? weightLoss,
String? wareHouseInputType,
String? documentStatus,
String? aggregateCode,
bool? aggregateStatus,
bool? calculateStatus,
bool? temporaryTrash,
bool? temporaryDeleted,
String? enteredMessage,
String? inquiryDate,
String? inquiryOrigin,
String? inquiryDestination,
String? inquiryDriver,
String? inquiryPelak,
String? settlementType,
double? price,
String? description,
String? barDocumentDescription,
String? image,
String? priceRegisterar,
String? priceRegisterarRole,
String? priceRegisterDate,
String? priceEditor,
String? priceEditorRole,
String? priceEditorDate,
bool? nonReceipt,
bool? nonReceiptReturn,
String? nonReceiptReturnMessage,
String? nonReceiptMessage,
bool? mainNonReceipt,
String? nonReceiptState,
String? nonReceiptChecker,
String? nonReceiptCheckerMessage,
String? nonReceiptCheckerMobile,
String? nonReceiptCheckDate,
String? nonReceiptReturner,
String? nonReceiptReturnerMobile,
String? nonReceiptReturnDate,
bool? fine,
double? fineAmount,
double? fineCoefficient,
String? documentNumber,
bool? companyDocument,
bool? warehouse,
double? warehouseCommitmentWeight,
bool? returnTrash,
double? amount,
int? killRequest,
String? realAddCar,
String? barDocumentStatus,
int? inputWarehouse,
}) = _KillHouseBars;
factory KillHouseBarsResponse.fromJson(Map<String, dynamic> json) =>
_$KillHouseBarsFromJson(json);
}
@freezed
abstract class KillHouseUserModel with _$KillHouseUserModel {
const factory KillHouseUserModel({
KillHouseOperatorModel? killHouseOperator,
String? name,
bool? killer,
String? key,
double? maximumLoadVolumeIncrease,
double? maximumLoadVolumeReduction,
}) = _KillHouseUserModel;
factory KillHouseUserModel.fromJson(Map<String, dynamic> json) =>
_$KillHouseUserModelFromJson(json);
}
@freezed
abstract class KillHouseOperatorModel with _$KillHouseOperatorModel {
const factory KillHouseOperatorModel({UserDetailModel? user}) =
_KillHouseOperatorModel;
factory KillHouseOperatorModel.fromJson(Map<String, dynamic> json) =>
_$KillHouseOperatorModelFromJson(json);
}
@freezed
abstract class UserDetailModel with _$UserDetailModel {
const factory UserDetailModel({
String? fullname,
String? firstName,
String? lastName,
int? baseOrder,
String? mobile,
String? nationalId,
String? nationalCode,
String? key,
CityDetailModel? city,
String? unitName,
String? unitNationalId,
String? unitRegistrationNumber,
String? unitEconomicalNumber,
String? unitProvince,
String? unitCity,
String? unitPostalCode,
String? unitAddress,
}) = _UserDetailModel;
factory UserDetailModel.fromJson(Map<String, dynamic> json) =>
_$UserDetailModelFromJson(json);
}
@freezed
abstract class CityDetailModel with _$CityDetailModel {
const factory CityDetailModel({
int? id,
String? key,
String? createDate,
String? modifyDate,
bool? trash,
int? provinceIdForeignKey,
int? cityIdKey,
String? name,
double? productPrice,
bool? provinceCenter,
int? cityNumber,
String? cityName,
int? provinceNumber,
String? provinceName,
String? createdBy,
String? modifiedBy,
int? province,
}) = _CityDetailModel;
factory CityDetailModel.fromJson(Map<String, dynamic> json) =>
_$CityDetailModelFromJson(json);
}
@freezed
abstract class AddCarModel with _$AddCarModel {
const factory AddCarModel({DriverModel? driver}) = _AddCarModel;
factory AddCarModel.fromJson(Map<String, dynamic> json) =>
_$AddCarModelFromJson(json);
}
@freezed
abstract class DriverModel with _$DriverModel {
const factory DriverModel({
String? driverName,
String? driverMobile,
String? typeCar,
String? pelak,
String? healthCode,
}) = _DriverModel;
factory DriverModel.fromJson(Map<String, dynamic> json) =>
_$DriverModelFromJson(json);
}
@freezed
abstract class PoultryRequestModel with _$PoultryRequestModel {
const factory PoultryRequestModel({
int? poultryReqOrderCode,
String? poultryName,
String? poultryUserName,
String? poultryMobile,
String? poultryCity,
String? chickenBreed,
String? date,
bool? freezing,
bool? export,
bool? freeSaleInProvince,
bool? directBuying,
}) = _PoultryRequestModel;
factory PoultryRequestModel.fromJson(Map<String, dynamic> json) =>
_$PoultryRequestModelFromJson(json);
}
@freezed
abstract class WeightInfoModel with _$WeightInfoModel {
const factory WeightInfoModel({
double? indexWeight,
double? weight,
double? finalIndexWeight,
double? killHousePrice,
int? weightLoss,
double? inputLoss,
String? state,
}) = _WeightInfoModel;
factory WeightInfoModel.fromJson(Map<String, dynamic> json) =>
_$WeightInfoModelFromJson(json);
}
@freezed
abstract class CarModel with _$CarModel {
const factory CarModel({
int? id,
String? key,
String? pelak,
//Object? capocity,
String? typeCar,
String? driverName,
String? driverMobile,
String? weightWithoutLoad,
}) = _CarModel;
factory CarModel.fromJson(Map<String, dynamic> json) =>
_$CarModelFromJson(json);
}
@freezed
abstract class RegistrarClearanceCode with _$RegistrarClearanceCode {
const factory RegistrarClearanceCode({
String? date,
String? name,
String? role,
String? mobile,
}) = _RegistrarClearanceCode;
factory RegistrarClearanceCode.fromJson(Map<String, dynamic> json) =>
_$RegistrarClearanceCodeFromJson(json);
}

View File

@@ -0,0 +1,474 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_house_bars_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillHouseBars _$KillHouseBarsFromJson(
Map<String, dynamic> json,
) => _KillHouseBars(
killhouseUser: json['killhouse_user'] == null
? null
: KillHouseUserModel.fromJson(
json['killhouse_user'] as Map<String, dynamic>,
),
killer: json['killer'] == null
? null
: KillHouseUserModel.fromJson(json['killer'] as Map<String, dynamic>),
addCar: json['add_car'] == null
? null
: AddCarModel.fromJson(json['add_car'] as Map<String, dynamic>),
poultryRequest: json['poultry_request'] == null
? null
: PoultryRequestModel.fromJson(
json['poultry_request'] as Map<String, dynamic>,
),
weightInfo: json['weight_info'] == null
? null
: WeightInfoModel.fromJson(json['weight_info'] as Map<String, dynamic>),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
trash: json['trash'] as bool?,
quantity: (json['quantity'] as num?)?.toInt(),
barCode: (json['bar_code'] as num?)?.toInt(),
quarantineQuantity: (json['quarantine_quantity'] as num?)?.toInt(),
quarantineCodeState: json['quarantine_code_state'] as String?,
fee: (json['fee'] as num?)?.toDouble(),
time: json['time'] as String?,
state: json['state'] as String?,
vetState: json['vet_state'] as String?,
activeState: json['active_state'] as String?,
assignmentStateArchive: json['assignment_state_archive'] as String?,
showKillHouse: json['show_kill_house'] as String?,
car: json['car'] == null
? null
: CarModel.fromJson(json['car'] as Map<String, dynamic>),
killHouseMessage: json['kill_house_message'] as String?,
allocationState: json['allocation_state'] as String?,
auction: json['auction'] as bool?,
role: json['role'] as String?,
clearanceCode: json['clearance_code'] as String?,
trafficCode: json['traffic_code'] as String?,
registrarClearanceCode: json['registrar_clearance_code'] == null
? null
: RegistrarClearanceCode.fromJson(
json['registrar_clearance_code'] as Map<String, dynamic>,
),
editorTrafficCode: json['editor_traffic_code'] as String?,
barRemover: json['bar_remover'] as String?,
extraKilledQuantity: (json['extra_killed_quantity'] as num?)?.toInt(),
acceptedRealQuantity: (json['accepted_real_quantity'] as num?)?.toInt(),
acceptedRealWeight: (json['accepted_real_weight'] as num?)?.toDouble(),
extraKilledWeight: (json['extra_killed_weight'] as num?)?.toDouble(),
vetAcceptedRealQuantity: (json['vet_accepted_real_quantity'] as num?)
?.toInt(),
vetAcceptedRealWeight: (json['vet_accepted_real_weight'] as num?)?.toDouble(),
acceptedAssignmentRealQuantity:
(json['accepted_assignment_real_quantity'] as num?)?.toInt(),
acceptedAssignmentRealWeight:
(json['accepted_assignment_real_weight'] as num?)?.toDouble(),
message: json['message'] as String?,
wareHouseConfirmation: json['ware_house_confirmation'] as bool?,
wareHouseAcceptedRealQuantity:
(json['ware_house_accepted_real_quantity'] as num?)?.toInt(),
wareHouseAcceptedRealWeight: (json['ware_house_accepted_real_weight'] as num?)
?.toDouble(),
dateOfWareHouse: json['date_of_ware_house'] as String?,
freezing: json['freezing'] as bool?,
archiveWage: json['archive_wage'] as bool?,
weightLoss: (json['weight_loss'] as num?)?.toDouble(),
wareHouseInputType: json['ware_house_input_type'] as String?,
documentStatus: json['document_status'] as String?,
aggregateCode: json['aggregate_code'] as String?,
aggregateStatus: json['aggregate_status'] as bool?,
calculateStatus: json['calculate_status'] as bool?,
temporaryTrash: json['temporary_trash'] as bool?,
temporaryDeleted: json['temporary_deleted'] as bool?,
enteredMessage: json['entered_message'] as String?,
inquiryDate: json['inquiry_date'] as String?,
inquiryOrigin: json['inquiry_origin'] as String?,
inquiryDestination: json['inquiry_destination'] as String?,
inquiryDriver: json['inquiry_driver'] as String?,
inquiryPelak: json['inquiry_pelak'] as String?,
settlementType: json['settlement_type'] as String?,
price: (json['price'] as num?)?.toDouble(),
description: json['description'] as String?,
barDocumentDescription: json['bar_document_description'] as String?,
image: json['image'] as String?,
priceRegisterar: json['price_registerar'] as String?,
priceRegisterarRole: json['price_registerar_role'] as String?,
priceRegisterDate: json['price_register_date'] as String?,
priceEditor: json['price_editor'] as String?,
priceEditorRole: json['price_editor_role'] as String?,
priceEditorDate: json['price_editor_date'] as String?,
nonReceipt: json['non_receipt'] as bool?,
nonReceiptReturn: json['non_receipt_return'] as bool?,
nonReceiptReturnMessage: json['non_receipt_return_message'] as String?,
nonReceiptMessage: json['non_receipt_message'] as String?,
mainNonReceipt: json['main_non_receipt'] as bool?,
nonReceiptState: json['non_receipt_state'] as String?,
nonReceiptChecker: json['non_receipt_checker'] as String?,
nonReceiptCheckerMessage: json['non_receipt_checker_message'] as String?,
nonReceiptCheckerMobile: json['non_receipt_checker_mobile'] as String?,
nonReceiptCheckDate: json['non_receipt_check_date'] as String?,
nonReceiptReturner: json['non_receipt_returner'] as String?,
nonReceiptReturnerMobile: json['non_receipt_returner_mobile'] as String?,
nonReceiptReturnDate: json['non_receipt_return_date'] as String?,
fine: json['fine'] as bool?,
fineAmount: (json['fine_amount'] as num?)?.toDouble(),
fineCoefficient: (json['fine_coefficient'] as num?)?.toDouble(),
documentNumber: json['document_number'] as String?,
companyDocument: json['company_document'] as bool?,
warehouse: json['warehouse'] as bool?,
warehouseCommitmentWeight: (json['warehouse_commitment_weight'] as num?)
?.toDouble(),
returnTrash: json['return_trash'] as bool?,
amount: (json['amount'] as num?)?.toDouble(),
killRequest: (json['kill_request'] as num?)?.toInt(),
realAddCar: json['real_add_car'] as String?,
barDocumentStatus: json['bar_document_status'] as String?,
inputWarehouse: (json['input_warehouse'] as num?)?.toInt(),
);
Map<String, dynamic> _$KillHouseBarsToJson(
_KillHouseBars instance,
) => <String, dynamic>{
'killhouse_user': instance.killhouseUser,
'killer': instance.killer,
'add_car': instance.addCar,
'poultry_request': instance.poultryRequest,
'weight_info': instance.weightInfo,
'key': instance.key,
'create_date': instance.createDate,
'trash': instance.trash,
'quantity': instance.quantity,
'bar_code': instance.barCode,
'quarantine_quantity': instance.quarantineQuantity,
'quarantine_code_state': instance.quarantineCodeState,
'fee': instance.fee,
'time': instance.time,
'state': instance.state,
'vet_state': instance.vetState,
'active_state': instance.activeState,
'assignment_state_archive': instance.assignmentStateArchive,
'show_kill_house': instance.showKillHouse,
'car': instance.car,
'kill_house_message': instance.killHouseMessage,
'allocation_state': instance.allocationState,
'auction': instance.auction,
'role': instance.role,
'clearance_code': instance.clearanceCode,
'traffic_code': instance.trafficCode,
'registrar_clearance_code': instance.registrarClearanceCode,
'editor_traffic_code': instance.editorTrafficCode,
'bar_remover': instance.barRemover,
'extra_killed_quantity': instance.extraKilledQuantity,
'accepted_real_quantity': instance.acceptedRealQuantity,
'accepted_real_weight': instance.acceptedRealWeight,
'extra_killed_weight': instance.extraKilledWeight,
'vet_accepted_real_quantity': instance.vetAcceptedRealQuantity,
'vet_accepted_real_weight': instance.vetAcceptedRealWeight,
'accepted_assignment_real_quantity': instance.acceptedAssignmentRealQuantity,
'accepted_assignment_real_weight': instance.acceptedAssignmentRealWeight,
'message': instance.message,
'ware_house_confirmation': instance.wareHouseConfirmation,
'ware_house_accepted_real_quantity': instance.wareHouseAcceptedRealQuantity,
'ware_house_accepted_real_weight': instance.wareHouseAcceptedRealWeight,
'date_of_ware_house': instance.dateOfWareHouse,
'freezing': instance.freezing,
'archive_wage': instance.archiveWage,
'weight_loss': instance.weightLoss,
'ware_house_input_type': instance.wareHouseInputType,
'document_status': instance.documentStatus,
'aggregate_code': instance.aggregateCode,
'aggregate_status': instance.aggregateStatus,
'calculate_status': instance.calculateStatus,
'temporary_trash': instance.temporaryTrash,
'temporary_deleted': instance.temporaryDeleted,
'entered_message': instance.enteredMessage,
'inquiry_date': instance.inquiryDate,
'inquiry_origin': instance.inquiryOrigin,
'inquiry_destination': instance.inquiryDestination,
'inquiry_driver': instance.inquiryDriver,
'inquiry_pelak': instance.inquiryPelak,
'settlement_type': instance.settlementType,
'price': instance.price,
'description': instance.description,
'bar_document_description': instance.barDocumentDescription,
'image': instance.image,
'price_registerar': instance.priceRegisterar,
'price_registerar_role': instance.priceRegisterarRole,
'price_register_date': instance.priceRegisterDate,
'price_editor': instance.priceEditor,
'price_editor_role': instance.priceEditorRole,
'price_editor_date': instance.priceEditorDate,
'non_receipt': instance.nonReceipt,
'non_receipt_return': instance.nonReceiptReturn,
'non_receipt_return_message': instance.nonReceiptReturnMessage,
'non_receipt_message': instance.nonReceiptMessage,
'main_non_receipt': instance.mainNonReceipt,
'non_receipt_state': instance.nonReceiptState,
'non_receipt_checker': instance.nonReceiptChecker,
'non_receipt_checker_message': instance.nonReceiptCheckerMessage,
'non_receipt_checker_mobile': instance.nonReceiptCheckerMobile,
'non_receipt_check_date': instance.nonReceiptCheckDate,
'non_receipt_returner': instance.nonReceiptReturner,
'non_receipt_returner_mobile': instance.nonReceiptReturnerMobile,
'non_receipt_return_date': instance.nonReceiptReturnDate,
'fine': instance.fine,
'fine_amount': instance.fineAmount,
'fine_coefficient': instance.fineCoefficient,
'document_number': instance.documentNumber,
'company_document': instance.companyDocument,
'warehouse': instance.warehouse,
'warehouse_commitment_weight': instance.warehouseCommitmentWeight,
'return_trash': instance.returnTrash,
'amount': instance.amount,
'kill_request': instance.killRequest,
'real_add_car': instance.realAddCar,
'bar_document_status': instance.barDocumentStatus,
'input_warehouse': instance.inputWarehouse,
};
_KillHouseUserModel _$KillHouseUserModelFromJson(Map<String, dynamic> json) =>
_KillHouseUserModel(
killHouseOperator: json['kill_house_operator'] == null
? null
: KillHouseOperatorModel.fromJson(
json['kill_house_operator'] as Map<String, dynamic>,
),
name: json['name'] as String?,
killer: json['killer'] as bool?,
key: json['key'] as String?,
maximumLoadVolumeIncrease: (json['maximum_load_volume_increase'] as num?)
?.toDouble(),
maximumLoadVolumeReduction:
(json['maximum_load_volume_reduction'] as num?)?.toDouble(),
);
Map<String, dynamic> _$KillHouseUserModelToJson(_KillHouseUserModel instance) =>
<String, dynamic>{
'kill_house_operator': instance.killHouseOperator,
'name': instance.name,
'killer': instance.killer,
'key': instance.key,
'maximum_load_volume_increase': instance.maximumLoadVolumeIncrease,
'maximum_load_volume_reduction': instance.maximumLoadVolumeReduction,
};
_KillHouseOperatorModel _$KillHouseOperatorModelFromJson(
Map<String, dynamic> json,
) => _KillHouseOperatorModel(
user: json['user'] == null
? null
: UserDetailModel.fromJson(json['user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$KillHouseOperatorModelToJson(
_KillHouseOperatorModel instance,
) => <String, dynamic>{'user': instance.user};
_UserDetailModel _$UserDetailModelFromJson(Map<String, dynamic> json) =>
_UserDetailModel(
fullname: json['fullname'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
baseOrder: (json['base_order'] as num?)?.toInt(),
mobile: json['mobile'] as String?,
nationalId: json['national_id'] as String?,
nationalCode: json['national_code'] as String?,
key: json['key'] as String?,
city: json['city'] == null
? null
: CityDetailModel.fromJson(json['city'] as Map<String, dynamic>),
unitName: json['unit_name'] as String?,
unitNationalId: json['unit_national_id'] as String?,
unitRegistrationNumber: json['unit_registration_number'] as String?,
unitEconomicalNumber: json['unit_economical_number'] as String?,
unitProvince: json['unit_province'] as String?,
unitCity: json['unit_city'] as String?,
unitPostalCode: json['unit_postal_code'] as String?,
unitAddress: json['unit_address'] as String?,
);
Map<String, dynamic> _$UserDetailModelToJson(_UserDetailModel instance) =>
<String, dynamic>{
'fullname': instance.fullname,
'first_name': instance.firstName,
'last_name': instance.lastName,
'base_order': instance.baseOrder,
'mobile': instance.mobile,
'national_id': instance.nationalId,
'national_code': instance.nationalCode,
'key': instance.key,
'city': instance.city,
'unit_name': instance.unitName,
'unit_national_id': instance.unitNationalId,
'unit_registration_number': instance.unitRegistrationNumber,
'unit_economical_number': instance.unitEconomicalNumber,
'unit_province': instance.unitProvince,
'unit_city': instance.unitCity,
'unit_postal_code': instance.unitPostalCode,
'unit_address': instance.unitAddress,
};
_CityDetailModel _$CityDetailModelFromJson(Map<String, dynamic> json) =>
_CityDetailModel(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
createDate: json['create_date'] as String?,
modifyDate: json['modify_date'] as String?,
trash: json['trash'] as bool?,
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
cityIdKey: (json['city_id_key'] as num?)?.toInt(),
name: json['name'] as String?,
productPrice: (json['product_price'] as num?)?.toDouble(),
provinceCenter: json['province_center'] as bool?,
cityNumber: (json['city_number'] as num?)?.toInt(),
cityName: json['city_name'] as String?,
provinceNumber: (json['province_number'] as num?)?.toInt(),
provinceName: json['province_name'] as String?,
createdBy: json['created_by'] as String?,
modifiedBy: json['modified_by'] as String?,
province: (json['province'] as num?)?.toInt(),
);
Map<String, dynamic> _$CityDetailModelToJson(_CityDetailModel instance) =>
<String, dynamic>{
'id': instance.id,
'key': instance.key,
'create_date': instance.createDate,
'modify_date': instance.modifyDate,
'trash': instance.trash,
'province_id_foreign_key': instance.provinceIdForeignKey,
'city_id_key': instance.cityIdKey,
'name': instance.name,
'product_price': instance.productPrice,
'province_center': instance.provinceCenter,
'city_number': instance.cityNumber,
'city_name': instance.cityName,
'province_number': instance.provinceNumber,
'province_name': instance.provinceName,
'created_by': instance.createdBy,
'modified_by': instance.modifiedBy,
'province': instance.province,
};
_AddCarModel _$AddCarModelFromJson(Map<String, dynamic> json) => _AddCarModel(
driver: json['driver'] == null
? null
: DriverModel.fromJson(json['driver'] as Map<String, dynamic>),
);
Map<String, dynamic> _$AddCarModelToJson(_AddCarModel instance) =>
<String, dynamic>{'driver': instance.driver};
_DriverModel _$DriverModelFromJson(Map<String, dynamic> json) => _DriverModel(
driverName: json['driver_name'] as String?,
driverMobile: json['driver_mobile'] as String?,
typeCar: json['type_car'] as String?,
pelak: json['pelak'] as String?,
healthCode: json['health_code'] as String?,
);
Map<String, dynamic> _$DriverModelToJson(_DriverModel instance) =>
<String, dynamic>{
'driver_name': instance.driverName,
'driver_mobile': instance.driverMobile,
'type_car': instance.typeCar,
'pelak': instance.pelak,
'health_code': instance.healthCode,
};
_PoultryRequestModel _$PoultryRequestModelFromJson(Map<String, dynamic> json) =>
_PoultryRequestModel(
poultryReqOrderCode: (json['poultry_req_order_code'] as num?)?.toInt(),
poultryName: json['poultry_name'] as String?,
poultryUserName: json['poultry_user_name'] as String?,
poultryMobile: json['poultry_mobile'] as String?,
poultryCity: json['poultry_city'] as String?,
chickenBreed: json['chicken_breed'] as String?,
date: json['date'] as String?,
freezing: json['freezing'] as bool?,
export: json['export'] as bool?,
freeSaleInProvince: json['free_sale_in_province'] as bool?,
directBuying: json['direct_buying'] as bool?,
);
Map<String, dynamic> _$PoultryRequestModelToJson(
_PoultryRequestModel instance,
) => <String, dynamic>{
'poultry_req_order_code': instance.poultryReqOrderCode,
'poultry_name': instance.poultryName,
'poultry_user_name': instance.poultryUserName,
'poultry_mobile': instance.poultryMobile,
'poultry_city': instance.poultryCity,
'chicken_breed': instance.chickenBreed,
'date': instance.date,
'freezing': instance.freezing,
'export': instance.export,
'free_sale_in_province': instance.freeSaleInProvince,
'direct_buying': instance.directBuying,
};
_WeightInfoModel _$WeightInfoModelFromJson(Map<String, dynamic> json) =>
_WeightInfoModel(
indexWeight: (json['index_weight'] as num?)?.toDouble(),
weight: (json['weight'] as num?)?.toDouble(),
finalIndexWeight: (json['final_index_weight'] as num?)?.toDouble(),
killHousePrice: (json['kill_house_price'] as num?)?.toDouble(),
weightLoss: (json['weight_loss'] as num?)?.toInt(),
inputLoss: (json['input_loss'] as num?)?.toDouble(),
state: json['state'] as String?,
);
Map<String, dynamic> _$WeightInfoModelToJson(_WeightInfoModel instance) =>
<String, dynamic>{
'index_weight': instance.indexWeight,
'weight': instance.weight,
'final_index_weight': instance.finalIndexWeight,
'kill_house_price': instance.killHousePrice,
'weight_loss': instance.weightLoss,
'input_loss': instance.inputLoss,
'state': instance.state,
};
_CarModel _$CarModelFromJson(Map<String, dynamic> json) => _CarModel(
id: (json['id'] as num?)?.toInt(),
key: json['key'] as String?,
pelak: json['pelak'] as String?,
typeCar: json['type_car'] as String?,
driverName: json['driver_name'] as String?,
driverMobile: json['driver_mobile'] as String?,
weightWithoutLoad: json['weight_without_load'] as String?,
);
Map<String, dynamic> _$CarModelToJson(_CarModel instance) => <String, dynamic>{
'id': instance.id,
'key': instance.key,
'pelak': instance.pelak,
'type_car': instance.typeCar,
'driver_name': instance.driverName,
'driver_mobile': instance.driverMobile,
'weight_without_load': instance.weightWithoutLoad,
};
_RegistrarClearanceCode _$RegistrarClearanceCodeFromJson(
Map<String, dynamic> json,
) => _RegistrarClearanceCode(
date: json['date'] as String?,
name: json['name'] as String?,
role: json['role'] as String?,
mobile: json['mobile'] as String?,
);
Map<String, dynamic> _$RegistrarClearanceCodeToJson(
_RegistrarClearanceCode instance,
) => <String, dynamic>{
'date': instance.date,
'name': instance.name,
'role': instance.role,
'mobile': instance.mobile,
};

View File

@@ -0,0 +1,35 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'kill_house_sales_info_dashboard.freezed.dart';
part 'kill_house_sales_info_dashboard.g.dart';
@freezed
abstract class KillHouseSalesInfoDashboard with _$KillHouseSalesInfoDashboard {
const factory KillHouseSalesInfoDashboard({
double? totalGovernmentalInputWeight,
double? totalFreeInputWeight,
double? totalGovernmentalOutputWeight,
double? totalFreeOutputWeight,
double? totalGovernmentalRemainWeight,
double? totalFreeRemainWeight,
@JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight')
double? totalKillHouseFreeSaleBarCarcassesWeight,
double? totalKillHouseAllocationsWeight,
double? segmentationsWeight,
double? coldHouseAllocationsWeight,
double? totalSellingInProvinceGovernmentalWeight,
double? totalSellingInProvinceFreeWeight,
double? totalCommitmentSellingInProvinceGovernmentalWeight,
double? totalCommitmentSellingInProvinceGovernmentalRemainWeight,
double? totalCommitmentSellingInProvinceFreeWeight,
double? totalCommitmentSellingInProvinceFreeRemainWeight,
double? posAllocatedWeight,
double? posGovernmentalAllocatedWeight,
double? posFreeAllocatedWeight,
double? wareHouseArchiveGovernmentalWeight,
double? wareHouseArchiveFreeWeight,
}) = _KillHouseSalesInfoDashboard;
factory KillHouseSalesInfoDashboard.fromJson(Map<String, dynamic> json) =>
_$KillHouseSalesInfoDashboardFromJson(json);
}

View File

@@ -0,0 +1,337 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'kill_house_sales_info_dashboard.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$KillHouseSalesInfoDashboard {
double? get totalGovernmentalInputWeight; double? get totalFreeInputWeight; double? get totalGovernmentalOutputWeight; double? get totalFreeOutputWeight; double? get totalGovernmentalRemainWeight; double? get totalFreeRemainWeight;@JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? get totalKillHouseFreeSaleBarCarcassesWeight; double? get totalKillHouseAllocationsWeight; double? get segmentationsWeight; double? get coldHouseAllocationsWeight; double? get totalSellingInProvinceGovernmentalWeight; double? get totalSellingInProvinceFreeWeight; double? get totalCommitmentSellingInProvinceGovernmentalWeight; double? get totalCommitmentSellingInProvinceGovernmentalRemainWeight; double? get totalCommitmentSellingInProvinceFreeWeight; double? get totalCommitmentSellingInProvinceFreeRemainWeight; double? get posAllocatedWeight; double? get posGovernmentalAllocatedWeight; double? get posFreeAllocatedWeight; double? get wareHouseArchiveGovernmentalWeight; double? get wareHouseArchiveFreeWeight;
/// Create a copy of KillHouseSalesInfoDashboard
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$KillHouseSalesInfoDashboardCopyWith<KillHouseSalesInfoDashboard> get copyWith => _$KillHouseSalesInfoDashboardCopyWithImpl<KillHouseSalesInfoDashboard>(this as KillHouseSalesInfoDashboard, _$identity);
/// Serializes this KillHouseSalesInfoDashboard to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseSalesInfoDashboard&&(identical(other.totalGovernmentalInputWeight, totalGovernmentalInputWeight) || other.totalGovernmentalInputWeight == totalGovernmentalInputWeight)&&(identical(other.totalFreeInputWeight, totalFreeInputWeight) || other.totalFreeInputWeight == totalFreeInputWeight)&&(identical(other.totalGovernmentalOutputWeight, totalGovernmentalOutputWeight) || other.totalGovernmentalOutputWeight == totalGovernmentalOutputWeight)&&(identical(other.totalFreeOutputWeight, totalFreeOutputWeight) || other.totalFreeOutputWeight == totalFreeOutputWeight)&&(identical(other.totalGovernmentalRemainWeight, totalGovernmentalRemainWeight) || other.totalGovernmentalRemainWeight == totalGovernmentalRemainWeight)&&(identical(other.totalFreeRemainWeight, totalFreeRemainWeight) || other.totalFreeRemainWeight == totalFreeRemainWeight)&&(identical(other.totalKillHouseFreeSaleBarCarcassesWeight, totalKillHouseFreeSaleBarCarcassesWeight) || other.totalKillHouseFreeSaleBarCarcassesWeight == totalKillHouseFreeSaleBarCarcassesWeight)&&(identical(other.totalKillHouseAllocationsWeight, totalKillHouseAllocationsWeight) || other.totalKillHouseAllocationsWeight == totalKillHouseAllocationsWeight)&&(identical(other.segmentationsWeight, segmentationsWeight) || other.segmentationsWeight == segmentationsWeight)&&(identical(other.coldHouseAllocationsWeight, coldHouseAllocationsWeight) || other.coldHouseAllocationsWeight == coldHouseAllocationsWeight)&&(identical(other.totalSellingInProvinceGovernmentalWeight, totalSellingInProvinceGovernmentalWeight) || other.totalSellingInProvinceGovernmentalWeight == totalSellingInProvinceGovernmentalWeight)&&(identical(other.totalSellingInProvinceFreeWeight, totalSellingInProvinceFreeWeight) || other.totalSellingInProvinceFreeWeight == totalSellingInProvinceFreeWeight)&&(identical(other.totalCommitmentSellingInProvinceGovernmentalWeight, totalCommitmentSellingInProvinceGovernmentalWeight) || other.totalCommitmentSellingInProvinceGovernmentalWeight == totalCommitmentSellingInProvinceGovernmentalWeight)&&(identical(other.totalCommitmentSellingInProvinceGovernmentalRemainWeight, totalCommitmentSellingInProvinceGovernmentalRemainWeight) || other.totalCommitmentSellingInProvinceGovernmentalRemainWeight == totalCommitmentSellingInProvinceGovernmentalRemainWeight)&&(identical(other.totalCommitmentSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceFreeWeight) || other.totalCommitmentSellingInProvinceFreeWeight == totalCommitmentSellingInProvinceFreeWeight)&&(identical(other.totalCommitmentSellingInProvinceFreeRemainWeight, totalCommitmentSellingInProvinceFreeRemainWeight) || other.totalCommitmentSellingInProvinceFreeRemainWeight == totalCommitmentSellingInProvinceFreeRemainWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.posGovernmentalAllocatedWeight, posGovernmentalAllocatedWeight) || other.posGovernmentalAllocatedWeight == posGovernmentalAllocatedWeight)&&(identical(other.posFreeAllocatedWeight, posFreeAllocatedWeight) || other.posFreeAllocatedWeight == posFreeAllocatedWeight)&&(identical(other.wareHouseArchiveGovernmentalWeight, wareHouseArchiveGovernmentalWeight) || other.wareHouseArchiveGovernmentalWeight == wareHouseArchiveGovernmentalWeight)&&(identical(other.wareHouseArchiveFreeWeight, wareHouseArchiveFreeWeight) || other.wareHouseArchiveFreeWeight == wareHouseArchiveFreeWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,totalGovernmentalInputWeight,totalFreeInputWeight,totalGovernmentalOutputWeight,totalFreeOutputWeight,totalGovernmentalRemainWeight,totalFreeRemainWeight,totalKillHouseFreeSaleBarCarcassesWeight,totalKillHouseAllocationsWeight,segmentationsWeight,coldHouseAllocationsWeight,totalSellingInProvinceGovernmentalWeight,totalSellingInProvinceFreeWeight,totalCommitmentSellingInProvinceGovernmentalWeight,totalCommitmentSellingInProvinceGovernmentalRemainWeight,totalCommitmentSellingInProvinceFreeWeight,totalCommitmentSellingInProvinceFreeRemainWeight,posAllocatedWeight,posGovernmentalAllocatedWeight,posFreeAllocatedWeight,wareHouseArchiveGovernmentalWeight,wareHouseArchiveFreeWeight]);
@override
String toString() {
return 'KillHouseSalesInfoDashboard(totalGovernmentalInputWeight: $totalGovernmentalInputWeight, totalFreeInputWeight: $totalFreeInputWeight, totalGovernmentalOutputWeight: $totalGovernmentalOutputWeight, totalFreeOutputWeight: $totalFreeOutputWeight, totalGovernmentalRemainWeight: $totalGovernmentalRemainWeight, totalFreeRemainWeight: $totalFreeRemainWeight, totalKillHouseFreeSaleBarCarcassesWeight: $totalKillHouseFreeSaleBarCarcassesWeight, totalKillHouseAllocationsWeight: $totalKillHouseAllocationsWeight, segmentationsWeight: $segmentationsWeight, coldHouseAllocationsWeight: $coldHouseAllocationsWeight, totalSellingInProvinceGovernmentalWeight: $totalSellingInProvinceGovernmentalWeight, totalSellingInProvinceFreeWeight: $totalSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceGovernmentalWeight: $totalCommitmentSellingInProvinceGovernmentalWeight, totalCommitmentSellingInProvinceGovernmentalRemainWeight: $totalCommitmentSellingInProvinceGovernmentalRemainWeight, totalCommitmentSellingInProvinceFreeWeight: $totalCommitmentSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceFreeRemainWeight: $totalCommitmentSellingInProvinceFreeRemainWeight, posAllocatedWeight: $posAllocatedWeight, posGovernmentalAllocatedWeight: $posGovernmentalAllocatedWeight, posFreeAllocatedWeight: $posFreeAllocatedWeight, wareHouseArchiveGovernmentalWeight: $wareHouseArchiveGovernmentalWeight, wareHouseArchiveFreeWeight: $wareHouseArchiveFreeWeight)';
}
}
/// @nodoc
abstract mixin class $KillHouseSalesInfoDashboardCopyWith<$Res> {
factory $KillHouseSalesInfoDashboardCopyWith(KillHouseSalesInfoDashboard value, $Res Function(KillHouseSalesInfoDashboard) _then) = _$KillHouseSalesInfoDashboardCopyWithImpl;
@useResult
$Res call({
double? totalGovernmentalInputWeight, double? totalFreeInputWeight, double? totalGovernmentalOutputWeight, double? totalFreeOutputWeight, double? totalGovernmentalRemainWeight, double? totalFreeRemainWeight,@JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? totalKillHouseFreeSaleBarCarcassesWeight, double? totalKillHouseAllocationsWeight, double? segmentationsWeight, double? coldHouseAllocationsWeight, double? totalSellingInProvinceGovernmentalWeight, double? totalSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceGovernmentalWeight, double? totalCommitmentSellingInProvinceGovernmentalRemainWeight, double? totalCommitmentSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceFreeRemainWeight, double? posAllocatedWeight, double? posGovernmentalAllocatedWeight, double? posFreeAllocatedWeight, double? wareHouseArchiveGovernmentalWeight, double? wareHouseArchiveFreeWeight
});
}
/// @nodoc
class _$KillHouseSalesInfoDashboardCopyWithImpl<$Res>
implements $KillHouseSalesInfoDashboardCopyWith<$Res> {
_$KillHouseSalesInfoDashboardCopyWithImpl(this._self, this._then);
final KillHouseSalesInfoDashboard _self;
final $Res Function(KillHouseSalesInfoDashboard) _then;
/// Create a copy of KillHouseSalesInfoDashboard
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? totalGovernmentalInputWeight = freezed,Object? totalFreeInputWeight = freezed,Object? totalGovernmentalOutputWeight = freezed,Object? totalFreeOutputWeight = freezed,Object? totalGovernmentalRemainWeight = freezed,Object? totalFreeRemainWeight = freezed,Object? totalKillHouseFreeSaleBarCarcassesWeight = freezed,Object? totalKillHouseAllocationsWeight = freezed,Object? segmentationsWeight = freezed,Object? coldHouseAllocationsWeight = freezed,Object? totalSellingInProvinceGovernmentalWeight = freezed,Object? totalSellingInProvinceFreeWeight = freezed,Object? totalCommitmentSellingInProvinceGovernmentalWeight = freezed,Object? totalCommitmentSellingInProvinceGovernmentalRemainWeight = freezed,Object? totalCommitmentSellingInProvinceFreeWeight = freezed,Object? totalCommitmentSellingInProvinceFreeRemainWeight = freezed,Object? posAllocatedWeight = freezed,Object? posGovernmentalAllocatedWeight = freezed,Object? posFreeAllocatedWeight = freezed,Object? wareHouseArchiveGovernmentalWeight = freezed,Object? wareHouseArchiveFreeWeight = freezed,}) {
return _then(_self.copyWith(
totalGovernmentalInputWeight: freezed == totalGovernmentalInputWeight ? _self.totalGovernmentalInputWeight : totalGovernmentalInputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeInputWeight: freezed == totalFreeInputWeight ? _self.totalFreeInputWeight : totalFreeInputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalGovernmentalOutputWeight: freezed == totalGovernmentalOutputWeight ? _self.totalGovernmentalOutputWeight : totalGovernmentalOutputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeOutputWeight: freezed == totalFreeOutputWeight ? _self.totalFreeOutputWeight : totalFreeOutputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalGovernmentalRemainWeight: freezed == totalGovernmentalRemainWeight ? _self.totalGovernmentalRemainWeight : totalGovernmentalRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeRemainWeight: freezed == totalFreeRemainWeight ? _self.totalFreeRemainWeight : totalFreeRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalKillHouseFreeSaleBarCarcassesWeight: freezed == totalKillHouseFreeSaleBarCarcassesWeight ? _self.totalKillHouseFreeSaleBarCarcassesWeight : totalKillHouseFreeSaleBarCarcassesWeight // ignore: cast_nullable_to_non_nullable
as double?,totalKillHouseAllocationsWeight: freezed == totalKillHouseAllocationsWeight ? _self.totalKillHouseAllocationsWeight : totalKillHouseAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,segmentationsWeight: freezed == segmentationsWeight ? _self.segmentationsWeight : segmentationsWeight // ignore: cast_nullable_to_non_nullable
as double?,coldHouseAllocationsWeight: freezed == coldHouseAllocationsWeight ? _self.coldHouseAllocationsWeight : coldHouseAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalSellingInProvinceGovernmentalWeight: freezed == totalSellingInProvinceGovernmentalWeight ? _self.totalSellingInProvinceGovernmentalWeight : totalSellingInProvinceGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,totalSellingInProvinceFreeWeight: freezed == totalSellingInProvinceFreeWeight ? _self.totalSellingInProvinceFreeWeight : totalSellingInProvinceFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceGovernmentalWeight: freezed == totalCommitmentSellingInProvinceGovernmentalWeight ? _self.totalCommitmentSellingInProvinceGovernmentalWeight : totalCommitmentSellingInProvinceGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceGovernmentalRemainWeight: freezed == totalCommitmentSellingInProvinceGovernmentalRemainWeight ? _self.totalCommitmentSellingInProvinceGovernmentalRemainWeight : totalCommitmentSellingInProvinceGovernmentalRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceFreeWeight: freezed == totalCommitmentSellingInProvinceFreeWeight ? _self.totalCommitmentSellingInProvinceFreeWeight : totalCommitmentSellingInProvinceFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceFreeRemainWeight: freezed == totalCommitmentSellingInProvinceFreeRemainWeight ? _self.totalCommitmentSellingInProvinceFreeRemainWeight : totalCommitmentSellingInProvinceFreeRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,posGovernmentalAllocatedWeight: freezed == posGovernmentalAllocatedWeight ? _self.posGovernmentalAllocatedWeight : posGovernmentalAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,posFreeAllocatedWeight: freezed == posFreeAllocatedWeight ? _self.posFreeAllocatedWeight : posFreeAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,wareHouseArchiveGovernmentalWeight: freezed == wareHouseArchiveGovernmentalWeight ? _self.wareHouseArchiveGovernmentalWeight : wareHouseArchiveGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,wareHouseArchiveFreeWeight: freezed == wareHouseArchiveFreeWeight ? _self.wareHouseArchiveFreeWeight : wareHouseArchiveFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
/// Adds pattern-matching-related methods to [KillHouseSalesInfoDashboard].
extension KillHouseSalesInfoDashboardPatterns on KillHouseSalesInfoDashboard {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillHouseSalesInfoDashboard value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillHouseSalesInfoDashboard value) $default,){
final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillHouseSalesInfoDashboard value)? $default,){
final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double? totalGovernmentalInputWeight, double? totalFreeInputWeight, double? totalGovernmentalOutputWeight, double? totalFreeOutputWeight, double? totalGovernmentalRemainWeight, double? totalFreeRemainWeight, @JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? totalKillHouseFreeSaleBarCarcassesWeight, double? totalKillHouseAllocationsWeight, double? segmentationsWeight, double? coldHouseAllocationsWeight, double? totalSellingInProvinceGovernmentalWeight, double? totalSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceGovernmentalWeight, double? totalCommitmentSellingInProvinceGovernmentalRemainWeight, double? totalCommitmentSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceFreeRemainWeight, double? posAllocatedWeight, double? posGovernmentalAllocatedWeight, double? posFreeAllocatedWeight, double? wareHouseArchiveGovernmentalWeight, double? wareHouseArchiveFreeWeight)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard() when $default != null:
return $default(_that.totalGovernmentalInputWeight,_that.totalFreeInputWeight,_that.totalGovernmentalOutputWeight,_that.totalFreeOutputWeight,_that.totalGovernmentalRemainWeight,_that.totalFreeRemainWeight,_that.totalKillHouseFreeSaleBarCarcassesWeight,_that.totalKillHouseAllocationsWeight,_that.segmentationsWeight,_that.coldHouseAllocationsWeight,_that.totalSellingInProvinceGovernmentalWeight,_that.totalSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceGovernmentalWeight,_that.totalCommitmentSellingInProvinceGovernmentalRemainWeight,_that.totalCommitmentSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceFreeRemainWeight,_that.posAllocatedWeight,_that.posGovernmentalAllocatedWeight,_that.posFreeAllocatedWeight,_that.wareHouseArchiveGovernmentalWeight,_that.wareHouseArchiveFreeWeight);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double? totalGovernmentalInputWeight, double? totalFreeInputWeight, double? totalGovernmentalOutputWeight, double? totalFreeOutputWeight, double? totalGovernmentalRemainWeight, double? totalFreeRemainWeight, @JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? totalKillHouseFreeSaleBarCarcassesWeight, double? totalKillHouseAllocationsWeight, double? segmentationsWeight, double? coldHouseAllocationsWeight, double? totalSellingInProvinceGovernmentalWeight, double? totalSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceGovernmentalWeight, double? totalCommitmentSellingInProvinceGovernmentalRemainWeight, double? totalCommitmentSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceFreeRemainWeight, double? posAllocatedWeight, double? posGovernmentalAllocatedWeight, double? posFreeAllocatedWeight, double? wareHouseArchiveGovernmentalWeight, double? wareHouseArchiveFreeWeight) $default,) {final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard():
return $default(_that.totalGovernmentalInputWeight,_that.totalFreeInputWeight,_that.totalGovernmentalOutputWeight,_that.totalFreeOutputWeight,_that.totalGovernmentalRemainWeight,_that.totalFreeRemainWeight,_that.totalKillHouseFreeSaleBarCarcassesWeight,_that.totalKillHouseAllocationsWeight,_that.segmentationsWeight,_that.coldHouseAllocationsWeight,_that.totalSellingInProvinceGovernmentalWeight,_that.totalSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceGovernmentalWeight,_that.totalCommitmentSellingInProvinceGovernmentalRemainWeight,_that.totalCommitmentSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceFreeRemainWeight,_that.posAllocatedWeight,_that.posGovernmentalAllocatedWeight,_that.posFreeAllocatedWeight,_that.wareHouseArchiveGovernmentalWeight,_that.wareHouseArchiveFreeWeight);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double? totalGovernmentalInputWeight, double? totalFreeInputWeight, double? totalGovernmentalOutputWeight, double? totalFreeOutputWeight, double? totalGovernmentalRemainWeight, double? totalFreeRemainWeight, @JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? totalKillHouseFreeSaleBarCarcassesWeight, double? totalKillHouseAllocationsWeight, double? segmentationsWeight, double? coldHouseAllocationsWeight, double? totalSellingInProvinceGovernmentalWeight, double? totalSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceGovernmentalWeight, double? totalCommitmentSellingInProvinceGovernmentalRemainWeight, double? totalCommitmentSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceFreeRemainWeight, double? posAllocatedWeight, double? posGovernmentalAllocatedWeight, double? posFreeAllocatedWeight, double? wareHouseArchiveGovernmentalWeight, double? wareHouseArchiveFreeWeight)? $default,) {final _that = this;
switch (_that) {
case _KillHouseSalesInfoDashboard() when $default != null:
return $default(_that.totalGovernmentalInputWeight,_that.totalFreeInputWeight,_that.totalGovernmentalOutputWeight,_that.totalFreeOutputWeight,_that.totalGovernmentalRemainWeight,_that.totalFreeRemainWeight,_that.totalKillHouseFreeSaleBarCarcassesWeight,_that.totalKillHouseAllocationsWeight,_that.segmentationsWeight,_that.coldHouseAllocationsWeight,_that.totalSellingInProvinceGovernmentalWeight,_that.totalSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceGovernmentalWeight,_that.totalCommitmentSellingInProvinceGovernmentalRemainWeight,_that.totalCommitmentSellingInProvinceFreeWeight,_that.totalCommitmentSellingInProvinceFreeRemainWeight,_that.posAllocatedWeight,_that.posGovernmentalAllocatedWeight,_that.posFreeAllocatedWeight,_that.wareHouseArchiveGovernmentalWeight,_that.wareHouseArchiveFreeWeight);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _KillHouseSalesInfoDashboard implements KillHouseSalesInfoDashboard {
const _KillHouseSalesInfoDashboard({this.totalGovernmentalInputWeight, this.totalFreeInputWeight, this.totalGovernmentalOutputWeight, this.totalFreeOutputWeight, this.totalGovernmentalRemainWeight, this.totalFreeRemainWeight, @JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') this.totalKillHouseFreeSaleBarCarcassesWeight, this.totalKillHouseAllocationsWeight, this.segmentationsWeight, this.coldHouseAllocationsWeight, this.totalSellingInProvinceGovernmentalWeight, this.totalSellingInProvinceFreeWeight, this.totalCommitmentSellingInProvinceGovernmentalWeight, this.totalCommitmentSellingInProvinceGovernmentalRemainWeight, this.totalCommitmentSellingInProvinceFreeWeight, this.totalCommitmentSellingInProvinceFreeRemainWeight, this.posAllocatedWeight, this.posGovernmentalAllocatedWeight, this.posFreeAllocatedWeight, this.wareHouseArchiveGovernmentalWeight, this.wareHouseArchiveFreeWeight});
factory _KillHouseSalesInfoDashboard.fromJson(Map<String, dynamic> json) => _$KillHouseSalesInfoDashboardFromJson(json);
@override final double? totalGovernmentalInputWeight;
@override final double? totalFreeInputWeight;
@override final double? totalGovernmentalOutputWeight;
@override final double? totalFreeOutputWeight;
@override final double? totalGovernmentalRemainWeight;
@override final double? totalFreeRemainWeight;
@override@JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') final double? totalKillHouseFreeSaleBarCarcassesWeight;
@override final double? totalKillHouseAllocationsWeight;
@override final double? segmentationsWeight;
@override final double? coldHouseAllocationsWeight;
@override final double? totalSellingInProvinceGovernmentalWeight;
@override final double? totalSellingInProvinceFreeWeight;
@override final double? totalCommitmentSellingInProvinceGovernmentalWeight;
@override final double? totalCommitmentSellingInProvinceGovernmentalRemainWeight;
@override final double? totalCommitmentSellingInProvinceFreeWeight;
@override final double? totalCommitmentSellingInProvinceFreeRemainWeight;
@override final double? posAllocatedWeight;
@override final double? posGovernmentalAllocatedWeight;
@override final double? posFreeAllocatedWeight;
@override final double? wareHouseArchiveGovernmentalWeight;
@override final double? wareHouseArchiveFreeWeight;
/// Create a copy of KillHouseSalesInfoDashboard
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$KillHouseSalesInfoDashboardCopyWith<_KillHouseSalesInfoDashboard> get copyWith => __$KillHouseSalesInfoDashboardCopyWithImpl<_KillHouseSalesInfoDashboard>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$KillHouseSalesInfoDashboardToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseSalesInfoDashboard&&(identical(other.totalGovernmentalInputWeight, totalGovernmentalInputWeight) || other.totalGovernmentalInputWeight == totalGovernmentalInputWeight)&&(identical(other.totalFreeInputWeight, totalFreeInputWeight) || other.totalFreeInputWeight == totalFreeInputWeight)&&(identical(other.totalGovernmentalOutputWeight, totalGovernmentalOutputWeight) || other.totalGovernmentalOutputWeight == totalGovernmentalOutputWeight)&&(identical(other.totalFreeOutputWeight, totalFreeOutputWeight) || other.totalFreeOutputWeight == totalFreeOutputWeight)&&(identical(other.totalGovernmentalRemainWeight, totalGovernmentalRemainWeight) || other.totalGovernmentalRemainWeight == totalGovernmentalRemainWeight)&&(identical(other.totalFreeRemainWeight, totalFreeRemainWeight) || other.totalFreeRemainWeight == totalFreeRemainWeight)&&(identical(other.totalKillHouseFreeSaleBarCarcassesWeight, totalKillHouseFreeSaleBarCarcassesWeight) || other.totalKillHouseFreeSaleBarCarcassesWeight == totalKillHouseFreeSaleBarCarcassesWeight)&&(identical(other.totalKillHouseAllocationsWeight, totalKillHouseAllocationsWeight) || other.totalKillHouseAllocationsWeight == totalKillHouseAllocationsWeight)&&(identical(other.segmentationsWeight, segmentationsWeight) || other.segmentationsWeight == segmentationsWeight)&&(identical(other.coldHouseAllocationsWeight, coldHouseAllocationsWeight) || other.coldHouseAllocationsWeight == coldHouseAllocationsWeight)&&(identical(other.totalSellingInProvinceGovernmentalWeight, totalSellingInProvinceGovernmentalWeight) || other.totalSellingInProvinceGovernmentalWeight == totalSellingInProvinceGovernmentalWeight)&&(identical(other.totalSellingInProvinceFreeWeight, totalSellingInProvinceFreeWeight) || other.totalSellingInProvinceFreeWeight == totalSellingInProvinceFreeWeight)&&(identical(other.totalCommitmentSellingInProvinceGovernmentalWeight, totalCommitmentSellingInProvinceGovernmentalWeight) || other.totalCommitmentSellingInProvinceGovernmentalWeight == totalCommitmentSellingInProvinceGovernmentalWeight)&&(identical(other.totalCommitmentSellingInProvinceGovernmentalRemainWeight, totalCommitmentSellingInProvinceGovernmentalRemainWeight) || other.totalCommitmentSellingInProvinceGovernmentalRemainWeight == totalCommitmentSellingInProvinceGovernmentalRemainWeight)&&(identical(other.totalCommitmentSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceFreeWeight) || other.totalCommitmentSellingInProvinceFreeWeight == totalCommitmentSellingInProvinceFreeWeight)&&(identical(other.totalCommitmentSellingInProvinceFreeRemainWeight, totalCommitmentSellingInProvinceFreeRemainWeight) || other.totalCommitmentSellingInProvinceFreeRemainWeight == totalCommitmentSellingInProvinceFreeRemainWeight)&&(identical(other.posAllocatedWeight, posAllocatedWeight) || other.posAllocatedWeight == posAllocatedWeight)&&(identical(other.posGovernmentalAllocatedWeight, posGovernmentalAllocatedWeight) || other.posGovernmentalAllocatedWeight == posGovernmentalAllocatedWeight)&&(identical(other.posFreeAllocatedWeight, posFreeAllocatedWeight) || other.posFreeAllocatedWeight == posFreeAllocatedWeight)&&(identical(other.wareHouseArchiveGovernmentalWeight, wareHouseArchiveGovernmentalWeight) || other.wareHouseArchiveGovernmentalWeight == wareHouseArchiveGovernmentalWeight)&&(identical(other.wareHouseArchiveFreeWeight, wareHouseArchiveFreeWeight) || other.wareHouseArchiveFreeWeight == wareHouseArchiveFreeWeight));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([runtimeType,totalGovernmentalInputWeight,totalFreeInputWeight,totalGovernmentalOutputWeight,totalFreeOutputWeight,totalGovernmentalRemainWeight,totalFreeRemainWeight,totalKillHouseFreeSaleBarCarcassesWeight,totalKillHouseAllocationsWeight,segmentationsWeight,coldHouseAllocationsWeight,totalSellingInProvinceGovernmentalWeight,totalSellingInProvinceFreeWeight,totalCommitmentSellingInProvinceGovernmentalWeight,totalCommitmentSellingInProvinceGovernmentalRemainWeight,totalCommitmentSellingInProvinceFreeWeight,totalCommitmentSellingInProvinceFreeRemainWeight,posAllocatedWeight,posGovernmentalAllocatedWeight,posFreeAllocatedWeight,wareHouseArchiveGovernmentalWeight,wareHouseArchiveFreeWeight]);
@override
String toString() {
return 'KillHouseSalesInfoDashboard(totalGovernmentalInputWeight: $totalGovernmentalInputWeight, totalFreeInputWeight: $totalFreeInputWeight, totalGovernmentalOutputWeight: $totalGovernmentalOutputWeight, totalFreeOutputWeight: $totalFreeOutputWeight, totalGovernmentalRemainWeight: $totalGovernmentalRemainWeight, totalFreeRemainWeight: $totalFreeRemainWeight, totalKillHouseFreeSaleBarCarcassesWeight: $totalKillHouseFreeSaleBarCarcassesWeight, totalKillHouseAllocationsWeight: $totalKillHouseAllocationsWeight, segmentationsWeight: $segmentationsWeight, coldHouseAllocationsWeight: $coldHouseAllocationsWeight, totalSellingInProvinceGovernmentalWeight: $totalSellingInProvinceGovernmentalWeight, totalSellingInProvinceFreeWeight: $totalSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceGovernmentalWeight: $totalCommitmentSellingInProvinceGovernmentalWeight, totalCommitmentSellingInProvinceGovernmentalRemainWeight: $totalCommitmentSellingInProvinceGovernmentalRemainWeight, totalCommitmentSellingInProvinceFreeWeight: $totalCommitmentSellingInProvinceFreeWeight, totalCommitmentSellingInProvinceFreeRemainWeight: $totalCommitmentSellingInProvinceFreeRemainWeight, posAllocatedWeight: $posAllocatedWeight, posGovernmentalAllocatedWeight: $posGovernmentalAllocatedWeight, posFreeAllocatedWeight: $posFreeAllocatedWeight, wareHouseArchiveGovernmentalWeight: $wareHouseArchiveGovernmentalWeight, wareHouseArchiveFreeWeight: $wareHouseArchiveFreeWeight)';
}
}
/// @nodoc
abstract mixin class _$KillHouseSalesInfoDashboardCopyWith<$Res> implements $KillHouseSalesInfoDashboardCopyWith<$Res> {
factory _$KillHouseSalesInfoDashboardCopyWith(_KillHouseSalesInfoDashboard value, $Res Function(_KillHouseSalesInfoDashboard) _then) = __$KillHouseSalesInfoDashboardCopyWithImpl;
@override @useResult
$Res call({
double? totalGovernmentalInputWeight, double? totalFreeInputWeight, double? totalGovernmentalOutputWeight, double? totalFreeOutputWeight, double? totalGovernmentalRemainWeight, double? totalFreeRemainWeight,@JsonKey(name: 'total_kill_house_free_sale__bar_carcasses_weight') double? totalKillHouseFreeSaleBarCarcassesWeight, double? totalKillHouseAllocationsWeight, double? segmentationsWeight, double? coldHouseAllocationsWeight, double? totalSellingInProvinceGovernmentalWeight, double? totalSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceGovernmentalWeight, double? totalCommitmentSellingInProvinceGovernmentalRemainWeight, double? totalCommitmentSellingInProvinceFreeWeight, double? totalCommitmentSellingInProvinceFreeRemainWeight, double? posAllocatedWeight, double? posGovernmentalAllocatedWeight, double? posFreeAllocatedWeight, double? wareHouseArchiveGovernmentalWeight, double? wareHouseArchiveFreeWeight
});
}
/// @nodoc
class __$KillHouseSalesInfoDashboardCopyWithImpl<$Res>
implements _$KillHouseSalesInfoDashboardCopyWith<$Res> {
__$KillHouseSalesInfoDashboardCopyWithImpl(this._self, this._then);
final _KillHouseSalesInfoDashboard _self;
final $Res Function(_KillHouseSalesInfoDashboard) _then;
/// Create a copy of KillHouseSalesInfoDashboard
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? totalGovernmentalInputWeight = freezed,Object? totalFreeInputWeight = freezed,Object? totalGovernmentalOutputWeight = freezed,Object? totalFreeOutputWeight = freezed,Object? totalGovernmentalRemainWeight = freezed,Object? totalFreeRemainWeight = freezed,Object? totalKillHouseFreeSaleBarCarcassesWeight = freezed,Object? totalKillHouseAllocationsWeight = freezed,Object? segmentationsWeight = freezed,Object? coldHouseAllocationsWeight = freezed,Object? totalSellingInProvinceGovernmentalWeight = freezed,Object? totalSellingInProvinceFreeWeight = freezed,Object? totalCommitmentSellingInProvinceGovernmentalWeight = freezed,Object? totalCommitmentSellingInProvinceGovernmentalRemainWeight = freezed,Object? totalCommitmentSellingInProvinceFreeWeight = freezed,Object? totalCommitmentSellingInProvinceFreeRemainWeight = freezed,Object? posAllocatedWeight = freezed,Object? posGovernmentalAllocatedWeight = freezed,Object? posFreeAllocatedWeight = freezed,Object? wareHouseArchiveGovernmentalWeight = freezed,Object? wareHouseArchiveFreeWeight = freezed,}) {
return _then(_KillHouseSalesInfoDashboard(
totalGovernmentalInputWeight: freezed == totalGovernmentalInputWeight ? _self.totalGovernmentalInputWeight : totalGovernmentalInputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeInputWeight: freezed == totalFreeInputWeight ? _self.totalFreeInputWeight : totalFreeInputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalGovernmentalOutputWeight: freezed == totalGovernmentalOutputWeight ? _self.totalGovernmentalOutputWeight : totalGovernmentalOutputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeOutputWeight: freezed == totalFreeOutputWeight ? _self.totalFreeOutputWeight : totalFreeOutputWeight // ignore: cast_nullable_to_non_nullable
as double?,totalGovernmentalRemainWeight: freezed == totalGovernmentalRemainWeight ? _self.totalGovernmentalRemainWeight : totalGovernmentalRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalFreeRemainWeight: freezed == totalFreeRemainWeight ? _self.totalFreeRemainWeight : totalFreeRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalKillHouseFreeSaleBarCarcassesWeight: freezed == totalKillHouseFreeSaleBarCarcassesWeight ? _self.totalKillHouseFreeSaleBarCarcassesWeight : totalKillHouseFreeSaleBarCarcassesWeight // ignore: cast_nullable_to_non_nullable
as double?,totalKillHouseAllocationsWeight: freezed == totalKillHouseAllocationsWeight ? _self.totalKillHouseAllocationsWeight : totalKillHouseAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,segmentationsWeight: freezed == segmentationsWeight ? _self.segmentationsWeight : segmentationsWeight // ignore: cast_nullable_to_non_nullable
as double?,coldHouseAllocationsWeight: freezed == coldHouseAllocationsWeight ? _self.coldHouseAllocationsWeight : coldHouseAllocationsWeight // ignore: cast_nullable_to_non_nullable
as double?,totalSellingInProvinceGovernmentalWeight: freezed == totalSellingInProvinceGovernmentalWeight ? _self.totalSellingInProvinceGovernmentalWeight : totalSellingInProvinceGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,totalSellingInProvinceFreeWeight: freezed == totalSellingInProvinceFreeWeight ? _self.totalSellingInProvinceFreeWeight : totalSellingInProvinceFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceGovernmentalWeight: freezed == totalCommitmentSellingInProvinceGovernmentalWeight ? _self.totalCommitmentSellingInProvinceGovernmentalWeight : totalCommitmentSellingInProvinceGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceGovernmentalRemainWeight: freezed == totalCommitmentSellingInProvinceGovernmentalRemainWeight ? _self.totalCommitmentSellingInProvinceGovernmentalRemainWeight : totalCommitmentSellingInProvinceGovernmentalRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceFreeWeight: freezed == totalCommitmentSellingInProvinceFreeWeight ? _self.totalCommitmentSellingInProvinceFreeWeight : totalCommitmentSellingInProvinceFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,totalCommitmentSellingInProvinceFreeRemainWeight: freezed == totalCommitmentSellingInProvinceFreeRemainWeight ? _self.totalCommitmentSellingInProvinceFreeRemainWeight : totalCommitmentSellingInProvinceFreeRemainWeight // ignore: cast_nullable_to_non_nullable
as double?,posAllocatedWeight: freezed == posAllocatedWeight ? _self.posAllocatedWeight : posAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,posGovernmentalAllocatedWeight: freezed == posGovernmentalAllocatedWeight ? _self.posGovernmentalAllocatedWeight : posGovernmentalAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,posFreeAllocatedWeight: freezed == posFreeAllocatedWeight ? _self.posFreeAllocatedWeight : posFreeAllocatedWeight // ignore: cast_nullable_to_non_nullable
as double?,wareHouseArchiveGovernmentalWeight: freezed == wareHouseArchiveGovernmentalWeight ? _self.wareHouseArchiveGovernmentalWeight : wareHouseArchiveGovernmentalWeight // ignore: cast_nullable_to_non_nullable
as double?,wareHouseArchiveFreeWeight: freezed == wareHouseArchiveFreeWeight ? _self.wareHouseArchiveFreeWeight : wareHouseArchiveFreeWeight // ignore: cast_nullable_to_non_nullable
as double?,
));
}
}
// dart format on

View File

@@ -0,0 +1,91 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kill_house_sales_info_dashboard.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_KillHouseSalesInfoDashboard _$KillHouseSalesInfoDashboardFromJson(
Map<String, dynamic> json,
) => _KillHouseSalesInfoDashboard(
totalGovernmentalInputWeight:
(json['total_governmental_input_weight'] as num?)?.toDouble(),
totalFreeInputWeight: (json['total_free_input_weight'] as num?)?.toDouble(),
totalGovernmentalOutputWeight:
(json['total_governmental_output_weight'] as num?)?.toDouble(),
totalFreeOutputWeight: (json['total_free_output_weight'] as num?)?.toDouble(),
totalGovernmentalRemainWeight:
(json['total_governmental_remain_weight'] as num?)?.toDouble(),
totalFreeRemainWeight: (json['total_free_remain_weight'] as num?)?.toDouble(),
totalKillHouseFreeSaleBarCarcassesWeight:
(json['total_kill_house_free_sale__bar_carcasses_weight'] as num?)
?.toDouble(),
totalKillHouseAllocationsWeight:
(json['total_kill_house_allocations_weight'] as num?)?.toDouble(),
segmentationsWeight: (json['segmentations_weight'] as num?)?.toDouble(),
coldHouseAllocationsWeight: (json['cold_house_allocations_weight'] as num?)
?.toDouble(),
totalSellingInProvinceGovernmentalWeight:
(json['total_selling_in_province_governmental_weight'] as num?)
?.toDouble(),
totalSellingInProvinceFreeWeight:
(json['total_selling_in_province_free_weight'] as num?)?.toDouble(),
totalCommitmentSellingInProvinceGovernmentalWeight:
(json['total_commitment_selling_in_province_governmental_weight'] as num?)
?.toDouble(),
totalCommitmentSellingInProvinceGovernmentalRemainWeight:
(json['total_commitment_selling_in_province_governmental_remain_weight']
as num?)
?.toDouble(),
totalCommitmentSellingInProvinceFreeWeight:
(json['total_commitment_selling_in_province_free_weight'] as num?)
?.toDouble(),
totalCommitmentSellingInProvinceFreeRemainWeight:
(json['total_commitment_selling_in_province_free_remain_weight'] as num?)
?.toDouble(),
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toDouble(),
posGovernmentalAllocatedWeight:
(json['pos_governmental_allocated_weight'] as num?)?.toDouble(),
posFreeAllocatedWeight: (json['pos_free_allocated_weight'] as num?)
?.toDouble(),
wareHouseArchiveGovernmentalWeight:
(json['ware_house_archive_governmental_weight'] as num?)?.toDouble(),
wareHouseArchiveFreeWeight: (json['ware_house_archive_free_weight'] as num?)
?.toDouble(),
);
Map<String, dynamic> _$KillHouseSalesInfoDashboardToJson(
_KillHouseSalesInfoDashboard instance,
) => <String, dynamic>{
'total_governmental_input_weight': instance.totalGovernmentalInputWeight,
'total_free_input_weight': instance.totalFreeInputWeight,
'total_governmental_output_weight': instance.totalGovernmentalOutputWeight,
'total_free_output_weight': instance.totalFreeOutputWeight,
'total_governmental_remain_weight': instance.totalGovernmentalRemainWeight,
'total_free_remain_weight': instance.totalFreeRemainWeight,
'total_kill_house_free_sale__bar_carcasses_weight':
instance.totalKillHouseFreeSaleBarCarcassesWeight,
'total_kill_house_allocations_weight':
instance.totalKillHouseAllocationsWeight,
'segmentations_weight': instance.segmentationsWeight,
'cold_house_allocations_weight': instance.coldHouseAllocationsWeight,
'total_selling_in_province_governmental_weight':
instance.totalSellingInProvinceGovernmentalWeight,
'total_selling_in_province_free_weight':
instance.totalSellingInProvinceFreeWeight,
'total_commitment_selling_in_province_governmental_weight':
instance.totalCommitmentSellingInProvinceGovernmentalWeight,
'total_commitment_selling_in_province_governmental_remain_weight':
instance.totalCommitmentSellingInProvinceGovernmentalRemainWeight,
'total_commitment_selling_in_province_free_weight':
instance.totalCommitmentSellingInProvinceFreeWeight,
'total_commitment_selling_in_province_free_remain_weight':
instance.totalCommitmentSellingInProvinceFreeRemainWeight,
'pos_allocated_weight': instance.posAllocatedWeight,
'pos_governmental_allocated_weight': instance.posGovernmentalAllocatedWeight,
'pos_free_allocated_weight': instance.posFreeAllocatedWeight,
'ware_house_archive_governmental_weight':
instance.wareHouseArchiveGovernmentalWeight,
'ware_house_archive_free_weight': instance.wareHouseArchiveFreeWeight,
};

View File

@@ -0,0 +1,56 @@
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as listModel
show KillRequestList;
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_core/data/model/pagination_model/pagination_model.dart';
abstract class KillHouseRepository {
//region requestKill
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> submitKillHouseRequest({
required String token,
required KillRequestResponse data,
});
Future<List<listModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<void> deleteKillRequest({
required String token,
required int requestId,
});
//endregion
//region warehouseAndDistribution
Future<KillHouseSalesInfoDashboard?> getInfoDashboard({
required String token,
Map<String, dynamic>? queryParameters,
});
Future<PaginationModel<KillHouseBarsResponse>?> getBarsForKillHouse({
required String token,
Map<String, dynamic>? queryParameters,
});
//endregion
}

View File

@@ -0,0 +1,102 @@
import 'package:rasadyar_chicken/features/kill_house/data/data_source/remote/kill_house/kill_house_remote.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as ListModel;
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_core/core.dart';
import 'kill_house_repository.dart';
class KillHouseRepositoryImpl extends KillHouseRepository {
final KillHouseRemoteDataSource remoteDataSource;
KillHouseRepositoryImpl(this.remoteDataSource);
@override
Future<List<KillHouseResponse>?> getKillHouseList({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getKillHouseList(
token: token,
queryParameters: queryParameters,
);
}
@override
Future<ChickenCommissionPrices?> getCommissionPrice({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getCommissionPrice(
token: token,
queryParameters: queryParameters,
);
}
@override
Future<void> submitKillHouseRequest({
required String token,
required KillRequestResponse data,
}) async {
var jsonData = data.toJson();
return await remoteDataSource.submitKillHouseRequest(
token: token,
data: jsonData,
);
}
@override
Future<List<ListModel.KillRequestList>?> getListKillRequest({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getListKillRequest(
token: token,
queryParameters: queryParameters,
);
}
@override
Future<void> deleteKillRequest({
required String token,
required int requestId,
}) async {
await remoteDataSource.deleteKillRequest(
token: token,
requestId: requestId,
);
}
//endregion
//region warehouseAndDistribution
@override
Future<KillHouseSalesInfoDashboard?> getInfoDashboard({
required String token,
CancelToken? cancelToken,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getInfoDashboard(
token: token,
cancelToken: cancelToken,
queryParameters: queryParameters,
);
}
@override
Future<PaginationModel<KillHouseBarsResponse>?> getBarsForKillHouse({
required String token,
Map<String, dynamic>? queryParameters,
}) async {
return await remoteDataSource.getBarsForKillHouse(
token: token,
queryParameters: queryParameters,
);
}
//endregion
}

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/features/kill_house/data/repository/kill_house_repository.dart';
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/request/kill_request_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/chicken_commission_prices/chicken_commission_prices.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_house/kill_house_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as listModel;
import 'package:rasadyar_chicken/features/kill_house/root/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart'
import 'package:rasadyar_chicken/features/kill_house/data/model/register_request/response/kill_request_list/kill_request_list.dart'
as listModel
show KillRequestList;
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';

View File

@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
import 'package:rasadyar_core/core.dart';

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_core/core.dart';

View File

@@ -1,7 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
import 'package:rasadyar_core/core.dart';

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';

View File

@@ -3,9 +3,9 @@ import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.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/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/features/common/profile/view.dart';
import 'package:rasadyar_chicken/features/kill_house/data/model/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
import 'package:rasadyar_chicken/features/kill_house/data/repository/kill_house_repository.dart';
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/buy/view.dart';
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/home/view.dart';
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/view.dart';

View File

@@ -4,7 +4,7 @@ import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/s
import 'package:rasadyar_core/core.dart';
Widget farmInfoWidget({
required CreateInspectionBottomSheetLogic controller,
CreateInspectionBottomSheetLogic? controller,
required String title,
required Widget child,
EdgeInsets? padding,

View File

@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/card_info.dart';

View File

@@ -12,4 +12,6 @@ abstract class VetFarmRemoteDataSource {
required String token,
required SubmitInspectionResponse request,
});
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token});
}

View File

@@ -36,4 +36,20 @@ class VetFarmRemoteDataSourceImpl implements VetFarmRemoteDataSource {
data: request.toJson(),
);
}
@override
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token}) async {
DioRemote dio = DioRemote(baseUrl: "http://testbackend.rasadyaar.ir/");
await dio.init();
var res = await dio.get(
'inspection_form_sd_ui/',
fromJson: (json) {
return json;
},
);
return res;
}
}

View File

@@ -12,4 +12,7 @@ abstract class VetFarmRepository {
required String token,
required SubmitInspectionResponse request,
});
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token});
}

View File

@@ -27,4 +27,8 @@ class VetFarmRepositoryImpl implements VetFarmRepository {
}) async {
return await _remote.submitInspection(token: token, request: request);
}
@override
Future<DioResponse<Map<String, dynamic>>> getSDUIForm({String? token}) async {
return await _remote.getSDUIForm(token: token);
}
}

View File

@@ -21,5 +21,10 @@ class VetFarmHomeLogic extends GetxController {
route: VetFarmRoutes.newInspectionVetFarm,
icon: Assets.vec.activeFramSvg.path,
),
VetFarmHomeItem(
title: "صفحه جدید",
route: VetFarmRoutes.newPageVetFarm,
icon: Assets.vec.activeFramSvg.path,
),
].obs;
}

View File

@@ -0,0 +1,46 @@
import 'package:rasadyar_chicken/features/vet_farm/data/repositories/vet_farm_repository.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/root/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/sdui/widgets/text_form_filed/model/text_form_field_sdui_model.dart';
import 'package:rasadyar_core/core.dart';
class NewPageLogic extends GetxController {
VetFarmRootLogic rootLogic = Get.find<VetFarmRootLogic>();
Rxn<TextFormFieldSDUIModel> textFormFieldSDUIModel =
Rxn<TextFormFieldSDUIModel>();
@override
void onInit() {
super.onInit();
getSDUIForm();
}
@override
void onReady() {
super.onReady();
// Ready logic here
}
@override
void onClose() {
super.onClose();
// Cleanup logic here
}
Future<void> getSDUIForm() async {
await safeCall(
call: () async => await rootLogic.vetFarmRepository.getSDUIForm(),
onSuccess: (result) {
textFormFieldSDUIModel.value = TextFormFieldSDUIModel.fromJson(
result.data ?? {},
);
},
onError: (error, stackTrace) {
print(error);
},
);
}
void onButtonPressed() {}
}

View File

@@ -0,0 +1,44 @@
import 'package:flutter/material.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/sdui/widgets/text_form_filed/text_form_filed_sdui.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class NewPage extends GetView<NewPageLogic> {
const NewPage({super.key});
@override
Widget build(BuildContext context) {
return ChickenBasePage(
hasBack: true,
backId: vetFarmActionKey,
child: contentWidget(),
);
}
Widget contentWidget() {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ObxValue((data) {
if (data.value == null) {
return const SizedBox.shrink();
}
return textFormFiledSDUI(model: data.value!);
}, controller.textFormFieldSDUIModel),
SizedBox(height: 24.h),
RElevated(
text: 'دکمه نمونه',
onPressed: () {
controller.onButtonPressed();
},
),
],
),
);
}
}

View File

@@ -7,6 +7,8 @@ import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/active_hat
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/active_hatching/view.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_inspection/logic.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_inspection/view.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_page/logic.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/pages/new_page/view.dart';
import 'package:rasadyar_chicken/features/vet_farm/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
@@ -72,5 +74,18 @@ class VetFarmPages {
}),
],
),
GetPage(
name: VetFarmRoutes.newPageVetFarm,
page: () => NewPage(),
middlewares: [AuthMiddleware()],
bindings: [
GlobalBinding(),
BindingsBuilder(() {
Get.lazyPut(() => NewPageLogic());
}),
],
),
];
}

View File

@@ -7,4 +7,5 @@ sealed class VetFarmRoutes {
static const actionVetFarm = '$_base/action';
static const activeHatchingVetFarm = '$_base/activeHatching';
static const newInspectionVetFarm = '$_base/newInspection';
static const newPageVetFarm = '$_base/newPage';
}