diff --git a/lib/models/body_weight/weight_entry.dart b/lib/models/body_weight/weight_entry.dart index 62a5dd87..47c8be9f 100644 --- a/lib/models/body_weight/weight_entry.dart +++ b/lib/models/body_weight/weight_entry.dart @@ -43,7 +43,7 @@ class WeightEntry { WeightEntry copyWith({int? id, int? weight, DateTime? date}) => WeightEntry( id: id, weight: weight ?? this.weight, - date: date ?? DateTime.now(), + date: date ?? this.date, ); // Boilerplate diff --git a/lib/screens/weight_screen.dart b/lib/screens/weight_screen.dart index ee0dc429..17e620da 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 855d6f22..43874bd0 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())), ), ); },