Merge pull request #45 from arun-muralidharan/weight-fix-38

Plate Weight - Fix for #38
This commit is contained in:
Roland Geider
2021-06-20 15:13:06 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

1
lib/l10n/app_zh.arb Normal file
View File

@@ -0,0 +1 @@
{}

View File

@@ -336,6 +336,7 @@ class _LogPageState extends State<LogPage> {
}
Widget getWeightWidget() {
var minPlateWeight = 1.25;
return Row(
children: [
IconButton(
@@ -345,7 +346,7 @@ class _LogPageState extends State<LogPage> {
),
onPressed: () {
try {
double newValue = double.parse(_weightController.text) - 1.25;
double newValue = double.parse(_weightController.text) - (2 * minPlateWeight);
if (newValue > 0) {
setState(() {
widget._log.weight = newValue;
@@ -393,7 +394,7 @@ class _LogPageState extends State<LogPage> {
),
onPressed: () {
try {
double newValue = double.parse(_weightController.text) + 1.25;
double newValue = double.parse(_weightController.text) + (2 * minPlateWeight);
setState(() {
widget._log.weight = newValue;
_weightController.text = newValue.toString();