fix : kill registration form and action page bg
This commit is contained in:
1
assets/icons/chicken_pattern.svg
Normal file
1
assets/icons/chicken_pattern.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 249 KiB |
BIN
assets/vec/chicken_pattern.svg.vec
Normal file
BIN
assets/vec/chicken_pattern.svg.vec
Normal file
Binary file not shown.
@@ -1,4 +1,5 @@
|
|||||||
import 'package:rasadyar_chicken/data/models/response/poultry_order/poultry_order.dart';
|
import 'package:rasadyar_chicken/data/models/response/poultry_order/poultry_order.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/killing_registration/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
@@ -7,6 +8,7 @@ class GenocideLogic extends GetxController {
|
|||||||
var tokenService = Get.find<TokenStorageService>();
|
var tokenService = Get.find<TokenStorageService>();
|
||||||
var gService = Get.find<GService>();
|
var gService = Get.find<GService>();
|
||||||
var rootLogic = Get.find<PoultryScienceRootLogic>();
|
var rootLogic = Get.find<PoultryScienceRootLogic>();
|
||||||
|
var killRegistration = Get.find<KillingRegistrationLogic>();
|
||||||
|
|
||||||
Rx<Resource<PaginationModel<PoultryOrder>>> poultryOrderList =
|
Rx<Resource<PaginationModel<PoultryOrder>>> poultryOrderList =
|
||||||
Resource<PaginationModel<PoultryOrder>>.loading().obs;
|
Resource<PaginationModel<PoultryOrder>>.loading().obs;
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ class GenocidePage extends GetView<GenocideLogic> {
|
|||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
killRegistrationBottomSheet(),
|
killRegistrationBottomSheet(),
|
||||||
);
|
).whenComplete(() {
|
||||||
|
controller.killRegistration.clearAllFields();
|
||||||
|
controller.killRegistration.onReady();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ class KillingRegistrationLogic extends GetxController {
|
|||||||
Rxn<PoultryExport> poultryExport = Rxn<PoultryExport>();
|
Rxn<PoultryExport> poultryExport = Rxn<PoultryExport>();
|
||||||
|
|
||||||
TextEditingController quantityKillsController = TextEditingController();
|
TextEditingController quantityKillsController = TextEditingController();
|
||||||
|
RxBool quantityKillsIsCompleted = false.obs;
|
||||||
TextEditingController quantityLoseController = TextEditingController(text: 0.toString());
|
TextEditingController quantityLoseController = TextEditingController(text: 0.toString());
|
||||||
TextEditingController averageWeightKillsController = TextEditingController();
|
TextEditingController averageWeightKillsController = TextEditingController();
|
||||||
|
RxBool averageWeightKillsIsCompleted = false.obs;
|
||||||
TextEditingController priceFreeSaleController = TextEditingController();
|
TextEditingController priceFreeSaleController = TextEditingController();
|
||||||
|
|
||||||
RxInt generatedApprovedPrice = 0.obs;
|
RxInt generatedApprovedPrice = 0.obs;
|
||||||
@@ -87,6 +89,7 @@ class KillingRegistrationLogic extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
super.onClose();
|
super.onClose();
|
||||||
@@ -102,7 +105,9 @@ class KillingRegistrationLogic extends GetxController {
|
|||||||
|
|
||||||
void priceListener() {
|
void priceListener() {
|
||||||
quantityKillsController.addListener(() {
|
quantityKillsController.addListener(() {
|
||||||
if (averageWeightKillsController.text.isNotEmpty && quantityKillsController.text.isNotEmpty) {
|
quantityKillsIsCompleted.value = quantityKillsController.text.trim().isNotEmpty;
|
||||||
|
|
||||||
|
if (averageWeightKillsController.text.isNotEmpty && quantityKillsController.text.trim().isNotEmpty) {
|
||||||
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
|
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
|
||||||
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
|
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
|
||||||
|
|
||||||
@@ -115,7 +120,10 @@ class KillingRegistrationLogic extends GetxController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
averageWeightKillsController.addListener(() {
|
averageWeightKillsController.addListener(() {
|
||||||
if (averageWeightKillsController.text.isNotEmpty && quantityKillsController.text.isNotEmpty) {
|
|
||||||
|
averageWeightKillsIsCompleted.value = averageWeightKillsController.text.trim().isNotEmpty;
|
||||||
|
|
||||||
|
if (averageWeightKillsController.text.trim().isNotEmpty && quantityKillsController.text.trim().isNotEmpty) {
|
||||||
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
|
generatedApprovedPrice.value = calculateApprovedPrice().toInt();
|
||||||
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
|
priceFreeSaleController.text = generatedApprovedPrice.value.separatedByComma;
|
||||||
checkSubmitButton();
|
checkSubmitButton();
|
||||||
@@ -356,10 +364,50 @@ class KillingRegistrationLogic extends GetxController {
|
|||||||
Get.back(id: poultryFirstKey);
|
Get.back(id: poultryFirstKey);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onError: (error, stackTrace) {},
|
onError: (error, stackTrace) {},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearAllFields() {
|
||||||
|
// ریست فرم
|
||||||
|
formKey.currentState?.reset();
|
||||||
|
|
||||||
|
// ریست Rxn ها
|
||||||
|
approvedPrice.value = null;
|
||||||
|
sellForFreezing.value = null;
|
||||||
|
poultryExport.value = null;
|
||||||
|
selectedPoultry.value = null;
|
||||||
|
selectedKillRequestPoultry.value = null;
|
||||||
|
selectedPoultryHatching.value = null;
|
||||||
|
selectedKillHouse.value = null;
|
||||||
|
|
||||||
|
// ریست Rx ها
|
||||||
|
killsDate.value = Jalali.now();
|
||||||
|
generatedApprovedPrice.value = 0;
|
||||||
|
isOnSubmitLoading.value = false;
|
||||||
|
isExportSelected.value = false;
|
||||||
|
isFreezedSelected.value = false;
|
||||||
|
isMarketSelected.value = false;
|
||||||
|
isFreeSale.value = false;
|
||||||
|
|
||||||
|
// ریست TextEditingController ها
|
||||||
|
quantityKillsController.clear();
|
||||||
|
quantityLoseController.text = '0';
|
||||||
|
averageWeightKillsController.clear();
|
||||||
|
priceFreeSaleController.clear();
|
||||||
|
|
||||||
|
// ریست RxBool ها
|
||||||
|
quantityKillsIsCompleted.value = false;
|
||||||
|
averageWeightKillsIsCompleted.value = false;
|
||||||
|
|
||||||
|
// ریست Resource لیستها
|
||||||
|
allPoultryList.value = Resource<List<AllPoultry>>.loading();
|
||||||
|
poultryList.value = Resource<List<KillRequestPoultry>>.success([]);
|
||||||
|
poultryHatchingList.value = Resource<List<PoultryHatching>>.success([]);
|
||||||
|
killHouseList.value = Resource<List<KillHousePoultry>>.success([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Form(
|
||||||
children: [
|
key: controller.formKey,
|
||||||
poultryFarmWidget(),
|
child: Column(
|
||||||
poultryUserListWidget(),
|
children: [
|
||||||
poultryHatchingWidget(),
|
poultryFarmWidget(),
|
||||||
ObxValue((data) {
|
poultryUserListWidget(),
|
||||||
return Visibility(
|
poultryHatchingWidget(),
|
||||||
visible: controller.selectedPoultryHatching.value != null,
|
ObxValue((data) {
|
||||||
child: Form(
|
return Visibility(
|
||||||
key: controller.formKey,
|
visible: controller.selectedPoultryHatching.value != null,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
informationWidget(),
|
informationWidget(),
|
||||||
@@ -33,18 +33,43 @@ class KillingRegistrationPage extends GetView<KillingRegistrationLogic> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
quantityKillsWidget(),
|
quantityKillsWidget(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}, controller.selectedPoultryHatching),
|
||||||
|
ObxValue((data) {
|
||||||
|
return Visibility(
|
||||||
|
visible: data.value,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
|
||||||
averageWeightKillsWidget(),
|
averageWeightKillsWidget(),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}, controller.quantityKillsIsCompleted),
|
||||||
|
|
||||||
|
ObxValue((data) {
|
||||||
|
return Visibility(
|
||||||
|
visible: data.value,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
|
||||||
saleTypeWidget(),
|
saleTypeWidget(),
|
||||||
priceWidget(),
|
priceWidget(),
|
||||||
buyerListWidget(),
|
buyerListWidget(),
|
||||||
slaughterhouseSelectedWidget(),
|
slaughterhouseSelectedWidget(),
|
||||||
submitButtonWidget(),
|
submitButtonWidget(),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}, controller.averageWeightKillsIsCompleted),
|
||||||
}, controller.selectedPoultryHatching),
|
|
||||||
],
|
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,13 @@ class PoultryActionPage extends GetView<PoultryActionLogic> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: chickenAppBar(hasBack: false, hasFilter: false, hasSearch: false, isBase: false),
|
appBar: chickenAppBar(hasBack: false, hasFilter: false, hasSearch: false, isBase: false),
|
||||||
body: Container(
|
body: Stack(
|
||||||
decoration: BoxDecoration(
|
fit: StackFit.expand,
|
||||||
image: DecorationImage(
|
children: [
|
||||||
image: AssetImage(Assets.images.bgChickenPattern.path),
|
Positioned.fill(child: Assets.vec.chickenPatternSvg.svg(fit: BoxFit.cover,)),
|
||||||
fit: BoxFit.cover,
|
Positioned.fill(child: gridWidget()),
|
||||||
),
|
],
|
||||||
),
|
)
|
||||||
child: gridWidget(),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ class $AssetsIconsGen {
|
|||||||
/// File path: assets/icons/chicken_map_marker.svg
|
/// File path: assets/icons/chicken_map_marker.svg
|
||||||
SvgGenImage get chickenMapMarker => const SvgGenImage('assets/icons/chicken_map_marker.svg');
|
SvgGenImage get chickenMapMarker => const SvgGenImage('assets/icons/chicken_map_marker.svg');
|
||||||
|
|
||||||
|
/// File path: assets/icons/chicken_pattern.svg
|
||||||
|
SvgGenImage get chickenPattern => const SvgGenImage('assets/icons/chicken_pattern.svg');
|
||||||
|
|
||||||
/// File path: assets/icons/clipboard_eye.svg
|
/// File path: assets/icons/clipboard_eye.svg
|
||||||
SvgGenImage get clipboardEye => const SvgGenImage('assets/icons/clipboard_eye.svg');
|
SvgGenImage get clipboardEye => const SvgGenImage('assets/icons/clipboard_eye.svg');
|
||||||
|
|
||||||
@@ -350,6 +353,7 @@ class $AssetsIconsGen {
|
|||||||
chicken,
|
chicken,
|
||||||
chickenHouse,
|
chickenHouse,
|
||||||
chickenMapMarker,
|
chickenMapMarker,
|
||||||
|
chickenPattern,
|
||||||
clipboardEye,
|
clipboardEye,
|
||||||
clipboardTask,
|
clipboardTask,
|
||||||
clock,
|
clock,
|
||||||
@@ -549,6 +553,9 @@ class $AssetsVecGen {
|
|||||||
/// File path: assets/vec/chicken_map_marker.svg.vec
|
/// File path: assets/vec/chicken_map_marker.svg.vec
|
||||||
SvgGenImage get chickenMapMarkerSvg => const SvgGenImage.vec('assets/vec/chicken_map_marker.svg.vec');
|
SvgGenImage get chickenMapMarkerSvg => const SvgGenImage.vec('assets/vec/chicken_map_marker.svg.vec');
|
||||||
|
|
||||||
|
/// File path: assets/vec/chicken_pattern.svg.vec
|
||||||
|
SvgGenImage get chickenPatternSvg => const SvgGenImage.vec('assets/vec/chicken_pattern.svg.vec');
|
||||||
|
|
||||||
/// File path: assets/vec/clipboard_eye.svg.vec
|
/// File path: assets/vec/clipboard_eye.svg.vec
|
||||||
SvgGenImage get clipboardEyeSvg => const SvgGenImage.vec('assets/vec/clipboard_eye.svg.vec');
|
SvgGenImage get clipboardEyeSvg => const SvgGenImage.vec('assets/vec/clipboard_eye.svg.vec');
|
||||||
|
|
||||||
@@ -810,6 +817,7 @@ class $AssetsVecGen {
|
|||||||
chickenSvg,
|
chickenSvg,
|
||||||
chickenHouseSvg,
|
chickenHouseSvg,
|
||||||
chickenMapMarkerSvg,
|
chickenMapMarkerSvg,
|
||||||
|
chickenPatternSvg,
|
||||||
clipboardEyeSvg,
|
clipboardEyeSvg,
|
||||||
clipboardTaskSvg,
|
clipboardTaskSvg,
|
||||||
clockSvg,
|
clockSvg,
|
||||||
|
|||||||
Reference in New Issue
Block a user