fix : ui fix after release 1.3.3

This commit is contained in:
2025-07-17 15:44:40 +03:30
parent c28a0e6630
commit 7790a4017e
18 changed files with 898 additions and 207 deletions

View File

@@ -82,10 +82,7 @@ class SegmentationLogic extends GetxController {
void validateForm() {
var weight = int.tryParse(weightController.text.clearComma.trim());
isSubmitButtonEnabled.value =
selectedProduct.value != null &&
weightController.text.isNotEmpty &&
weight! > 0
;
selectedProduct.value != null && weightController.text.isNotEmpty && weight! > 0;
}
Future<void> getAllSegmentation([bool isLoadingMore = false]) async {
@@ -155,7 +152,7 @@ class SegmentationLogic extends GetxController {
token: rootLogic.tokenService.accessToken.value!,
model: SegmentationModel(
key: selectedSegment.value?.key,
weight: int.tryParse(weightController.text) ?? 0,
weight: int.tryParse(weightController.text.clearComma) ?? 0,
),
),
onSuccess: (result) {
@@ -170,13 +167,16 @@ class SegmentationLogic extends GetxController {
Future<bool> createSegment() async {
var res = true;
SegmentationModel segmentationModel = SegmentationModel(
productKey: selectedProduct.value?.key,
weight: int.tryParse(weightController.text.clearComma) ?? 0,
);
iLog(segmentationModel.toString());
safeCall(
call: () async => await rootLogic.chickenRepository.createSegmentation(
token: rootLogic.tokenService.accessToken.value!,
model: SegmentationModel(
key: selectedProduct.value?.key,
weight: int.tryParse(weightController.text) ?? 0,
),
model: segmentationModel,
),
onSuccess: (result) {
res = true;

View File

@@ -283,7 +283,7 @@ class SegmentationPage extends GetView<SegmentationLogic> {
? await controller.editSegment()
: await controller.createSegment();
if (res) {
controller.getAllSegmentation();
await controller.getAllSegmentation();
controller.clearForm();
Get.back();
}