Browse Source

fix Bug #7893

master
daivph 5 years ago
parent
commit
0875e6e7fc
5 changed files with 44 additions and 7 deletions
  1. +1
    -1
      ios/Flutter/.last_build_id
  2. +14
    -2
      lib/presentation/screens/actions/dung/widget_dung_supply.dart
  3. +14
    -2
      lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart
  4. +1
    -0
      lib/presentation/screens/actions/plant/widget_plant_supply.dart
  5. +14
    -2
      lib/presentation/screens/actions/spraying/widget_spraying_supply.dart

+ 1
- 1
ios/Flutter/.last_build_id View File

@@ -1 +1 @@
5729eb498eaeb9c64784fcfc80bbb33b
440505e9ea1eee7043d2cbfeb318f6bc

+ 14
- 2
lib/presentation/screens/actions/dung/widget_dung_supply.dart View File

@@ -2,6 +2,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/custom_widgets/widget_utils.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/ChangeFormButton.dart';
@@ -330,7 +331,8 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -353,6 +355,10 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
changeSupplyUsing.currentIndex, newSup);
_resetForm();
_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(
@@ -368,7 +374,8 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -390,6 +397,10 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
changeSupplyUsing.addSupply(newSup);
_resetForm();
_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(
@@ -501,6 +512,7 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
changeUnit.initValue();
changeSelectedSupply.initValue();
changeSelectedDevice.initValue();
changeFormField.change(false);
}

_hidenKeyboard(BuildContext context) {

+ 14
- 2
lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart View File

@@ -2,6 +2,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/custom_widgets/widget_utils.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/ChangeFormButton.dart';
@@ -330,7 +331,8 @@ class _WidgetHarvestProcessSupplyState
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -353,6 +355,10 @@ class _WidgetHarvestProcessSupplyState
changeSupplyUsing.currentIndex, newSup);
_resetForm();
_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(
@@ -368,7 +374,8 @@ class _WidgetHarvestProcessSupplyState
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -390,6 +397,10 @@ class _WidgetHarvestProcessSupplyState
changeSupplyUsing.addSupply(newSup);
_resetForm();
_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(
@@ -501,6 +512,7 @@ class _WidgetHarvestProcessSupplyState
changeUnit.initValue();
changeSelectedSupply.initValue();
changeSelectedDevice.initValue();
changeFormField.change(false);
}

_hidenKeyboard(BuildContext context) {

+ 1
- 0
lib/presentation/screens/actions/plant/widget_plant_supply.dart View File

@@ -384,6 +384,7 @@ class _WidgetPlantSupplyState extends State<WidgetPlantSupply> {
_quantityController.text = "";
changeUnit.initValue();
changeSelectedSupply.initValue();
changeFormField.change(false);
}

_hidenKeyboard(BuildContext context) {

+ 14
- 2
lib/presentation/screens/actions/spraying/widget_spraying_supply.dart View File

@@ -2,6 +2,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/custom_widgets/widget_utils.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/ChangeFormButton.dart';
@@ -328,7 +329,8 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -351,6 +353,10 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
changeSupplyUsing.currentIndex, newSup);
_resetForm();
_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(
@@ -366,7 +372,8 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
var currentDevice = changeSelectedDevice.currentDevice;
var currentQuantity =
_quantityController.text.parseDoubleThousand();
if (currentSupply.id != null && currentQuantity > 0) {
if (currentSupply.id != null &&
(currentQuantity ?? 0) > 0) {
var quantityWithCurrentSupplyUnit =
UtilAction.convertUnit(
inputValue: currentQuantity,
@@ -388,6 +395,10 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
changeSupplyUsing.addSupply(newSup);
_resetForm();
_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(
@@ -499,6 +510,7 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
changeUnit.initValue();
changeSelectedSupply.initValue();
changeSelectedDevice.initValue();
changeFormField.change(false);
}

_hidenKeyboard(BuildContext context) {

Loading…
Cancel
Save