Browse Source

show warning worker name empty

master
daivph 5 years ago
parent
commit
f5aacdb555
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart

+ 4
- 5
lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart View File

int selectedSupplyId = -1; int selectedSupplyId = -1;
List<String> filePaths = List<String>(); List<String> filePaths = List<String>();
var changeFileController = Get.put(ChangeFileController()); var changeFileController = Get.put(ChangeFileController());
GlobalKey<FormState> _formWorkerKey = GlobalKey();


Future<Null> getSharedPrefs() async { Future<Null> getSharedPrefs() async {
var currentFullName = await pref.getString(DATA_CONST.CURRENT_FULL_NAME); var currentFullName = await pref.getString(DATA_CONST.CURRENT_FULL_NAME);
color: Colors.white, color: Colors.white,
border: Border.all(color: COLOR_CONST.DEFAULT)), border: Border.all(color: COLOR_CONST.DEFAULT)),
child: Form( child: Form(
key: _formWorkerKey,
child: Column( child: Column(
children: [ children: [
TextFormField( TextFormField(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8.0)), borderRadius: new BorderRadius.circular(8.0)),
onPressed: () { onPressed: () {
if (_formWorkerKey.currentState.validate()) {
_formWorkerKey.currentState.save();
if (Validators.stringNotNullOrEmpty(
_workerNameController.text)) {
NurseryDetail _nurseryDetail = NurseryDetail() NurseryDetail _nurseryDetail = NurseryDetail()
..workerName = _workerNameController.text ..workerName = _workerNameController.text
..trayNumber = _trayNumberController.text; ..trayNumber = _trayNumberController.text;
} }
context.bloc<StatusAddFormBloc>().add(Reset()); context.bloc<StatusAddFormBloc>().add(Reset());
} else { } else {
//
Utils.showSnackBarWarning(
message: "Vui lòng nhập tên công nhân");
} }
}, },
child: Text( child: Text(

Loading…
Cancel
Save