diff --git a/lib/dynamic_color_scheme.dart b/lib/dynamic_color_scheme.dart index 83d346b..472f026 100644 --- a/lib/dynamic_color_scheme.dart +++ b/lib/dynamic_color_scheme.dart @@ -7,8 +7,8 @@ class DynamicColorScheme extends StatefulWidget { const DynamicColorScheme({ required this.data, required this.builder, - Key? key, - }) : super(key: key); + super.key, + }); @override createState() => _DynamicColorSchemeState(); diff --git a/lib/edit_set.dart b/lib/edit_set.dart index af46271..0eba160 100644 --- a/lib/edit_set.dart +++ b/lib/edit_set.dart @@ -27,12 +27,15 @@ class _EditGymSetPageState extends State { void initState() { super.initState(); gymSet = widget.gymSet; + print(gymSet); _nameController.text = gymSet.name.value; _repsController.text = gymSet.reps.value.toString(); _weightController.text = gymSet.weight.value.toString(); - if (gymSet.id.present) + if (gymSet.id.present) { repsNode.requestFocus(); - else + _repsController.selection = TextSelection( + baseOffset: 0, extentOffset: _repsController.text.length); + } else nameNode.requestFocus(); } @@ -120,7 +123,7 @@ class _EditGymSetPageState extends State { return; } if (gymSet.id.present) - await db.update(db.gymSets).write(gymSet); + await db.update(db.gymSets).replace(gymSet); else { await Permission.notification.request(); await db.into(db.gymSets).insert(gymSet); diff --git a/lib/main.dart b/lib/main.dart index 34fbb4a..bab2c19 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,7 +10,7 @@ void main() { } class MyApp extends StatelessWidget { - MyApp({Key? key}) : super(key: key); + MyApp({super.key}); final navigatorKey = GlobalKey(); diff --git a/lib/plans_page.dart b/lib/plans_page.dart index b3f9580..a90cb90 100644 --- a/lib/plans_page.dart +++ b/lib/plans_page.dart @@ -20,7 +20,7 @@ class PlansPage extends StatelessWidget { } class _PlansPage extends StatefulWidget { - const _PlansPage({Key? key, required this.search}) : super(key: key); + const _PlansPage({super.key, required this.search}); final String search; diff --git a/lib/set_list.dart b/lib/set_list.dart index f2604cd..ba32818 100644 --- a/lib/set_list.dart +++ b/lib/set_list.dart @@ -9,7 +9,7 @@ import 'package:moor_flutter/moor_flutter.dart'; class SetList extends StatefulWidget { final String search; - const SetList({Key? key, required this.search}) : super(key: key); + const SetList({super.key, required this.search}); @override createState() => _SetList(); diff --git a/lib/settings_page.dart b/lib/settings_page.dart index 8d5eabc..8feb287 100644 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -26,7 +26,7 @@ class SettingsPage extends StatelessWidget { } class _SettingsPage extends StatefulWidget { - const _SettingsPage({Key? key, required this.search}) : super(key: key); + const _SettingsPage({super.key, required this.search}); final String search;