diff --git a/AUTHORS.md b/AUTHORS.md index 2478f3908..ee664bf4b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -29,11 +29,12 @@ - Bassam Mutairi - - Dieter Plaetinck - - Dennis van Peer - +- sizzlesloth - ## Translators - Saudi Arabian - - Hanaa Allohibi + - Hanaa Allohibi - German @@ -66,7 +67,7 @@ - Norwegian Bokmål - Allan Nordhøy (98) - + - Japanese - Kosei TANAKA (97) @@ -76,5 +77,5 @@ - Nenza Nurfirmansyah (73) - Croatian - + - Sandi Milohaic diff --git a/lib/screens/weight_screen.dart b/lib/screens/weight_screen.dart index ee0dc429f..17e620dac 100644 --- a/lib/screens/weight_screen.dart +++ b/lib/screens/weight_screen.dart @@ -43,7 +43,7 @@ class WeightScreen extends StatelessWidget { FormScreen.routeName, arguments: FormScreenArguments( AppLocalizations.of(context).newEntry, - WeightForm(lastWeightEntry?.copyWith(id: null)), + WeightForm(lastWeightEntry?.copyWith(id: null, date: DateTime.now())), ), ); }, diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index 855d6f227..43874bd0c 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -209,7 +209,9 @@ class _DashboardWeightWidgetState extends State { FormScreen.routeName, arguments: FormScreenArguments( AppLocalizations.of(context).newEntry, - WeightForm(weightProvider.getNewestEntry()?.copyWith(id: null)), + WeightForm(weightProvider + .getNewestEntry() + ?.copyWith(id: null, date: DateTime.now())), ), ); }, diff --git a/lib/widgets/weight/forms.dart b/lib/widgets/weight/forms.dart index 1f47f0515..343a0cf87 100644 --- a/lib/widgets/weight/forms.dart +++ b/lib/widgets/weight/forms.dart @@ -110,8 +110,8 @@ class WeightForm extends StatelessWidget { icon: const FaIcon(FontAwesomeIcons.minus), onPressed: () { try { - final num newValue = num.parse(weightController.text) - 0.25; - weightController.text = newValue.toString(); + final num newValue = num.parse(weightController.text) - 0.1; + weightController.text = newValue.toStringAsFixed(1); } on FormatException {} }, ), @@ -125,8 +125,8 @@ class WeightForm extends StatelessWidget { icon: const FaIcon(FontAwesomeIcons.plus), onPressed: () { try { - final num newValue = num.parse(weightController.text) + 0.25; - weightController.text = newValue.toString(); + final num newValue = num.parse(weightController.text) + 0.1; + weightController.text = newValue.toStringAsFixed(1); } on FormatException {} }, ), diff --git a/test/weight/weight_form_test.dart b/test/weight/weight_form_test.dart index e1158da38..e84028694 100644 --- a/test/weight/weight_form_test.dart +++ b/test/weight/weight_form_test.dart @@ -52,10 +52,10 @@ void main() { expect(find.text('79'), findsOneWidget); await tester.tap(find.byKey(const Key('quickMinusSmall'))); - expect(find.text('78.75'), findsOneWidget); + expect(find.text('78.9'), findsOneWidget); await tester.tap(find.byKey(const Key('quickPlus'))); - expect(find.text('79.75'), findsOneWidget); + expect(find.text('79.9'), findsOneWidget); await tester.tap(find.byKey(const Key('quickPlusSmall'))); expect(find.text('80.0'), findsOneWidget);