feat : segment page

This commit is contained in:
2025-07-15 09:03:11 +03:30
parent f79a3ae46f
commit b1496b1ed0
15 changed files with 63 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rasadyar_auth/data/utils/safe_call.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
@@ -75,10 +76,8 @@ class SegmentationLogic extends GetxController {
void clearForm() {
weightController.text = '0';
isSubmitButtonEnabled.value = false;
selectedProduct.value = null;
selectedSegment.value = null;
formKey.currentState?.reset();
}
void validateForm() {
@@ -142,6 +141,7 @@ class SegmentationLogic extends GetxController {
Future<void> deleteSegmentation(String key) async {
await safeCall(
showError: true,
call: () => rootLogic.chickenRepository.deleteSegmentation(
token: rootLogic.tokenService.accessToken.value!,
key: key,
@@ -152,6 +152,7 @@ class SegmentationLogic extends GetxController {
Future<bool> editSegment() async {
var res = true;
safeCall(
showError: true,
call: () async => await rootLogic.chickenRepository.editSegmentation(
token: rootLogic.tokenService.accessToken.value!,
model: SegmentationModel(