Apply super.key linting suggestions

This commit is contained in:
Brandon Presley 2023-11-10 17:09:20 +13:00
parent b085d3bfb6
commit 83da62b5d9
6 changed files with 12 additions and 9 deletions

View File

@ -7,8 +7,8 @@ class DynamicColorScheme extends StatefulWidget {
const DynamicColorScheme({ const DynamicColorScheme({
required this.data, required this.data,
required this.builder, required this.builder,
Key? key, super.key,
}) : super(key: key); });
@override @override
createState() => _DynamicColorSchemeState(); createState() => _DynamicColorSchemeState();

View File

@ -27,12 +27,15 @@ class _EditGymSetPageState extends State<EditGymSetPage> {
void initState() { void initState() {
super.initState(); super.initState();
gymSet = widget.gymSet; gymSet = widget.gymSet;
print(gymSet);
_nameController.text = gymSet.name.value; _nameController.text = gymSet.name.value;
_repsController.text = gymSet.reps.value.toString(); _repsController.text = gymSet.reps.value.toString();
_weightController.text = gymSet.weight.value.toString(); _weightController.text = gymSet.weight.value.toString();
if (gymSet.id.present) if (gymSet.id.present) {
repsNode.requestFocus(); repsNode.requestFocus();
else _repsController.selection = TextSelection(
baseOffset: 0, extentOffset: _repsController.text.length);
} else
nameNode.requestFocus(); nameNode.requestFocus();
} }
@ -120,7 +123,7 @@ class _EditGymSetPageState extends State<EditGymSetPage> {
return; return;
} }
if (gymSet.id.present) if (gymSet.id.present)
await db.update(db.gymSets).write(gymSet); await db.update(db.gymSets).replace(gymSet);
else { else {
await Permission.notification.request(); await Permission.notification.request();
await db.into(db.gymSets).insert(gymSet); await db.into(db.gymSets).insert(gymSet);

View File

@ -10,7 +10,7 @@ void main() {
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key); MyApp({super.key});
final navigatorKey = GlobalKey<NavigatorState>(); final navigatorKey = GlobalKey<NavigatorState>();

View File

@ -20,7 +20,7 @@ class PlansPage extends StatelessWidget {
} }
class _PlansPage extends StatefulWidget { class _PlansPage extends StatefulWidget {
const _PlansPage({Key? key, required this.search}) : super(key: key); const _PlansPage({super.key, required this.search});
final String search; final String search;

View File

@ -9,7 +9,7 @@ import 'package:moor_flutter/moor_flutter.dart';
class SetList extends StatefulWidget { class SetList extends StatefulWidget {
final String search; final String search;
const SetList({Key? key, required this.search}) : super(key: key); const SetList({super.key, required this.search});
@override @override
createState() => _SetList(); createState() => _SetList();

View File

@ -26,7 +26,7 @@ class SettingsPage extends StatelessWidget {
} }
class _SettingsPage extends StatefulWidget { class _SettingsPage extends StatefulWidget {
const _SettingsPage({Key? key, required this.search}) : super(key: key); const _SettingsPage({super.key, required this.search});
final String search; final String search;