|
|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
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/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
|
|
|
@ -11,10 +12,16 @@ import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/generic_attachment_model.dart';
|
|
|
|
|
import 'package:test_sa/models/timer_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/cm_module/utilities/service_request_utils.dart';
|
|
|
|
|
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/models/equipment_internal_audit_data_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/models/internal_audit_timer_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/models/system_internal_audit_data_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/models/update_audit_form_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/models/internal_audit_attachment_model.dart';
|
|
|
|
|
import 'package:test_sa/modules/internal_audit_module/provider/internal_audit_provider.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/working_time_tile.dart';
|
|
|
|
|
@ -23,168 +30,149 @@ import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/timer/app_timer.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/total_working_time_detail_bottomsheet.dart';
|
|
|
|
|
|
|
|
|
|
class UpdateInternalAuditPage extends StatefulWidget {
|
|
|
|
|
class UpdateSystemInternalAuditPage extends StatefulWidget {
|
|
|
|
|
static const String id = "update-system-internal-audit";
|
|
|
|
|
//Need to pass system model here.
|
|
|
|
|
final EquipmentInternalAuditDataModel ?model;
|
|
|
|
|
SystemInternalAuditDataModel? model;
|
|
|
|
|
|
|
|
|
|
const UpdateInternalAuditPage({this.model, Key? key}) : super(key: key);
|
|
|
|
|
UpdateSystemInternalAuditPage({Key? key, this.model}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<UpdateInternalAuditPage> createState() => _UpdateInternalAuditPageState();
|
|
|
|
|
State<UpdateSystemInternalAuditPage> createState() => _UpdateSystemInternalAuditPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _UpdateInternalAuditPageState extends State<UpdateInternalAuditPage> {
|
|
|
|
|
class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAuditPage> {
|
|
|
|
|
final bool _isLoading = false;
|
|
|
|
|
double totalWorkingHours = 0.0;
|
|
|
|
|
late UserProvider _userProvider;
|
|
|
|
|
final TextEditingController _commentController = TextEditingController();
|
|
|
|
|
AuditFormModel formModel = AuditFormModel();
|
|
|
|
|
final TextEditingController _workingHoursController = TextEditingController();
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
bool _firstTime = true;
|
|
|
|
|
List<GenericAttachmentModel> _attachments = [];
|
|
|
|
|
|
|
|
|
|
//TODO need to check if it's needed or not..
|
|
|
|
|
List<TimerHistoryModel> timerList = [];
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
populateForm();
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void calculateWorkingTime() {
|
|
|
|
|
// final timers = _formModel.gasRefillTimers ?? [];
|
|
|
|
|
// totalWorkingHours = timers.fold<double>(0.0, (sum, item) {
|
|
|
|
|
// if (item.startDate == null || item.endDate == null) return sum;
|
|
|
|
|
// try {
|
|
|
|
|
// final start = DateTime.parse(item.startDate!);
|
|
|
|
|
// final end = DateTime.parse(item.endDate!);
|
|
|
|
|
// final diffInHours = end.difference(start).inSeconds / 3600.0; // convert to hours
|
|
|
|
|
// return sum + diffInHours;
|
|
|
|
|
// } catch (_) {
|
|
|
|
|
// return sum;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// timerList = timers.map((e) {
|
|
|
|
|
// return TimerHistoryModel(
|
|
|
|
|
// id: e.id,
|
|
|
|
|
// startTime: e.startDate,
|
|
|
|
|
// endTime: e.endDate,
|
|
|
|
|
// workingHours: e.workingHours,
|
|
|
|
|
// );
|
|
|
|
|
// }).toList();
|
|
|
|
|
void populateForm() {
|
|
|
|
|
formModel.requestId = widget.model?.id;
|
|
|
|
|
formModel.id = widget.model?.id;
|
|
|
|
|
_attachments = widget.model?.engineerData?.attachments?.map((e) => GenericAttachmentModel(id: e.id?.toInt() ?? 0, name: e.name!)).toList() ?? [];
|
|
|
|
|
|
|
|
|
|
calculateWorkingTime();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void setState(VoidCallback fn) {
|
|
|
|
|
if (mounted) super.setState(() {});
|
|
|
|
|
void calculateWorkingTime() {
|
|
|
|
|
final helperModel = formModel;
|
|
|
|
|
final timers = helperModel.auditTimers ?? [];
|
|
|
|
|
totalWorkingHours = timers.fold<double>(0.0, (sum, item) {
|
|
|
|
|
if (item.startDate == null || item.endDate == null) return sum;
|
|
|
|
|
try {
|
|
|
|
|
final start = DateTime.parse(item.startDate!);
|
|
|
|
|
final end = DateTime.parse(item.endDate!);
|
|
|
|
|
final diffInHours = end.difference(start).inSeconds / 3600.0; // convert to hours
|
|
|
|
|
return sum + diffInHours;
|
|
|
|
|
} catch (_) {
|
|
|
|
|
return sum;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
timerList = timers.map((e) {
|
|
|
|
|
return TimerHistoryModel(
|
|
|
|
|
id: e.id,
|
|
|
|
|
startTime: e.startDate,
|
|
|
|
|
endTime: e.endDate,
|
|
|
|
|
workingHours: e.startDate,
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_onSubmit(BuildContext context, int status) async {
|
|
|
|
|
_onSubmit(BuildContext context) async {
|
|
|
|
|
bool isTimerPickerEnable = ApiManager.instance.assetGroup?.enabledEngineerTimer ?? false;
|
|
|
|
|
InternalAuditProvider provider = Provider.of<InternalAuditProvider>(context, listen: false);
|
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
|
|
|
|
|
|
// if (isTimerPickerEnable) {
|
|
|
|
|
// if (_formModel.timer?.startAt == null && _formModel.gasRefillTimePicker == null) {
|
|
|
|
|
// Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// if (_formModel.gasRefillTimePicker == null) {
|
|
|
|
|
// if (_formModel.timer?.startAt == null) {
|
|
|
|
|
// Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// if (_formModel.timer?.endAt == null) {
|
|
|
|
|
// Fluttertoast.showToast(msg: "Please Stop The Timer");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (_formModel.timer?.startAt == null) {
|
|
|
|
|
// Fluttertoast.showToast(msg: "Working Hours Required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// if (_formModel.timer?.endAt == null) {
|
|
|
|
|
// Fluttertoast.showToast(msg: "Please Stop The Timer");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (_currentDetails.deliverdQty == null) {
|
|
|
|
|
// await Fluttertoast.showToast(msg: "Delivered Quantity is Required");
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// _formModel.gasRefillDetails = [];
|
|
|
|
|
// _formModel.gasRefillDetails?.add(_currentDetails);
|
|
|
|
|
//
|
|
|
|
|
// showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
|
// _formModel.gasRefillTimers = _formModel.gasRefillTimers ?? [];
|
|
|
|
|
// if (_formModel.gasRefillTimePicker != null) {
|
|
|
|
|
// int durationInSecond = _formModel.gasRefillTimePicker!.endAt!.difference(_formModel.gasRefillTimePicker!.startAt!).inSeconds;
|
|
|
|
|
// _formModel.gasRefillTimers?.add(
|
|
|
|
|
// GasRefillTimer(
|
|
|
|
|
// id: 0,
|
|
|
|
|
// startDate: _formModel.gasRefillTimePicker!.startAt!.toIso8601String(), // Handle potential null
|
|
|
|
|
// endDate: _formModel.gasRefillTimePicker!.endAt?.toIso8601String(), // Handle potential null
|
|
|
|
|
// workingHours: ((durationInSecond) / 60 / 60),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// _formModel.timerModelList?.forEach((timer) {
|
|
|
|
|
// int durationInSecond = timer.endAt!.difference(timer.startAt!).inSeconds;
|
|
|
|
|
// _formModel.gasRefillTimers?.add(
|
|
|
|
|
// GasRefillTimer(
|
|
|
|
|
// id: 0,
|
|
|
|
|
// startDate: timer.startAt!.toIso8601String(), // Handle potential null
|
|
|
|
|
// endDate: timer.endAt?.toIso8601String(), // Handle potential null
|
|
|
|
|
// workingHours: ((durationInSecond) / 60 / 60),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// });
|
|
|
|
|
// _formModel.gasRefillAttachments = [];
|
|
|
|
|
// for (var item in _attachments) {
|
|
|
|
|
// String fileName = ServiceRequestUtils.isLocalUrl(item.name??'') ? ("${item.name??''.split("/").last}|${base64Encode(File(item.name??'').readAsBytesSync())}") :item.name??'';
|
|
|
|
|
// _formModel.gasRefillAttachments?.add(GasRefillAttachments(
|
|
|
|
|
// id: item.id, gasRefillId: _formModel.id ?? 0, attachmentName: fileName));
|
|
|
|
|
// }
|
|
|
|
|
formModel.auditTimers ??= [];
|
|
|
|
|
if (formModel.auditTimePicker != null) {
|
|
|
|
|
int durationInSecond = formModel.auditTimePicker!.endAt!.difference(formModel.auditTimePicker!.startAt!).inSeconds;
|
|
|
|
|
formModel.auditTimers?.add(
|
|
|
|
|
InternalAuditTimerModel(
|
|
|
|
|
id: 0,
|
|
|
|
|
startDate: formModel.auditTimePicker!.startAt!.toIso8601String(), // Handle potential null
|
|
|
|
|
endDate: formModel.auditTimePicker!.endAt?.toIso8601String(), // Handle potential null
|
|
|
|
|
totalWorkingHour: ((durationInSecond) / 60 / 60),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
formModel.timerModelList?.forEach((timer) {
|
|
|
|
|
int durationInSecond = timer.endAt!.difference(timer.startAt!).inSeconds;
|
|
|
|
|
formModel.auditTimers?.add(
|
|
|
|
|
InternalAuditTimerModel(
|
|
|
|
|
id: 0,
|
|
|
|
|
startDate: timer.startAt!.toIso8601String(), // Handle potential null
|
|
|
|
|
endDate: timer.endAt?.toIso8601String(), // Handle potential null
|
|
|
|
|
totalWorkingHour: ((durationInSecond) / 60 / 60),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// await _gasRefillProvider?.updateGasRefill(status: status, model: _formModel).then((success) {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// if (success) {
|
|
|
|
|
// if (status == 1) {
|
|
|
|
|
// AllRequestsProvider allRequestsProvider = Provider.of<AllRequestsProvider>(context, listen: false);
|
|
|
|
|
// // when click complete then this request remove from the list and status changes to closed..
|
|
|
|
|
// _gasRefillProvider?.reset();
|
|
|
|
|
// allRequestsProvider.getAllRequests(context, typeTransaction: 2);
|
|
|
|
|
// }
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
_formKey.currentState!.save();
|
|
|
|
|
formModel.attachments = [];
|
|
|
|
|
for (var item in _attachments) {
|
|
|
|
|
String fileName = ServiceRequestUtils.isLocalUrl(item.name ?? '') ? ("${item.name?.split("/").last}|${base64Encode(File(item.name ?? '').readAsBytesSync())}") : item.name ?? '';
|
|
|
|
|
formModel.attachments!.add(
|
|
|
|
|
InternalAuditAttachments(
|
|
|
|
|
id: item.id,
|
|
|
|
|
// originalName: fileName,
|
|
|
|
|
name: fileName,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
log('submit press');
|
|
|
|
|
log('data ${formModel.toJson()}');
|
|
|
|
|
final success = await provider.updateSystemInternalAudit(model: formModel);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (formModel.isComplete == true) {
|
|
|
|
|
//Navigate to List screen.
|
|
|
|
|
} else if (formModel.isComplete == false) {
|
|
|
|
|
if (success) {
|
|
|
|
|
Navigator.of(context).pop(true);
|
|
|
|
|
} else {
|
|
|
|
|
Fluttertoast.showToast(msg: 'Failed to update');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_commentController.dispose();
|
|
|
|
|
_workingHoursController.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void updateTimer({TimerModel? timer}) {
|
|
|
|
|
// _formModel.timer = timer;
|
|
|
|
|
// if (timer?.startAt != null && timer?.endAt != null) {
|
|
|
|
|
// _formModel.timerModelList = _formModel.timerModelList ?? [];
|
|
|
|
|
// _formModel.timerModelList!.add(timer!);
|
|
|
|
|
// }
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
if (timer?.startAt != null && timer?.endAt != null) {
|
|
|
|
|
final start = timer!.startAt!;
|
|
|
|
|
final end = timer.endAt!;
|
|
|
|
|
|
|
|
|
|
final difference = end.difference(start);
|
|
|
|
|
final totalHours = difference.inSeconds / 3600.0;
|
|
|
|
|
formModel.startTime = start;
|
|
|
|
|
formModel.endTime = end;
|
|
|
|
|
formModel.totalHours = totalHours;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
_userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: DefaultAppBar(
|
|
|
|
|
title: 'Update Information'.addTranslation,
|
|
|
|
|
onWillPopScope: () {
|
|
|
|
|
_onSubmit(context, 0);
|
|
|
|
|
formModel.isComplete = false;
|
|
|
|
|
_onSubmit(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
key: _scaffoldKey,
|
|
|
|
|
@ -210,21 +198,22 @@ class _UpdateInternalAuditPageState extends State<UpdateInternalAuditPage> {
|
|
|
|
|
hintStyle: TextStyle(color: context.isDark ? AppColor.white10 : AppColor.black10),
|
|
|
|
|
labelStyle: TextStyle(color: context.isDark ? AppColor.white10 : AppColor.black10),
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
initialValue: formModel.debrief,
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
controller: _commentController,
|
|
|
|
|
onChange: (value) {},
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
formModel.debrief = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
_timerWidget(context, totalWorkingHours),
|
|
|
|
|
16.height,
|
|
|
|
|
AttachmentPicker(
|
|
|
|
|
label: context.translation.attachFiles,
|
|
|
|
|
label: 'Upload Attachment',
|
|
|
|
|
attachment: _attachments,
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
onlyImages: false,
|
|
|
|
|
buttonIcon: 'image-plus'.toSvgAsset(
|
|
|
|
|
buttonIcon: 'attachment_icon'.toSvgAsset(
|
|
|
|
|
color: AppColor.primary10,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -238,17 +227,22 @@ class _UpdateInternalAuditPageState extends State<UpdateInternalAuditPage> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: [
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
label: context.translation.save,
|
|
|
|
|
buttonColor: context.isDark ? AppColor.neutral70 : AppColor.white60,
|
|
|
|
|
textColor: context.isDark ? AppColor.white10 : AppColor.black10,
|
|
|
|
|
onPressed: () => _onSubmit(context, 0),
|
|
|
|
|
).expanded,
|
|
|
|
|
label: context.translation.save,
|
|
|
|
|
buttonColor: context.isDark ? AppColor.neutral70 : AppColor.white60,
|
|
|
|
|
textColor: context.isDark ? AppColor.white10 : AppColor.black10,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
log('button press ');
|
|
|
|
|
formModel.isComplete = false;
|
|
|
|
|
_onSubmit(context);
|
|
|
|
|
}).expanded,
|
|
|
|
|
12.width,
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
label: context.translation.complete,
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
onPressed: () => _onSubmit(context, 1),
|
|
|
|
|
).expanded,
|
|
|
|
|
label: context.translation.complete,
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formModel.isComplete = true;
|
|
|
|
|
_onSubmit(context);
|
|
|
|
|
}).expanded,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -258,35 +252,52 @@ class _UpdateInternalAuditPageState extends State<UpdateInternalAuditPage> {
|
|
|
|
|
).handlePopScope(
|
|
|
|
|
cxt: context,
|
|
|
|
|
onSave: () {
|
|
|
|
|
_onSubmit(context, 0);
|
|
|
|
|
formModel.isComplete = false;
|
|
|
|
|
_onSubmit(context);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _timerWidget(BuildContext context, double totalWorkingHours) {
|
|
|
|
|
TimerModel? timer = TimerModel();
|
|
|
|
|
TimerModel? timerPicker;
|
|
|
|
|
List<TimerModel>? timerModelList = [];
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
// AppTimer(
|
|
|
|
|
// label: context.translation.timer,
|
|
|
|
|
// timer: formModel.auditTimerModel,
|
|
|
|
|
// // enabled: enableTimer,
|
|
|
|
|
// pickerTimer: formModel.auditTimePicker,
|
|
|
|
|
// pickerFromDate: DateTime.tryParse(widget.model?.createdDate ?? ''),
|
|
|
|
|
// onPick: (time) {
|
|
|
|
|
// formModel.auditTimePicker = time;
|
|
|
|
|
// },
|
|
|
|
|
// timerProgress: (isRunning) {},
|
|
|
|
|
// onChange: (timer) async {
|
|
|
|
|
// formModel.auditTimerModel = timer;
|
|
|
|
|
// if (timer.startAt != null && timer.endAt != null) {
|
|
|
|
|
// formModel.timerModelList = formModel.timerModelList ?? [];
|
|
|
|
|
// formModel.timerModelList!.add(timer);
|
|
|
|
|
// }
|
|
|
|
|
// return true;
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
AppTimer(
|
|
|
|
|
label: context.translation.workingHours,
|
|
|
|
|
timer: timer,
|
|
|
|
|
// pickerFromDate: DateTime.tryParse(widget.gasRefillModel?.createdDate ?? ''),
|
|
|
|
|
pickerFromDate: DateTime.tryParse(''),
|
|
|
|
|
pickerTimer: timerPicker,
|
|
|
|
|
timer: formModel.auditTimerModel,
|
|
|
|
|
pickerFromDate: DateTime.tryParse(widget.model?.createdDate ?? ''),
|
|
|
|
|
pickerTimer: formModel.auditTimePicker,
|
|
|
|
|
onPick: (time) {
|
|
|
|
|
//timerPicker = time;
|
|
|
|
|
updateTimer(timer: time);
|
|
|
|
|
},
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColor.fieldBgColor(context),
|
|
|
|
|
// color: AppColor.neutral100,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
timerProgress: (isRunning) {},
|
|
|
|
|
onChange: (timer) async {
|
|
|
|
|
updateTimer(timer: timer);
|
|
|
|
|
log('here onChange ${timer.startAt}');
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|