| final String hintValue; | final String hintValue; | ||||
| WidgetTextFormFieldNumber( | WidgetTextFormFieldNumber( | ||||
| {@required this.textController, | {@required this.textController, | ||||
| @required this.onSaved, | |||||
| this.onSaved, | |||||
| @required this.hintValue, | @required this.hintValue, | ||||
| this.validator}); | this.validator}); | ||||
| @override | @override |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | ||||
| } | } | ||||
| Widget _cropRateField() { | Widget _cropRateField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Tỉ lệ lên cây"), | |||||
| controller: _cropRateController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Tỉ lệ lên cây", | |||||
| textController: _cropRateController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.cropRate = newValue; | _cropStatus.cropRate = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _numTreeField() { | Widget _numTreeField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng lên cây"), | |||||
| controller: _numTreeController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng lên cây", | |||||
| textController: _numTreeController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.numberOfTreeToGrow = newValue; | _cropStatus.numberOfTreeToGrow = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _hightOfTreeField() { | Widget _hightOfTreeField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Chiều cao cây"), | |||||
| controller: _heightOfTreeController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Chiều cao cây", | |||||
| textController: _heightOfTreeController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.heightOfTree = newValue; | _cropStatus.heightOfTree = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _numberOfLeafField() { | Widget _numberOfLeafField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lá"), | |||||
| controller: _numberOfLeafController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lá", | |||||
| textController: _numberOfLeafController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.numberOfLeaf = newValue; | _cropStatus.numberOfLeaf = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _leafSizeField() { | Widget _leafSizeField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Kích thước lá"), | |||||
| controller: _leafSizeController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Kích thước lá", | |||||
| textController: _leafSizeController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.leafSize = newValue; | _cropStatus.leafSize = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _internodeLengthField() { | Widget _internodeLengthField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Dài đốt thân"), | |||||
| controller: _internodeLengthController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Dài đốt thân", | |||||
| textController: _internodeLengthController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _cropStatus.internodeLength = newValue; | _cropStatus.internodeLength = newValue; | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | ||||
| } | } | ||||
| Widget _treePercentField() { | Widget _treePercentField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "% cây"), | |||||
| controller: _treePercentController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "% cây", | |||||
| textController: _treePercentController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _disease.treePercent = newValue; | _disease.treePercent = newValue; | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| Widget _quarantinePeriodField() { | Widget _quarantinePeriodField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Thời gian cách ly"), | |||||
| controller: _quarantinePeriodController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Thời gian cách ly", | |||||
| textController: _quarantinePeriodController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _dung.quarantinePeriod = newValue.parseDoubleThousand(); | _dung.quarantinePeriod = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/custom_model/Device.dart'; | import 'package:farm_tpf/custom_model/Device.dart'; | ||||
| 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/screens/actions/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| _quantityField() { | _quantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Tổng lượng sử dụng *"), | |||||
| controller: _quantityController); | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Tổng lượng sử dụng *", textController: _quantityController); | |||||
| } | } | ||||
| _buttonInForm() { | _buttonInForm() { |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | ||||
| } | } | ||||
| Widget _ecField() { | Widget _ecField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "EC"), | |||||
| controller: _ecController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "EC", | |||||
| textController: _ecController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.ec = newValue; | _environment.ec = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _phField() { | Widget _phField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "pH"), | |||||
| controller: _phController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "pH", | |||||
| textController: _phController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.pH = newValue; | _environment.pH = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _ocddField() { | Widget _ocddField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Nhiệt độ dung dịch"), | |||||
| controller: _ocddController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Nhiệt độ dung dịch", | |||||
| textController: _ocddController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.ocdd = newValue; | _environment.ocdd = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _temperatureField() { | Widget _temperatureField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Nhiệt độ môi trường"), | |||||
| controller: _temperatureController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Nhiệt độ môi trường", | |||||
| textController: _temperatureController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.temperature = newValue; | _environment.temperature = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _doField() { | Widget _doField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Độ ẩm"), | |||||
| controller: _doController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Độ ẩm", | |||||
| textController: _doController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.dodo = newValue; | _environment.dodo = newValue; | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _llnField() { | Widget _llnField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Lưu lượng nước"), | |||||
| controller: _llnController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Lưu lượng nước", | |||||
| textController: _llnController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _environment.lln = newValue; | _environment.lln = newValue; | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart'; | import 'package:farm_tpf/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart'; | ||||
| } | } | ||||
| Widget _l1Field() { | Widget _l1Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 1"), | |||||
| controller: _l1Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 1", | |||||
| textController: _l1Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvest.collectedQuantityLv1 = newValue.parseDoubleThousand(); | _harvest.collectedQuantityLv1 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l2Field() { | Widget _l2Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 2"), | |||||
| controller: _l2Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 2", | |||||
| textController: _l2Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvest.collectedQuantityLv2 = newValue.parseDoubleThousand(); | _harvest.collectedQuantityLv2 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l3Field() { | Widget _l3Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 3"), | |||||
| controller: _l3Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 3", | |||||
| textController: _l3Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvest.collectedQuantityLv3 = newValue.parseDoubleThousand(); | _harvest.collectedQuantityLv3 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _removedQuantityField() { | Widget _removedQuantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại bỏ"), | |||||
| controller: _removedQuantityController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại bỏ", | |||||
| textController: _removedQuantityController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvest.removedQuantity = newValue.parseDoubleThousand(); | _harvest.removedQuantity = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| Widget _l1Field() { | Widget _l1Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 1"), | |||||
| controller: _l1Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 1", | |||||
| textController: _l1Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvestProcess.quantityLv1 = newValue.parseDoubleThousand(); | _harvestProcess.quantityLv1 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l2Field() { | Widget _l2Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 2"), | |||||
| controller: _l2Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 2", | |||||
| textController: _l2Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvestProcess.quantityLv2 = newValue.parseDoubleThousand(); | _harvestProcess.quantityLv2 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l3Field() { | Widget _l3Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 3"), | |||||
| controller: _l3Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 3", | |||||
| textController: _l3Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvestProcess.quantityLv3 = newValue.parseDoubleThousand(); | _harvestProcess.quantityLv3 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _removedQuantityField() { | Widget _removedQuantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại bỏ"), | |||||
| controller: _removedQuantityController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại bỏ", | |||||
| textController: _removedQuantityController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _harvestProcess.removedQuantity = newValue.parseDoubleThousand(); | _harvestProcess.removedQuantity = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/custom_model/Device.dart'; | import 'package:farm_tpf/custom_model/Device.dart'; | ||||
| 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/screens/actions/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| _quantityField() { | _quantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Tổng lượng sử dụng *"), | |||||
| controller: _quantityController); | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Tổng lượng sử dụng *", textController: _quantityController); | |||||
| } | } | ||||
| _buttonInForm() { | _buttonInForm() { |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/nursery/bloc/expansion_list_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/nursery/bloc/expansion_list_bloc.dart'; | ||||
| } | } | ||||
| Widget _seedLengthField() { | Widget _seedLengthField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Chiều dài mầm"), | |||||
| controller: _seedLengthController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Chiều dài mầm", | |||||
| textController: _seedLengthController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _nursery.seedLength = newValue.parseDoubleThousand(); | _nursery.seedLength = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _quantityField() { | Widget _quantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng hạt gieo"), | |||||
| controller: _quantityController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng hạt gieo", | |||||
| textController: _quantityController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _nursery.quantity = newValue.parseDoubleThousand(); | _nursery.quantity = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _seedIncubationTimeField() { | Widget _seedIncubationTimeField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Thời gian ngâm hạt"), | |||||
| controller: _seedIncubationTimeController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Thời gian ngâm hạt", | |||||
| textController: _seedIncubationTimeController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _nursery.seedIncubationTime = newValue.parseDoubleThousand(); | _nursery.seedIncubationTime = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc_get_harvest.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc_get_harvest.dart'; | ||||
| } | } | ||||
| Widget _l1Field() { | Widget _l1Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 1"), | |||||
| controller: _l1Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 1", | |||||
| textController: _l1Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _packing.quantityLv1 = newValue.parseDoubleThousand(); | _packing.quantityLv1 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l2Field() { | Widget _l2Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 2"), | |||||
| controller: _l2Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 2", | |||||
| textController: _l2Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _packing.quantityLv2 = newValue.parseDoubleThousand(); | _packing.quantityLv2 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l3Field() { | Widget _l3Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 3"), | |||||
| controller: _l3Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 3", | |||||
| textController: _l3Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _packing.quantityLv3 = newValue.parseDoubleThousand(); | _packing.quantityLv3 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _removedQuantityField() { | Widget _removedQuantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại bỏ"), | |||||
| controller: _removedQuantityController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại bỏ", | |||||
| textController: _removedQuantityController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _packing.removedQuantity = newValue.parseDoubleThousand(); | _packing.removedQuantity = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| 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/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeUnit.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeUnit.dart'; | ||||
| } | } | ||||
| _quantityField() { | _quantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Tổng lượng sử dụng"), | |||||
| controller: _quantityController); | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Tổng lượng sử dụng", textController: _quantityController); | |||||
| } | } | ||||
| _buttonInForm() { | _buttonInForm() { |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | ||||
| } | } | ||||
| Widget _l1Field() { | Widget _l1Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 1"), | |||||
| controller: _l1Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 1", | |||||
| textController: _l1Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _sell.quantityLv1 = newValue.parseDoubleThousand(); | _sell.quantityLv1 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l2Field() { | Widget _l2Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 2"), | |||||
| controller: _l2Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 2", | |||||
| textController: _l2Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _sell.quantityLv2 = newValue.parseDoubleThousand(); | _sell.quantityLv2 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _l3Field() { | Widget _l3Field() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại 3"), | |||||
| controller: _l3Controller, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại 3", | |||||
| textController: _l3Controller, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _sell.quantityLv3 = newValue.parseDoubleThousand(); | _sell.quantityLv3 = newValue.parseDoubleThousand(); | ||||
| }, | }, | ||||
| } | } | ||||
| Widget _removedQuantityField() { | Widget _removedQuantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Số lượng/khối lượng loại bỏ"), | |||||
| controller: _removedQuantityController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Số lượng/khối lượng loại bỏ", | |||||
| textController: _removedQuantityController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _sell.removedQuantity = newValue.parseDoubleThousand(); | _sell.removedQuantity = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| Widget _quarantinePeriodField() { | Widget _quarantinePeriodField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Thời gian cách ly"), | |||||
| controller: _quarantinePeriodController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Thời gian cách ly", | |||||
| textController: _quarantinePeriodController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _spraying.quarantinePeriod = newValue.parseDoubleThousand(); | _spraying.quarantinePeriod = newValue.parseDoubleThousand(); | ||||
| }, | }, |
| import 'package:farm_tpf/custom_model/Device.dart'; | import 'package:farm_tpf/custom_model/Device.dart'; | ||||
| 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/screens/actions/controller/ChangeDevice.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeDevice.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeFormButton.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart'; | ||||
| } | } | ||||
| _quantityField() { | _quantityField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Tổng lượng sử dụng *"), | |||||
| controller: _quantityController); | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Tổng lượng sử dụng *", textController: _quantityController); | |||||
| } | } | ||||
| _buttonInForm() { | _buttonInForm() { |
| import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | import 'package:farm_tpf/presentation/custom_widgets/bloc/media_helper_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/custom_widgets/widget_loading.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_media_picker.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/custom_widgets/widget_utils.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | import 'package:farm_tpf/presentation/screens/actions/bloc/action_detail_bloc.dart'; | ||||
| import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart'; | ||||
| } | } | ||||
| Widget _amountField() { | Widget _amountField() { | ||||
| return TextFormField( | |||||
| keyboardType: TextInputType.numberWithOptions(decimal: true), | |||||
| inputFormatters: [ | |||||
| ThousandsFormatter( | |||||
| formatter: NumberFormat("#,###.##", "es"), allowFraction: true) | |||||
| ], | |||||
| decoration: InputDecoration(labelText: "Thể tích nước sử dụng"), | |||||
| controller: _amountController, | |||||
| return WidgetTextFormFieldNumber( | |||||
| hintValue: "Thể tích nước sử dụng", | |||||
| textController: _amountController, | |||||
| onSaved: (newValue) { | onSaved: (newValue) { | ||||
| _useWater.amount = newValue.parseDoubleThousand(); | _useWater.amount = newValue.parseDoubleThousand(); | ||||
| }, | }, |