| dab672e712362fdbbfa98386624f95d6 | |||||
| 440505e9ea1eee7043d2cbfeb318f6bc |
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:farm_tpf/utils/const_style.dart'; | import 'package:farm_tpf/utils/const_style.dart'; | ||||
| import 'package:farm_tpf/utils/validators.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | import 'package:farm_tpf/utils/formatter.dart'; | ||||
| padding: EdgeInsets.all(4), | padding: EdgeInsets.all(4), | ||||
| width: 150, | width: 150, | ||||
| child: Column( | child: Column( | ||||
| crossAxisAlignment: CrossAxisAlignment.center, | |||||
| mainAxisAlignment: MainAxisAlignment.center, | |||||
| children: [ | children: [ | ||||
| SizedBox( | SizedBox( | ||||
| height: 12.0, | height: 12.0, | ||||
| overflow: TextOverflow.ellipsis, | overflow: TextOverflow.ellipsis, | ||||
| maxLines: 1), | 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(), | |||||
| ], | ], | ||||
| ), | ), | ||||
| ), | ), | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Column( | return Column( | ||||
| children: [_formEdit(), _buildListSupply()], | |||||
| children: [ | |||||
| _buildListSupply(), | |||||
| SizedBox( | |||||
| height: 8.0, | |||||
| ), | |||||
| _formEdit() | |||||
| ], | |||||
| ); | ); | ||||
| } | } | ||||
| } | } |
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:farm_tpf/utils/const_style.dart'; | import 'package:farm_tpf/utils/const_style.dart'; | ||||
| import 'package:farm_tpf/utils/validators.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | import 'package:farm_tpf/utils/formatter.dart'; | ||||
| padding: EdgeInsets.all(4), | padding: EdgeInsets.all(4), | ||||
| width: 150, | width: 150, | ||||
| child: Column( | child: Column( | ||||
| mainAxisAlignment: MainAxisAlignment.center, | |||||
| children: [ | children: [ | ||||
| SizedBox( | SizedBox( | ||||
| height: 12.0, | height: 12.0, | ||||
| overflow: TextOverflow.ellipsis, | overflow: TextOverflow.ellipsis, | ||||
| maxLines: 1), | 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(), | |||||
| ], | ], | ||||
| ), | ), | ||||
| ), | ), | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Column( | return Column( | ||||
| children: [_formEdit(), _buildListSupply()], | |||||
| children: [ | |||||
| _buildListSupply(), | |||||
| SizedBox( | |||||
| height: 8.0, | |||||
| ), | |||||
| _formEdit() | |||||
| ], | |||||
| ); | ); | ||||
| } | } | ||||
| } | } |
| SizedBox( | SizedBox( | ||||
| height: 8.0, | height: 8.0, | ||||
| ), | ), | ||||
| _btnAddWorker(), | |||||
| _buildListAddWorker(), | |||||
| SizedBox( | SizedBox( | ||||
| height: 8.0, | height: 8.0, | ||||
| ), | ), | ||||
| _buildListAddWorker(), | |||||
| _btnAddWorker(), | |||||
| SizedBox( | SizedBox( | ||||
| height: 8.0, | height: 8.0, | ||||
| ), | ), |
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:farm_tpf/utils/const_style.dart'; | import 'package:farm_tpf/utils/const_style.dart'; | ||||
| import 'package:farm_tpf/utils/validators.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| import 'package:farm_tpf/utils/formatter.dart'; | import 'package:farm_tpf/utils/formatter.dart'; | ||||
| padding: EdgeInsets.all(4), | padding: EdgeInsets.all(4), | ||||
| width: 150, | width: 150, | ||||
| child: Column( | child: Column( | ||||
| mainAxisAlignment: MainAxisAlignment.center, | |||||
| children: [ | children: [ | ||||
| SizedBox( | SizedBox( | ||||
| height: 12.0, | height: 12.0, | ||||
| overflow: TextOverflow.ellipsis, | overflow: TextOverflow.ellipsis, | ||||
| maxLines: 1), | 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(), | |||||
| ], | ], | ||||
| ), | ), | ||||
| ), | ), | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Column( | return Column( | ||||
| children: [_formEdit(), _buildListSupply()], | |||||
| children: [ | |||||
| _buildListSupply(), | |||||
| SizedBox( | |||||
| height: 8.0, | |||||
| ), | |||||
| _formEdit() | |||||
| ], | |||||
| ); | ); | ||||
| } | } | ||||
| } | } |
| import 'package:farm_tpf/utils/const_color.dart'; | import 'package:farm_tpf/utils/const_color.dart'; | ||||
| import 'package:farm_tpf/utils/const_common.dart'; | import 'package:farm_tpf/utils/const_common.dart'; | ||||
| import 'package:farm_tpf/utils/const_style.dart'; | import 'package:farm_tpf/utils/const_style.dart'; | ||||
| import 'package:farm_tpf/utils/validators.dart'; | |||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
| import 'package:get/get.dart'; | import 'package:get/get.dart'; | ||||
| padding: EdgeInsets.all(4), | padding: EdgeInsets.all(4), | ||||
| width: 150, | width: 150, | ||||
| child: Column( | child: Column( | ||||
| mainAxisAlignment: MainAxisAlignment.center, | |||||
| children: [ | children: [ | ||||
| SizedBox( | SizedBox( | ||||
| height: 12.0, | height: 12.0, | ||||
| overflow: TextOverflow.ellipsis, | overflow: TextOverflow.ellipsis, | ||||
| maxLines: 1), | 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(), | |||||
| ], | ], | ||||
| ), | ), | ||||
| ), | ), | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Column( | return Column( | ||||
| children: [_formEdit(), _buildListSupply()], | |||||
| children: [ | |||||
| _buildListSupply(), | |||||
| SizedBox( | |||||
| height: 8.0, | |||||
| ), | |||||
| _formEdit() | |||||
| ], | |||||
| ); | ); | ||||
| } | } | ||||
| } | } |
| } | } | ||||
| } | } | ||||
| 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) { | static String validateEmail(String value) { | ||||
| String pattern = | 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,}))$'; | 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,}))$'; |