mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-04 20:52:26 +01:00
Merge pull request #45 from arun-muralidharan/weight-fix-38
Plate Weight - Fix for #38
This commit is contained in:
1
lib/l10n/app_zh.arb
Normal file
1
lib/l10n/app_zh.arb
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user