Skip to content

Commit 96faf89

Browse files
authored
Merge pull request #633 from wger-project/pr/sizzlesloth/632
improve pr 632
2 parents 80e33f3 + a64a50f commit 96faf89

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

AUTHORS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
- Bassam Mutairi - <https://github.com/mutairibassam>
3030
- Dieter Plaetinck - <https://github.com/Dieterbe>
3131
- Dennis van Peer - <https://github.com/Denpeer>
32+
- sizzlesloth - <https://github.com/sizzlesloth>
3233

3334
## Translators
3435

3536
- Saudi Arabian
36-
- Hanaa Allohibi <Gmail: programmerHanaa>
37+
- Hanaa Allohibi <Gmail: programmerHanaa>
3738

3839
- German
3940

@@ -66,7 +67,7 @@
6667
- Norwegian Bokmål
6768

6869
- Allan Nordhøy <[email protected]> (98)
69-
70+
7071
- Japanese
7172

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

7879
- Croatian
79-
80+
8081
- Sandi Milohaic <[email protected]>

lib/screens/weight_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class WeightScreen extends StatelessWidget {
4343
FormScreen.routeName,
4444
arguments: FormScreenArguments(
4545
AppLocalizations.of(context).newEntry,
46-
WeightForm(lastWeightEntry?.copyWith(id: null)),
46+
WeightForm(lastWeightEntry?.copyWith(id: null, date: DateTime.now())),
4747
),
4848
);
4949
},

lib/widgets/dashboard/widgets.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
209209
FormScreen.routeName,
210210
arguments: FormScreenArguments(
211211
AppLocalizations.of(context).newEntry,
212-
WeightForm(weightProvider.getNewestEntry()?.copyWith(id: null)),
212+
WeightForm(weightProvider
213+
.getNewestEntry()
214+
?.copyWith(id: null, date: DateTime.now())),
213215
),
214216
);
215217
},

lib/widgets/weight/forms.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class WeightForm extends StatelessWidget {
110110
icon: const FaIcon(FontAwesomeIcons.minus),
111111
onPressed: () {
112112
try {
113-
final num newValue = num.parse(weightController.text) - 0.25;
114-
weightController.text = newValue.toString();
113+
final num newValue = num.parse(weightController.text) - 0.1;
114+
weightController.text = newValue.toStringAsFixed(1);
115115
} on FormatException {}
116116
},
117117
),
@@ -125,8 +125,8 @@ class WeightForm extends StatelessWidget {
125125
icon: const FaIcon(FontAwesomeIcons.plus),
126126
onPressed: () {
127127
try {
128-
final num newValue = num.parse(weightController.text) + 0.25;
129-
weightController.text = newValue.toString();
128+
final num newValue = num.parse(weightController.text) + 0.1;
129+
weightController.text = newValue.toStringAsFixed(1);
130130
} on FormatException {}
131131
},
132132
),

test/weight/weight_form_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ void main() {
5252
expect(find.text('79'), findsOneWidget);
5353

5454
await tester.tap(find.byKey(const Key('quickMinusSmall')));
55-
expect(find.text('78.75'), findsOneWidget);
55+
expect(find.text('78.9'), findsOneWidget);
5656

5757
await tester.tap(find.byKey(const Key('quickPlus')));
58-
expect(find.text('79.75'), findsOneWidget);
58+
expect(find.text('79.9'), findsOneWidget);
5959

6060
await tester.tap(find.byKey(const Key('quickPlusSmall')));
6161
expect(find.text('80.0'), findsOneWidget);

0 commit comments

Comments
 (0)