Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve pr 632 #633

Merged
merged 4 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading