|
|
|
|
|
|
|
|
|
|
|
|
|
|
String executeTimeView; |
|
|
String executeTimeView; |
|
|
DateTime executeTime = DateTime.now(); |
|
|
DateTime executeTime = DateTime.now(); |
|
|
|
|
|
String resultAtView; |
|
|
|
|
|
DateTime resultAtTime; |
|
|
List<String> filePaths = List<String>(); |
|
|
List<String> filePaths = List<String>(); |
|
|
var changeFileController = Get.put(ChangeFileController()); |
|
|
var changeFileController = Get.put(ChangeFileController()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
))); |
|
|
))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Widget _btnResultAtTimePicker() { |
|
|
|
|
|
return FlatButton( |
|
|
|
|
|
padding: EdgeInsets.only(top: 0.0, right: 0.0, bottom: 0.0, left: 0.0), |
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
DatePicker.showDateTimePicker(context, |
|
|
|
|
|
showTitleActions: true, onChanged: (date) {}, onConfirm: (date) { |
|
|
|
|
|
setState(() { |
|
|
|
|
|
var parsedDate = |
|
|
|
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(date); |
|
|
|
|
|
_spraying.resultAt = "$parsedDate"; |
|
|
|
|
|
resultAtView = DateFormat("dd/MM/yyyy HH:mm").format(date); |
|
|
|
|
|
}); |
|
|
|
|
|
}, currentTime: resultAtTime, locale: LocaleType.vi); |
|
|
|
|
|
}, |
|
|
|
|
|
child: Container( |
|
|
|
|
|
padding: |
|
|
|
|
|
EdgeInsets.only(top: 0.0, right: 0.0, bottom: 10.5, left: 0.0), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
border: kBorderTextField, |
|
|
|
|
|
), |
|
|
|
|
|
child: Row( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text( |
|
|
|
|
|
resultAtView == null ? "" : resultAtView, |
|
|
|
|
|
style: TextStyle(fontSize: 14.0, color: Colors.black87), |
|
|
|
|
|
)), |
|
|
|
|
|
Icon( |
|
|
|
|
|
Icons.date_range, |
|
|
|
|
|
color: Colors.blue, |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
))); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Widget _purposeField() { |
|
|
Widget _purposeField() { |
|
|
return TextFormField( |
|
|
return TextFormField( |
|
|
keyboardType: TextInputType.text, |
|
|
keyboardType: TextInputType.text, |
|
|
|
|
|
|
|
|
executeTime = |
|
|
executeTime = |
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") |
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") |
|
|
.parse(_spraying.executeDate); |
|
|
.parse(_spraying.executeDate); |
|
|
|
|
|
executeTimeView = |
|
|
|
|
|
DateFormat("dd/MM/yyyy HH:mm") |
|
|
|
|
|
.format(executeTime); |
|
|
|
|
|
} catch (_) {} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
resultAtTime = |
|
|
|
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") |
|
|
|
|
|
.parse(_spraying.resultAt); |
|
|
|
|
|
resultAtView = |
|
|
|
|
|
DateFormat("dd/MM/yyyy HH:mm") |
|
|
|
|
|
.format(resultAtTime); |
|
|
} catch (_) {} |
|
|
} catch (_) {} |
|
|
executeTimeView = |
|
|
|
|
|
DateFormat("dd/MM/yyyy HH:mm") |
|
|
|
|
|
.format(executeTime); |
|
|
|
|
|
|
|
|
|
|
|
//Show media |
|
|
//Show media |
|
|
if (_spraying.media != null) { |
|
|
if (_spraying.media != null) { |
|
|
await UtilAction.cacheFiles(_spraying.media) |
|
|
await UtilAction.cacheFiles(_spraying.media) |
|
|
|
|
|
|
|
|
SizedBox( |
|
|
SizedBox( |
|
|
height: 8.0, |
|
|
height: 8.0, |
|
|
), |
|
|
), |
|
|
|
|
|
Container( |
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
child: Text( |
|
|
|
|
|
"Thời gian ghi nhận kết quả", |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: Colors.black54, |
|
|
|
|
|
fontSize: 13.0), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
_btnResultAtTimePicker(), |
|
|
|
|
|
SizedBox( |
|
|
|
|
|
height: 8.0, |
|
|
|
|
|
), |
|
|
_weatherField(), |
|
|
_weatherField(), |
|
|
SizedBox( |
|
|
SizedBox( |
|
|
height: 8.0, |
|
|
height: 8.0, |