Browse Source

update dont allow special character

master
daivph 5 years ago
parent
commit
6fabc22434
16 changed files with 129 additions and 313 deletions
  1. +1
    -1
      lib/presentation/custom_widgets/widget_text_form_field.dart
  2. +19
    -48
      lib/presentation/screens/actions/crop_status/sc_edit_action_crop_status.dart
  3. +4
    -8
      lib/presentation/screens/actions/disease/sc_edit_action_disease.dart
  4. +4
    -8
      lib/presentation/screens/actions/dung/sc_edit_action_dung.dart
  5. +3
    -8
      lib/presentation/screens/actions/dung/widget_dung_supply.dart
  6. +19
    -48
      lib/presentation/screens/actions/environment_update/sc_edit_action_environment_update.dart
  7. +13
    -32
      lib/presentation/screens/actions/harvest/sc_edit_action_harvest.dart
  8. +13
    -32
      lib/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart
  9. +3
    -8
      lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart
  10. +10
    -24
      lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart
  11. +13
    -32
      lib/presentation/screens/actions/packing/sc_edit_action_packing.dart
  12. +3
    -8
      lib/presentation/screens/actions/plant/widget_plant_supply.dart
  13. +13
    -32
      lib/presentation/screens/actions/sell/sc_edit_action_sell.dart
  14. +4
    -8
      lib/presentation/screens/actions/spraying/sc_edit_action_spraying.dart
  15. +3
    -8
      lib/presentation/screens/actions/spraying/widget_spraying_supply.dart
  16. +4
    -8
      lib/presentation/screens/actions/use_water/sc_edit_action_user_water.dart

+ 1
- 1
lib/presentation/custom_widgets/widget_text_form_field.dart View File

@@ -13,7 +13,7 @@ class WidgetTextFormFieldNumber extends StatelessWidget {
final String hintValue;
WidgetTextFormFieldNumber(
{@required this.textController,
@required this.onSaved,
this.onSaved,
@required this.hintValue,
this.validator});
@override

+ 19
- 48
lib/presentation/screens/actions/crop_status/sc_edit_action_crop_status.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
@@ -191,14 +192,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.cropRate = newValue;
},
@@ -206,14 +202,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.numberOfTreeToGrow = newValue;
},
@@ -221,14 +212,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.heightOfTree = newValue;
},
@@ -236,14 +222,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.numberOfLeaf = newValue;
},
@@ -251,14 +232,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.leafSize = newValue;
},
@@ -277,14 +253,9 @@ class _EditActionCropStatusScreenState
}

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) {
_cropStatus.internodeLength = newValue;
},

+ 4
- 8
lib/presentation/screens/actions/disease/sc_edit_action_disease.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
@@ -210,14 +211,9 @@ class _EditActionDiseaseScreenState extends State<EditActionDiseaseScreen> {
}

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) {
_disease.treePercent = newValue;
},

+ 4
- 8
lib/presentation/screens/actions/dung/sc_edit_action_dung.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -171,14 +172,9 @@ class _EditActionDungScreenState extends State<EditActionDungScreen> {
}

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) {
_dung.quarantinePeriod = newValue.parseDoubleThousand();
},

+ 3
- 8
lib/presentation/screens/actions/dung/widget_dung_supply.dart View File

@@ -1,6 +1,7 @@
import 'package:farm_tpf/custom_model/Device.dart';
import 'package:farm_tpf/custom_model/SuppliesUsing.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/ChangeFormButton.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -263,14 +264,8 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
}

_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() {

+ 19
- 48
lib/presentation/screens/actions/environment_update/sc_edit_action_environment_update.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
@@ -184,14 +185,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.ec = newValue;
},
@@ -199,14 +195,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.pH = newValue;
},
@@ -214,14 +205,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.ocdd = newValue;
},
@@ -229,14 +215,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.temperature = newValue;
},
@@ -244,14 +225,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.dodo = newValue;
},
@@ -259,14 +235,9 @@ class _EditActionEnvironmentUpdateState
}

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) {
_environment.lln = newValue;
},

+ 13
- 32
lib/presentation/screens/actions/harvest/sc_edit_action_harvest.dart View File

@@ -6,6 +6,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart';
@@ -157,14 +158,9 @@ class _EditActionHarvestScreenState extends State<EditActionHarvestScreen> {
}

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) {
_harvest.collectedQuantityLv1 = newValue.parseDoubleThousand();
},
@@ -172,14 +168,9 @@ class _EditActionHarvestScreenState extends State<EditActionHarvestScreen> {
}

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) {
_harvest.collectedQuantityLv2 = newValue.parseDoubleThousand();
},
@@ -187,14 +178,9 @@ class _EditActionHarvestScreenState extends State<EditActionHarvestScreen> {
}

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) {
_harvest.collectedQuantityLv3 = newValue.parseDoubleThousand();
},
@@ -202,14 +188,9 @@ class _EditActionHarvestScreenState extends State<EditActionHarvestScreen> {
}

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) {
_harvest.removedQuantity = newValue.parseDoubleThousand();
},

+ 13
- 32
lib/presentation/screens/actions/harvest_process/sc_edit_action_harvest_process.dart View File

