|
|
|
|
@ -4,6 +4,7 @@ import 'dart:io';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
@ -552,14 +553,34 @@ class _UpdateTaskRequestState extends State<UpdateTaskRequest> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool validate({TaskData? model}) {
|
|
|
|
|
if (model?.taskTimerModel?.startAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (model?.taskTimerModel?.endAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Please Stop The Timer");
|
|
|
|
|
return false;
|
|
|
|
|
bool isTimerPickerEnable = ApiManager.instance.assetGroup?.enabledEngineerTimer ?? false;
|
|
|
|
|
|
|
|
|
|
if (isTimerPickerEnable) {
|
|
|
|
|
if (model?.taskTimerModel?.startAt == null && model?.taskTimePicker == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (model?.taskTimePicker == null) {
|
|
|
|
|
if (model?.taskTimerModel?.startAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (model?.taskTimerModel?.endAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Please Stop The Timer");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (model?.taskTimerModel?.startAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (model?.taskTimerModel?.endAt == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Please Stop The Timer");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model?.assistantEmployees != null) {
|
|
|
|
|
if (model?.modelAssistantEmployees?.startDate == null) {
|
|
|
|
|
Fluttertoast.showToast(msg: "Please Select Assistant Employee Start Time");
|
|
|
|
|
|