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

5729eb498eaeb9c64784fcfc80bbb33b
440505e9ea1eee7043d2cbfeb318f6bc

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

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

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

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

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

_quantityController.text = ""; _quantityController.text = "";
changeUnit.initValue(); changeUnit.initValue();
changeSelectedSupply.initValue(); changeSelectedSupply.initValue();
changeFormField.change(false);
} }


_hidenKeyboard(BuildContext context) { _hidenKeyboard(BuildContext context) {

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

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

Loading…
Cancel
Save