diff --git a/lib/edit_set.dart b/lib/edit_set.dart index 0eba160..20131ec 100644 --- a/lib/edit_set.dart +++ b/lib/edit_set.dart @@ -126,7 +126,9 @@ class _EditGymSetPageState extends State { await db.update(db.gymSets).replace(gymSet); else { await Permission.notification.request(); - await db.into(db.gymSets).insert(gymSet); + final newSet = gymSet.copyWith( + created: Value(DateTime.now().toIso8601String())); + await db.into(db.gymSets).insert(newSet); const platform = MethodChannel('com.massive/android'); platform.invokeMethod('timer', [3000]); } diff --git a/lib/set_list.dart b/lib/set_list.dart index 12e38d7..c60817b 100644 --- a/lib/set_list.dart +++ b/lib/set_list.dart @@ -80,13 +80,12 @@ class _SetList extends State { await Navigator.push( context, MaterialPageRoute( - builder: (context) => EditGymSetPage( + builder: (context) => const EditGymSetPage( gymSet: GymSetsCompanion( - name: const Value(''), - reps: const Value(0), - weight: const Value(0), - image: const Value(''), - created: Value(DateTime.now().toString()), + name: Value(''), + reps: Value(0), + weight: Value(0), + image: Value(''), ), ), ),