File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class WeightEntry {
43
43
WeightEntry copyWith ({int ? id, int ? weight, DateTime ? date}) => WeightEntry (
44
44
id: id,
45
45
weight: weight ?? this .weight,
46
- date: date ?? this .date ,
46
+ date: date ?? DateTime . now () ,
47
47
);
48
48
49
49
// Boilerplate
Original file line number Diff line number Diff line change @@ -110,8 +110,8 @@ class WeightForm extends StatelessWidget {
110
110
icon: const FaIcon (FontAwesomeIcons .minus),
111
111
onPressed: () {
112
112
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 );
115
115
} on FormatException {}
116
116
},
117
117
),
@@ -125,8 +125,8 @@ class WeightForm extends StatelessWidget {
125
125
icon: const FaIcon (FontAwesomeIcons .plus),
126
126
onPressed: () {
127
127
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 );
130
130
} on FormatException {}
131
131
},
132
132
),
You can’t perform that action at this time.
0 commit comments