| @@ -1 +1 @@ | |||
| dab672e712362fdbbfa98386624f95d6 | |||
| 440505e9ea1eee7043d2cbfeb318f6bc | |||
| @@ -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() | |||
| ], | |||
| ); | |||
| } | |||
| } | |||
| @@ -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() | |||
| ], | |||
| ); | |||
| } | |||
| } | |||
| @@ -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, | |||
| ), | |||
| @@ -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() | |||
| ], | |||
| ); | |||
| } | |||
| } | |||
| @@ -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() | |||
| ], | |||
| ); | |||
| } | |||
| } | |||
| @@ -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,}))$'; | |||