Browse Source

fix Bug #7796

master
daivph 5 years ago
parent
commit
1b1b32a639
7 changed files with 138 additions and 49 deletions
  1. +1
    -1
      ios/Flutter/.last_build_id
  2. +35
    -13
      lib/presentation/screens/actions/dung/widget_dung_supply.dart
  3. +34
    -13
      lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart
  4. +2
    -2
      lib/presentation/screens/actions/nursery/sc_edit_action_nursery.dart
  5. +22
    -7
      lib/presentation/screens/actions/plant/widget_plant_supply.dart
  6. +34
    -13
      lib/presentation/screens/actions/spraying/widget_spraying_supply.dart
  7. +10
    -0
      lib/utils/validators.dart

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

@@ -1 +1 @@
dab672e712362fdbbfa98386624f95d6
440505e9ea1eee7043d2cbfeb318f6bc

+ 35
- 13
lib/presentation/screens/actions/dung/widget_dung_supply.dart View File

@@ -12,6 +12,7 @@ import 'package:farm_tpf/presentation/screens/resources/sc_resource_helper.dart'
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_style.dart';
import 'package:farm_tpf/utils/validators.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:farm_tpf/utils/formatter.dart';
@@ -99,6 +100,8 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
padding: EdgeInsets.all(4),
width: 150,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 12.0,
@@ -110,18 +113,31 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
overflow: TextOverflow.ellipsis,
maxLines: 1),
),
Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}")),
Validators.stringNotNullOrEmpty(
value.currentItems[index].dosage)
? Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].quantity
.formatNumtoStringDecimal())
? Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].equipmentName)
? Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(
value.currentItems[index].howToUse)
? Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}"))
: SizedBox(),
],
),
),
@@ -454,7 +470,13 @@ class _WidgetDungSupplyState extends State<WidgetDungSupply> {
@override
Widget build(BuildContext context) {
return Column(
children: [_formEdit(), _buildListSupply()],
children: [
_buildListSupply(),
SizedBox(
height: 8.0,
),
_formEdit()
],
);
}
}

+ 34
- 13
lib/presentation/screens/actions/harvest_process/widget_harvest_process_supply.dart View File

@@ -12,6 +12,7 @@ import 'package:farm_tpf/presentation/screens/resources/sc_resource_helper.dart'
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_style.dart';
import 'package:farm_tpf/utils/validators.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:farm_tpf/utils/formatter.dart';
@@ -102,6 +103,7 @@ class _WidgetHarvestProcessSupplyState
padding: EdgeInsets.all(4),
width: 150,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 12.0,
@@ -113,18 +115,31 @@ class _WidgetHarvestProcessSupplyState
overflow: TextOverflow.ellipsis,
maxLines: 1),
),
Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}")),
Validators.stringNotNullOrEmpty(
value.currentItems[index].dosage)
? Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].quantity
.formatNumtoStringDecimal())
? Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].equipmentName)
? Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(
value.currentItems[index].howToUse)
? Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}"))
: SizedBox(),
],
),
),
@@ -457,7 +472,13 @@ class _WidgetHarvestProcessSupplyState
@override
Widget build(BuildContext context) {
return Column(
children: [_formEdit(), _buildListSupply()],
children: [
_buildListSupply(),
SizedBox(
height: 8.0,
),
_formEdit()
],
);
}
}

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

@@ -618,11 +618,11 @@ class _EditActionNurseryState extends State<EditActionNurseryScreen> {
SizedBox(
height: 8.0,
),
_btnAddWorker(),
_buildListAddWorker(),
SizedBox(
height: 8.0,
),
_buildListAddWorker(),
_btnAddWorker(),
SizedBox(
height: 8.0,
),

+ 22
- 7
lib/presentation/screens/actions/plant/widget_plant_supply.dart View File

@@ -10,6 +10,7 @@ import 'package:farm_tpf/presentation/screens/resources/sc_resource_helper.dart'
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_style.dart';
import 'package:farm_tpf/utils/validators.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:farm_tpf/utils/formatter.dart';
@@ -85,6 +86,7 @@ class _WidgetPlantSupplyState extends State<WidgetPlantSupply> {
padding: EdgeInsets.all(4),
width: 150,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 12.0,
@@ -96,12 +98,19 @@ class _WidgetPlantSupplyState extends State<WidgetPlantSupply> {
overflow: TextOverflow.ellipsis,
maxLines: 1),
),
Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}")),
Validators.stringNotNullOrEmpty(
value.currentItems[index].dosage)
? Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].quantity
.formatNumtoStringDecimal())
? Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}"))
: SizedBox(),
],
),
),
@@ -364,7 +373,13 @@ class _WidgetPlantSupplyState extends State<WidgetPlantSupply> {
@override
Widget build(BuildContext context) {
return Column(
children: [_formEdit(), _buildListSupply()],
children: [
_buildListSupply(),
SizedBox(
height: 8.0,
),
_formEdit()
],
);
}
}

+ 34
- 13
lib/presentation/screens/actions/spraying/widget_spraying_supply.dart View File

@@ -12,6 +12,7 @@ import 'package:farm_tpf/presentation/screens/resources/sc_resource_helper.dart'
import 'package:farm_tpf/utils/const_color.dart';
import 'package:farm_tpf/utils/const_common.dart';
import 'package:farm_tpf/utils/const_style.dart';
import 'package:farm_tpf/utils/validators.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

@@ -100,6 +101,7 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
padding: EdgeInsets.all(4),
width: 150,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 12.0,
@@ -111,18 +113,31 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
overflow: TextOverflow.ellipsis,
maxLines: 1),
),
Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}")),
Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}")),
Validators.stringNotNullOrEmpty(
value.currentItems[index].dosage)
? Flexible(
child: Text(
"${value.currentItems[index].dosage ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].quantity
.formatNumtoStringDecimal())
? Flexible(
child: Text(
"${value.currentItems[index].quantity.formatNumtoStringDecimal() ?? ""} ${value.currentItems[index].supplyUnit ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(value
.currentItems[index].equipmentName)
? Flexible(
child: Text(
"${value.currentItems[index].equipmentName ?? ""}"))
: SizedBox(),
Validators.stringNotNullOrEmpty(
value.currentItems[index].howToUse)
? Flexible(
child: Text(
"${value.currentItems[index].howToUse ?? ""}"))
: SizedBox(),
],
),
),
@@ -455,7 +470,13 @@ class _WidgetSprayingSupplyState extends State<WidgetSprayingSupply> {
@override
Widget build(BuildContext context) {
return Column(
children: [_formEdit(), _buildListSupply()],
children: [
_buildListSupply(),
SizedBox(
height: 8.0,
),
_formEdit()
],
);
}
}

+ 10
- 0
lib/utils/validators.dart View File

@@ -42,6 +42,16 @@ class Validators {
}
}

static bool stringNotNullOrEmpty(String value) {
if (value == null) {
return false;
} else if (value.trim().isEmpty) {
return false;
} else {
return true;
}
}

static String validateEmail(String value) {
String pattern =
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';

Loading…
Cancel
Save