feat : segment page
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user