|
|
|
@@ -5,10 +5,13 @@ import 'package:farm_tpf/custom_model/NurseryDetail.dart'; |
|
|
|
import 'package:farm_tpf/custom_model/Supply.dart'; |
|
|
|
import 'package:farm_tpf/data/api/app_exception.dart'; |
|
|
|
import 'package:farm_tpf/data/repository/repository.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/button_widget.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_field_time_picker.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_loading.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_media_picker.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_text_field_description.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_text_form_field.dart'; |
|
|
|
import 'package:farm_tpf/presentation/custom_widgets/widget_utils.dart'; |
|
|
|
import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; |
|
|
|
@@ -46,6 +49,7 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); |
|
|
|
final _repository = Repository(); |
|
|
|
GlobalKey<FormState> _formKey = GlobalKey(); |
|
|
|
GlobalKey<FormState> _formWorkerKey = GlobalKey(); |
|
|
|
bool _autoValidate = false; |
|
|
|
Nursery _nursery = Nursery(); |
|
|
|
var pref = LocalPref(); |
|
|
|
@@ -209,14 +213,11 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
} |
|
|
|
|
|
|
|
Widget _desciptionField() { |
|
|
|
return TextFormField( |
|
|
|
keyboardType: TextInputType.text, |
|
|
|
decoration: InputDecoration(labelText: "Ghi chú"), |
|
|
|
controller: _descriptionController, |
|
|
|
onSaved: (newValue) { |
|
|
|
_nursery.description = newValue; |
|
|
|
}, |
|
|
|
); |
|
|
|
return TextFieldDescriptionWidget( |
|
|
|
controller: _descriptionController, |
|
|
|
onSaved: (newValue) { |
|
|
|
_nursery.description = newValue; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _executeByField() { |
|
|
|
@@ -251,53 +252,59 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
} |
|
|
|
}, builder: (context, state) { |
|
|
|
return Container( |
|
|
|
padding: EdgeInsets.all(8.0), |
|
|
|
decoration: BoxDecoration( |
|
|
|
shape: BoxShape.rectangle, |
|
|
|
borderRadius: BorderRadius.circular(10), |
|
|
|
color: Colors.white, |
|
|
|
border: Border.all(color: AppColors.DEFAULT)), |
|
|
|
child: Form( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
TextFormField( |
|
|
|
keyboardType: TextInputType.text, |
|
|
|
controller: _workerNameController, |
|
|
|
decoration: InputDecoration(labelText: "Tên công nhân *"), |
|
|
|
validator: (value) { |
|
|
|
return Validators.validateNotNullOrEmpty( |
|
|
|
value, "Tên công nhân"); |
|
|
|
}, |
|
|
|
onSaved: (newValue) {}, |
|
|
|
), |
|
|
|
TextFormField( |
|
|
|
keyboardType: TextInputType.text, |
|
|
|
controller: _trayNumberController, |
|
|
|
decoration: InputDecoration(labelText: "Ươm khây số"), |
|
|
|
onSaved: (newValue) {}, |
|
|
|
), |
|
|
|
Align( |
|
|
|
alignment: Alignment.centerRight, |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
isResetForm |
|
|
|
? Container() |
|
|
|
: OutlineButton( |
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
borderRadius: |
|
|
|
new BorderRadius.circular(8.0)), |
|
|
|
child: Text("Huỷ"), |
|
|
|
onPressed: () { |
|
|
|
context |
|
|
|
.bloc<StatusAddFormBloc>() |
|
|
|
.add(Reset()); |
|
|
|
}), |
|
|
|
FlatButton( |
|
|
|
color: AppColors.DEFAULT, |
|
|
|
key: _formWorkerKey, |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.all(8.0), |
|
|
|
margin: EdgeInsets.all(8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
shape: BoxShape.rectangle, |
|
|
|
borderRadius: BorderRadius.circular(10), |
|
|
|
color: Colors.white, |
|
|
|
border: Border.all(color: Colors.grey[300])), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
TextFormField( |
|
|
|
keyboardType: TextInputType.text, |
|
|
|
controller: _workerNameController, |
|
|
|
decoration: InputDecoration(labelText: "Tên công nhân *"), |
|
|
|
validator: (value) { |
|
|
|
return Validators.validateNotNullOrEmpty( |
|
|
|
value, "Tên công nhân"); |
|
|
|
}, |
|
|
|
onSaved: (newValue) {}, |
|
|
|
), |
|
|
|
TextFormField( |
|
|
|
keyboardType: TextInputType.text, |
|
|
|
controller: _trayNumberController, |
|
|
|
decoration: InputDecoration(labelText: "Ươm khây số"), |
|
|
|
onSaved: (newValue) {}, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.all(8), |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
mainAxisSize: MainAxisSize.max, |
|
|
|
children: [ |
|
|
|
isResetForm |
|
|
|
? Container() |
|
|
|
: OutlineButton( |
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
borderRadius: new BorderRadius.circular(8.0)), |
|
|
|
child: Text("Huỷ"), |
|
|
|
onPressed: () { |
|
|
|
context.bloc<StatusAddFormBloc>().add(Reset()); |
|
|
|
}), |
|
|
|
Expanded( |
|
|
|
child: FlatButton( |
|
|
|
onPressed: () { |
|
|
|
if (_formWorkerKey.currentState.validate()) { |
|
|
|
_formWorkerKey.currentState.save(); |
|
|
|
if (Validators.stringNotNullOrEmpty( |
|
|
|
_workerNameController.text)) { |
|
|
|
NurseryDetail _nurseryDetail = NurseryDetail() |
|
|
|
@@ -320,17 +327,23 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
Utils.showSnackBarWarning( |
|
|
|
message: "Vui lòng nhập tên công nhân"); |
|
|
|
} |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
(state is Edit) ? "Sửa" : "Thêm", |
|
|
|
style: TextStyle(color: Colors.white), |
|
|
|
)) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
} else { |
|
|
|
// |
|
|
|
} |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
(state is Edit) |
|
|
|
? "Sửa người thực hiện" |
|
|
|
: "+ Thêm người thực hiện", |
|
|
|
style: TextStyle(color: Colors.blue), |
|
|
|
)), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
)); |
|
|
|
], |
|
|
|
), |
|
|
|
)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
@@ -435,40 +448,6 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
_actionAppBar() { |
|
|
|
IconButton iconButton; |
|
|
|
if (1 == 1) { |
|
|
|
iconButton = IconButton( |
|
|
|
icon: Icon( |
|
|
|
Icons.done, |
|
|
|
color: Colors.black, |
|
|
|
), |
|
|
|
onPressed: () { |
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context); |
|
|
|
if (!currentFocus.hasPrimaryFocus) { |
|
|
|
currentFocus.unfocus(); |
|
|
|
} |
|
|
|
if (!Validators.stringNotNullOrEmpty(_workerNameController.text) && |
|
|
|
!Validators.stringNotNullOrEmpty(_trayNumberController.text)) { |
|
|
|
_validateInputs(); |
|
|
|
} else { |
|
|
|
Utils.showDialog( |
|
|
|
title: "Tên công nhân hoặc khây trồng đang cập nhật", |
|
|
|
message: "Bạn có muốn cập nhật?", |
|
|
|
textConfirm: "Tiếp tục", |
|
|
|
textCancel: "Xem lại", |
|
|
|
onConfirm: () { |
|
|
|
Get.back(); |
|
|
|
_validateInputs(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
); |
|
|
|
return <Widget>[iconButton]; |
|
|
|
} |
|
|
|
return <Widget>[Container()]; |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) => KeyboardDismisser( |
|
|
|
gestures: [ |
|
|
|
@@ -476,11 +455,22 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
GestureType.onPanUpdateDownDirection, |
|
|
|
], |
|
|
|
child: Scaffold( |
|
|
|
backgroundColor: Colors.white, |
|
|
|
key: _scaffoldKey, |
|
|
|
appBar: AppBar( |
|
|
|
centerTitle: true, |
|
|
|
title: Text(plot_action_nursery), |
|
|
|
actions: _actionAppBar()), |
|
|
|
appBar: AppBarWidget( |
|
|
|
isBack: true, |
|
|
|
action: InkWell( |
|
|
|
child: Text( |
|
|
|
'Huỷ', |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.red, fontWeight: FontWeight.normal), |
|
|
|
), |
|
|
|
onTap: () { |
|
|
|
if (Get.isSnackbarOpen) Get.back(); |
|
|
|
Get.back(); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
body: KeyboardDismisser( |
|
|
|
child: MultiBlocProvider( |
|
|
|
providers: [ |
|
|
|
@@ -505,141 +495,217 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> { |
|
|
|
child: Form( |
|
|
|
key: _formKey, |
|
|
|
autovalidate: _autoValidate, |
|
|
|
child: SingleChildScrollView( |
|
|
|
padding: EdgeInsets.all(8.0), |
|
|
|
child: BlocConsumer<ActionDetailBloc, |
|
|
|
ActionDetailState>( |
|
|
|
listener: (context, state) async { |
|
|
|
if (state is ActionDetailFailure) { |
|
|
|
print("fail"); |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
} else if (state is ActionDetailSuccess) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
print("success"); |
|
|
|
print(state.item); |
|
|
|
_nursery = Nursery.fromJson(state.item); |
|
|
|
_seedLengthController.text = _nursery |
|
|
|
.seedLength |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_quantityController.text = _nursery.quantity |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_seedIncubationTimeController.text = _nursery |
|
|
|
.seedIncubationTime |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_descriptionController.text = |
|
|
|
_nursery.description; |
|
|
|
_executeByController.text = |
|
|
|
_nursery.executeBy; |
|
|
|
Get.find<ChangeDateTimePicker>().change(_nursery |
|
|
|
.executeDate |
|
|
|
.convertStringServerDateTimeToLocalDateTime()); |
|
|
|
//Show media |
|
|
|
if (Validators.stringNotNullOrEmpty( |
|
|
|
_nursery.media)) { |
|
|
|
BlocProvider.of<MediaHelperBloc>(context) |
|
|
|
.add(ChangeListMedia( |
|
|
|
items: UtilAction |
|
|
|
.convertFilePathToMedia( |
|
|
|
_nursery.media))); |
|
|
|
} |
|
|
|
//Show worker |
|
|
|
if (_nursery.nurseryDetail.length > 0) { |
|
|
|
BlocProvider.of<ExpansionListBloc>(context) |
|
|
|
.add(AddNew( |
|
|
|
items: _nursery.nurseryDetail)); |
|
|
|
child: SafeArea( |
|
|
|
child: SingleChildScrollView( |
|
|
|
child: BlocConsumer<ActionDetailBloc, |
|
|
|
ActionDetailState>( |
|
|
|
listener: (context, state) async { |
|
|
|
if (state is ActionDetailFailure) { |
|
|
|
print("fail"); |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
} else if (state is ActionDetailSuccess) { |
|
|
|
LoadingDialog.hideLoadingDialog(context); |
|
|
|
print("success"); |
|
|
|
print(state.item); |
|
|
|
_nursery = Nursery.fromJson(state.item); |
|
|
|
_seedLengthController.text = _nursery |
|
|
|
.seedLength |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_quantityController.text = _nursery.quantity |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_seedIncubationTimeController.text = |
|
|
|
_nursery.seedIncubationTime |
|
|
|
.formatNumtoStringDecimal(); |
|
|
|
_descriptionController.text = |
|
|
|
_nursery.description; |
|
|
|
_executeByController.text = |
|
|
|
_nursery.executeBy; |
|
|
|
Get.find<ChangeDateTimePicker>().change(_nursery |
|
|
|
.executeDate |
|
|
|
.convertStringServerDateTimeToLocalDateTime()); |
|
|
|
//Show media |
|
|
|
if (Validators.stringNotNullOrEmpty( |
|
|
|
_nursery.media)) { |
|
|
|
BlocProvider.of<MediaHelperBloc>(context) |
|
|
|
.add(ChangeListMedia( |
|
|
|
items: UtilAction |
|
|
|
.convertFilePathToMedia( |
|
|
|
_nursery.media))); |
|
|
|
} |
|
|
|
//Show worker |
|
|
|
if (_nursery.nurseryDetail.length > 0) { |
|
|
|
BlocProvider.of<ExpansionListBloc>( |
|
|
|
context) |
|
|
|
.add(AddNew( |
|
|
|
items: _nursery.nurseryDetail)); |
|
|
|
} |
|
|
|
//change subStrates |
|
|
|
if (_nursery.substratesId != null) { |
|
|
|
Get.find<ChangeSupply>() |
|
|
|
.changeByIdAndName( |
|
|
|
_nursery.substratesId, |
|
|
|
_nursery.substrateName); |
|
|
|
} |
|
|
|
} else if (state is ActionDetailInitial) { |
|
|
|
print("init"); |
|
|
|
} else if (state is ActionDetailLoading) { |
|
|
|
print("loading"); |
|
|
|
LoadingDialog.showLoadingDialog(context); |
|
|
|
} |
|
|
|
//change subStrates |
|
|
|
if (_nursery.substratesId != null) { |
|
|
|
Get.find<ChangeSupply>().changeByIdAndName( |
|
|
|
_nursery.substratesId, |
|
|
|
_nursery.substrateName); |
|
|
|
} |
|
|
|
} else if (state is ActionDetailInitial) { |
|
|
|
print("init"); |
|
|
|
} else if (state is ActionDetailLoading) { |
|
|
|
print("loading"); |
|
|
|
LoadingDialog.showLoadingDialog(context); |
|
|
|
} |
|
|
|
}, |
|
|
|
builder: (context, state) { |
|
|
|
return Column( |
|
|
|
children: <Widget>[ |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
child: Text( |
|
|
|
"Ngày thực hiện *", |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black54, |
|
|
|
fontSize: 13.0), |
|
|
|
}, |
|
|
|
builder: (context, state) { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.all(8), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: |
|
|
|
CrossAxisAlignment.start, |
|
|
|
children: <Widget>[ |
|
|
|
Text( |
|
|
|
'Ươm', |
|
|
|
style: TextStyle( |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
fontSize: 22), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
child: Text( |
|
|
|
"Ngày thực hiện *", |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black54, |
|
|
|
fontSize: 13.0), |
|
|
|
), |
|
|
|
), |
|
|
|
_btnExecuteTimePicker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
child: Text( |
|
|
|
"Loại giá thể", |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black54, |
|
|
|
fontSize: 13.0), |
|
|
|
), |
|
|
|
), |
|
|
|
_btnSelectSubstrates(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_seedLengthField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_quantityField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_seedIncubationTimeField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_desciptionField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_executeByField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
_btnExecuteTimePicker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
child: Text( |
|
|
|
"Loại giá thể", |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black54, |
|
|
|
fontSize: 13.0), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |
|
|
|
color: Colors.grey[200], |
|
|
|
), |
|
|
|
), |
|
|
|
_btnSelectSubstrates(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_seedLengthField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_quantityField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_seedIncubationTimeField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_desciptionField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_executeByField(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_buildListAddWorker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_btnAddWorker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
BlocBuilder<MediaHelperBloc, |
|
|
|
MediaHelperState>( |
|
|
|
builder: (context, state) { |
|
|
|
if (state is MediaHelperSuccess) { |
|
|
|
print("length: " + |
|
|
|
state.items.length.toString()); |
|
|
|
return WidgetMediaPicker( |
|
|
|
currentItems: state.items, |
|
|
|
onChangeFiles: (newPathFiles, |
|
|
|
deletePathFiles) async { |
|
|
|
Get.find<ChangeFileController>() |
|
|
|
.change(newPathFiles, |
|
|
|
deletePathFiles); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
return Center( |
|
|
|
child: CircularProgressIndicator()); |
|
|
|
} |
|
|
|
}), |
|
|
|
], |
|
|
|
); |
|
|
|
}, |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_buildListAddWorker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
_btnAddWorker(), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
height: 16, |
|
|
|
color: Colors.grey[200], |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
height: 8.0, |
|
|
|
), |
|
|
|
BlocBuilder<MediaHelperBloc, |
|
|
|
MediaHelperState>( |
|
|
|
builder: (context, state) { |
|
|
|
if (state is MediaHelperSuccess) { |
|
|
|
print("length: " + |
|
|
|
state.items.length.toString()); |
|
|
|
return WidgetMediaPicker( |
|
|
|
currentItems: state.items, |
|
|
|
onChangeFiles: (newPathFiles, |
|
|
|
deletePathFiles) async { |
|
|
|
Get.find<ChangeFileController>() |
|
|
|
.change(newPathFiles, |
|
|
|
deletePathFiles); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
return Center( |
|
|
|
child: |
|
|
|
CircularProgressIndicator()); |
|
|
|
} |
|
|
|
}), |
|
|
|
SizedBox( |
|
|
|
height: 16, |
|
|
|
), |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.all(8.0), |
|
|
|
child: ButtonWidget( |
|
|
|
title: 'CẬP NHẬT', |
|
|
|
onPressed: () { |
|
|
|
FocusScopeNode currentFocus = |
|
|
|
FocusScope.of(context); |
|
|
|
if (!currentFocus |
|
|
|
.hasPrimaryFocus) { |
|
|
|
currentFocus.unfocus(); |
|
|
|
} |
|
|
|
if (!Validators |
|
|
|
.stringNotNullOrEmpty( |
|
|
|
_workerNameController |
|
|
|
.text) && |
|
|
|
!Validators |
|
|
|
.stringNotNullOrEmpty( |
|
|
|
_trayNumberController |
|
|
|
.text)) { |
|
|
|
_validateInputs(); |
|
|
|
} else { |
|
|
|
Utils.showDialog( |
|
|
|
title: |
|
|
|
"Tên công nhân hoặc khây trồng đang cập nhật", |
|
|
|
message: |
|
|
|
"Bạn có muốn cập nhật?", |
|
|
|
textConfirm: "Tiếp tục", |
|
|
|
textCancel: "Xem lại", |
|
|
|
onConfirm: () { |
|
|
|
Get.back(); |
|
|
|
_validateInputs(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
)))))); |
|
|
|
@override |