Skip to content

Commit

Permalink
Merge pull request #633 from wger-project/pr/sizzlesloth/632
Browse files Browse the repository at this point in the history
improve pr 632
  • Loading branch information
Dieterbe authored Sep 7, 2024
2 parents 80e33f3 + a64a50f commit 96faf89
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
7 changes: 4 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
- Bassam Mutairi - <https://github.com/mutairibassam>
- Dieter Plaetinck - <https://github.com/Dieterbe>
- Dennis van Peer - <https://github.com/Denpeer>
- sizzlesloth - <https://github.com/sizzlesloth>

## Translators

- Saudi Arabian
- Hanaa Allohibi <Gmail: programmerHanaa>
- Hanaa Allohibi <Gmail: programmerHanaa>

- German

Expand Down Expand Up @@ -66,7 +67,7 @@
- Norwegian Bokmål

- Allan Nordhøy <[email protected]> (98)

- Japanese

- Kosei TANAKA <[email protected]> (97)
Expand All @@ -76,5 +77,5 @@
- Nenza Nurfirmansyah <[email protected]> (73)

- Croatian

- Sandi Milohaic <[email protected]>
2 changes: 1 addition & 1 deletion lib/screens/weight_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
),
);
},
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/dashboard/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
FormScreen.routeName,
arguments: FormScreenArguments(
AppLocalizations.of(context).newEntry,
WeightForm(weightProvider.getNewestEntry()?.copyWith(id: null)),
WeightForm(weightProvider
.getNewestEntry()
?.copyWith(id: null, date: DateTime.now())),
),
);
},
Expand Down
8 changes: 4 additions & 4 deletions lib/widgets/weight/forms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
},
),
Expand All @@ -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 {}
},
),
Expand Down
4 changes: 2 additions & 2 deletions test/weight/weight_form_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 96faf89

Please sign in to comment.