@@ -8,6 +8,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -223,14 +224,9 @@ class _EditActionHarvestProcessScreenState
}

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) {
_harvestProcess.quantityLv1 = newValue.parseDoubleThousand();
},
@@ -238,14 +234,9 @@ class _EditActionHarvestProcessScreenState
}

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) {
_harvestProcess.quantityLv2 = newValue.parseDoubleThousand();
},
@@ -253,14 +244,9 @@ class _EditActionHarvestProcessScreenState
}

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) {
_harvestProcess.quantityLv3 = newValue.parseDoubleThousand();
},
@@ -268,14 +254,9 @@ class _EditActionHarvestProcessScreenState
}

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) {
_harvestProcess.removedQuantity = newValue.parseDoubleThousand();
},

+ 3
- 8
lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart View File

@@ -1,6 +1,7 @@
import 'package:farm_tpf/custom_model/Device.dart';
import 'package:farm_tpf/custom_model/SuppliesUsing.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/ChangeFormButton.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -266,14 +267,8 @@ class _WidgetHarvestProcessSupplyState
}

_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() {

+ 10
- 24
lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart View File

@@ -9,6 +9,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/nursery/bloc/expansion_list_bloc.dart';
@@ -213,14 +214,9 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> {
}

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) {
_nursery.seedLength = newValue.parseDoubleThousand();
},
@@ -228,14 +224,9 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> {
}

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) {
_nursery.quantity = newValue.parseDoubleThousand();
},
@@ -243,14 +234,9 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> {
}

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) {
_nursery.seedIncubationTime = newValue.parseDoubleThousand();
},

+ 13
- 32
lib/presentation/screens/actions/packing/sc_edit_action_packing.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/bloc_get_harvest.dart';
@@ -209,14 +210,9 @@ class _EditActionPackingScreenState extends State<EditActionPackingScreen> {
}

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) {
_packing.quantityLv1 = newValue.parseDoubleThousand();
},
@@ -224,14 +220,9 @@ class _EditActionPackingScreenState extends State<EditActionPackingScreen> {
}

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) {
_packing.quantityLv2 = newValue.parseDoubleThousand();
},
@@ -239,14 +230,9 @@ class _EditActionPackingScreenState extends State<EditActionPackingScreen> {
}

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) {
_packing.quantityLv3 = newValue.parseDoubleThousand();
},
@@ -254,14 +240,9 @@ class _EditActionPackingScreenState extends State<EditActionPackingScreen> {
}

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) {
_packing.removedQuantity = newValue.parseDoubleThousand();
},

+ 3
- 8
lib/presentation/screens/actions/plant/widget_plant_supply.dart View File

@@ -1,5 +1,6 @@
import 'package:farm_tpf/custom_model/SuppliesUsing.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/ChangeSupplyUsing.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeUnit.dart';
@@ -201,14 +202,8 @@ class _WidgetPlantSupplyState extends State<WidgetPlantSupply> {
}

_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() {

+ 13
- 32
lib/presentation/screens/actions/sell/sc_edit_action_sell.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
@@ -209,14 +210,9 @@ class _EditActionSellScreenState extends State<EditActionSellScreen> {
}

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) {
_sell.quantityLv1 = newValue.parseDoubleThousand();
},
@@ -224,14 +220,9 @@ class _EditActionSellScreenState extends State<EditActionSellScreen> {
}

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) {
_sell.quantityLv2 = newValue.parseDoubleThousand();
},
@@ -239,14 +230,9 @@ class _EditActionSellScreenState extends State<EditActionSellScreen> {
}

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) {
_sell.quantityLv3 = newValue.parseDoubleThousand();
},
@@ -254,14 +240,9 @@ class _EditActionSellScreenState extends State<EditActionSellScreen> {
}

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) {
_sell.removedQuantity = newValue.parseDoubleThousand();
},

+ 4
- 8
lib/presentation/screens/actions/spraying/sc_edit_action_spraying.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -209,14 +210,9 @@ class _EditActionSprayingScreenState extends State<EditActionSprayingScreen> {
}

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) {
_spraying.quarantinePeriod = newValue.parseDoubleThousand();
},

+ 3
- 8
lib/presentation/screens/actions/spraying/widget_spraying_supply.dart View File

@@ -1,6 +1,7 @@
import 'package:farm_tpf/custom_model/Device.dart';
import 'package:farm_tpf/custom_model/SuppliesUsing.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/ChangeFormButton.dart';
import 'package:farm_tpf/presentation/screens/actions/controller/ChangeSupplyUsing.dart';
@@ -264,14 +265,8 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
}

_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() {

+ 4
- 8
lib/presentation/screens/actions/use_water/sc_edit_action_user_water.dart View File

@@ -7,6 +7,7 @@ import 'package:farm_tpf/data/repository/repository.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_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/screens/actions/bloc/action_detail_bloc.dart';
import 'package:farm_tpf/presentation/screens/actions/state_management_helper/change_file_controller.dart';
@@ -156,14 +157,9 @@ class _EditActionUseWaterScreenState extends State<EditActionUseWaterScreen> {
}

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) {
_useWater.amount = newValue.parseDoubleThousand();
},

Loading…
Cancel
Save