| 5729eb498eaeb9c64784fcfc80bbb33b | |||||
| 440505e9ea1eee7043d2cbfeb318f6bc |
| import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | ||||
| import 'package:farm_tpf/custom_model/Supply.dart'; | import 'package:farm_tpf/custom_model/Supply.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_text_form_field.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/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.currentIndex, newSup); | changeSupplyUsing.currentIndex, newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.addSupply(newSup); | changeSupplyUsing.addSupply(newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| changeUnit.initValue(); | changeUnit.initValue(); | ||||
| changeSelectedSupply.initValue(); | changeSelectedSupply.initValue(); | ||||
| changeSelectedDevice.initValue(); | changeSelectedDevice.initValue(); | ||||
| changeFormField.change(false); | |||||
| } | } | ||||
| _hidenKeyboard(BuildContext context) { | _hidenKeyboard(BuildContext context) { |
| import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | ||||
| import 'package:farm_tpf/custom_model/Supply.dart'; | import 'package:farm_tpf/custom_model/Supply.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_text_form_field.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/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.currentIndex, newSup); | changeSupplyUsing.currentIndex, newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.addSupply(newSup); | changeSupplyUsing.addSupply(newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| changeUnit.initValue(); | changeUnit.initValue(); | ||||
| changeSelectedSupply.initValue(); | changeSelectedSupply.initValue(); | ||||
| changeSelectedDevice.initValue(); | changeSelectedDevice.initValue(); | ||||
| changeFormField.change(false); | |||||
| } | } | ||||
| _hidenKeyboard(BuildContext context) { | _hidenKeyboard(BuildContext context) { |
| _quantityController.text = ""; | _quantityController.text = ""; | ||||
| changeUnit.initValue(); | changeUnit.initValue(); | ||||
| changeSelectedSupply.initValue(); | changeSelectedSupply.initValue(); | ||||
| changeFormField.change(false); | |||||
| } | } | ||||
| _hidenKeyboard(BuildContext context) { | _hidenKeyboard(BuildContext context) { |
| import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; | ||||
| import 'package:farm_tpf/custom_model/Supply.dart'; | import 'package:farm_tpf/custom_model/Supply.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_text_form_field.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/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFieldInForm.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.currentIndex, newSup); | changeSupplyUsing.currentIndex, newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| var currentDevice = changeSelectedDevice.currentDevice; | var currentDevice = changeSelectedDevice.currentDevice; | ||||
| var currentQuantity = | var currentQuantity = | ||||
| _quantityController.text.parseDoubleThousand(); | _quantityController.text.parseDoubleThousand(); | ||||
| if (currentSupply.id != null && currentQuantity > 0) { | |||||
| if (currentSupply.id != null && | |||||
| (currentQuantity ?? 0) > 0) { | |||||
| var quantityWithCurrentSupplyUnit = | var quantityWithCurrentSupplyUnit = | ||||
| UtilAction.convertUnit( | UtilAction.convertUnit( | ||||
| inputValue: currentQuantity, | inputValue: currentQuantity, | ||||
| changeSupplyUsing.addSupply(newSup); | changeSupplyUsing.addSupply(newSup); | ||||
| _resetForm(); | _resetForm(); | ||||
| _hidenKeyboard(context); | _hidenKeyboard(context); | ||||
| } else if (currentSupply.id == null || | |||||
| ((currentQuantity ?? 0) <= 0)) { | |||||
| Utils.showSnackBarWarning( | |||||
| message: "Vui lòng nhập vật tư và số lượng"); | |||||
| } | } | ||||
| }, | }, | ||||
| child: Text( | child: Text( | ||||
| changeUnit.initValue(); | changeUnit.initValue(); | ||||
| changeSelectedSupply.initValue(); | changeSelectedSupply.initValue(); | ||||
| changeSelectedDevice.initValue(); | changeSelectedDevice.initValue(); | ||||
| changeFormField.change(false); | |||||
| } | } | ||||
| _hidenKeyboard(BuildContext context) { | _hidenKeyboard(BuildContext context) { |