1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00

Add use_super_parameters lint (#1269)

This commit is contained in:
Brett Morgan
2022-05-17 02:53:27 -07:00
committed by GitHub
parent 58bc5d7a58
commit 3a0a652984
33 changed files with 90 additions and 100 deletions

View File

@@ -14,7 +14,7 @@ import 'package:provider/provider.dart';
final client = http.Client();
class LintingTool extends StatefulWidget {
const LintingTool({Key? key}) : super(key: key);
const LintingTool({super.key});
static const String homeRoute = routes.homeRoute;

View File

@@ -10,7 +10,7 @@ import 'package:linting_tool/theme/colors.dart';
import 'package:provider/provider.dart';
class DefaultLintsPage extends StatelessWidget {
const DefaultLintsPage({Key? key}) : super(key: key);
const DefaultLintsPage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -13,8 +13,8 @@ class DefaultRulesPage extends StatelessWidget {
const DefaultRulesPage({
required this.profile,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -9,7 +9,7 @@ import 'package:linting_tool/widgets/lint_expansion_tile.dart';
import 'package:provider/provider.dart';
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
const HomePage({super.key});
@override
Widget build(BuildContext context) {

View File

@@ -16,8 +16,8 @@ class RulesPage extends StatelessWidget {
const RulesPage({
required this.selectedProfileIndex,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -11,7 +11,7 @@ import 'package:linting_tool/theme/colors.dart';
import 'package:provider/provider.dart';
class SavedLintsPage extends StatefulWidget {
const SavedLintsPage({Key? key}) : super(key: key);
const SavedLintsPage({super.key});
@override
State<SavedLintsPage> createState() => _SavedLintsPageState();

View File

@@ -15,7 +15,7 @@ import 'package:linting_tool/theme/colors.dart';
final navKey = GlobalKey<NavigatorState>();
class AdaptiveNav extends StatefulWidget {
const AdaptiveNav({Key? key}) : super(key: key);
const AdaptiveNav({super.key});
@override
State<AdaptiveNav> createState() => _AdaptiveNavState();
@@ -60,11 +60,10 @@ class _AdaptiveNavState extends State<AdaptiveNav> {
class _NavView extends StatefulWidget {
const _NavView({
Key? key,
required this.extended,
required this.destinations,
this.trailing,
}) : super(key: key);
});
final bool extended;
final List<_Destination> destinations;

View File

@@ -15,8 +15,8 @@ class LintExpansionTile extends StatefulWidget {
final Rule rule;
const LintExpansionTile({
required this.rule,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<LintExpansionTile> createState() => _LintExpansionTileState();
@@ -171,9 +171,7 @@ enum ProfileType {
}
class _ProfileTypeDialog extends StatelessWidget {
const _ProfileTypeDialog({
Key? key,
}) : super(key: key);
const _ProfileTypeDialog();
@override
Widget build(BuildContext context) {
@@ -209,8 +207,8 @@ class NewProfileDialog extends StatefulWidget {
final Rule rule;
const NewProfileDialog({
required this.rule,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<NewProfileDialog> createState() => _NewProfileDialogState();
@@ -276,9 +274,9 @@ class _NewProfileDialogState extends State<NewProfileDialog> {
class ExistingProfileDialog extends StatefulWidget {
const ExistingProfileDialog({
Key? key,
super.key,
required this.rule,
}) : super(key: key);
});
final Rule rule;

View File

@@ -14,8 +14,8 @@ class SavedRuleTile extends StatefulWidget {
final Rule rule;
const SavedRuleTile({
required this.rule,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<SavedRuleTile> createState() => _SavedRuleTileState();

View File

@@ -27,9 +27,7 @@ import 'widget_test.mocks.dart';
late MockClient _mockClient;
class _TestApp extends StatelessWidget {
const _TestApp({
Key? key,
}) : super(key: key);
const _TestApp();
@override
Widget build(BuildContext context) {

View File

@@ -39,16 +39,14 @@ class DashboardApp extends StatefulWidget {
final ApiBuilder apiBuilder;
/// Runs the app using Firebase
DashboardApp.firebase({Key? key})
DashboardApp.firebase({super.key})
: auth = FirebaseAuthService(),
apiBuilder = _apiBuilder,
super(key: key);
apiBuilder = _apiBuilder;
/// Runs the app using mock data
DashboardApp.mock({Key? key})
DashboardApp.mock({super.key})
: auth = MockAuthService(),
apiBuilder = _mockApiBuilder,
super(key: key);
apiBuilder = _mockApiBuilder;
@override
State<DashboardApp> createState() => _DashboardAppState();
@@ -86,8 +84,8 @@ class SignInSwitcher extends StatefulWidget {
const SignInSwitcher({
this.appState,
this.apiBuilder,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<SignInSwitcher> createState() => _SignInSwitcherState();

View File

@@ -10,7 +10,7 @@ import '../app.dart';
import '../widgets/category_chart.dart';
class DashboardPage extends StatelessWidget {
const DashboardPage({Key? key}) : super(key: key);
const DashboardPage({super.key});
@override
Widget build(BuildContext context) {
@@ -43,7 +43,7 @@ class DashboardPage extends StatelessWidget {
class Dashboard extends StatelessWidget {
final List<Category>? categories;
const Dashboard(this.categories, {Key? key}) : super(key: key);
const Dashboard(this.categories, {super.key});
@override
Widget build(BuildContext context) {

View File

@@ -12,7 +12,7 @@ import '../widgets/categories_dropdown.dart';
import '../widgets/dialogs.dart';
class EntriesPage extends StatefulWidget {
const EntriesPage({Key? key}) : super(key: key);
const EntriesPage({super.key});
@override
State<EntriesPage> createState() => _EntriesPageState();
@@ -102,8 +102,8 @@ class EntryTile extends StatelessWidget {
const EntryTile({
this.category,
this.entry,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -16,8 +16,8 @@ class HomePage extends StatefulWidget {
const HomePage({
required this.onSignOut,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<HomePage> createState() => _HomePageState();

View File

@@ -13,8 +13,8 @@ class SignInPage extends StatelessWidget {
const SignInPage({
required this.auth,
required this.onSuccess,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {
@@ -33,8 +33,8 @@ class SignInButton extends StatefulWidget {
const SignInButton({
required this.auth,
required this.onSuccess,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<SignInButton> createState() => _SignInButtonState();

View File

@@ -16,8 +16,8 @@ class CategoryDropdown extends StatefulWidget {
const CategoryDropdown({
required this.api,
required this.onSelected,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<CategoryDropdown> createState() => _CategoryDropdownState();

View File

@@ -20,8 +20,8 @@ class CategoryChart extends StatelessWidget {
const CategoryChart({
required this.category,
required this.api,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -8,7 +8,7 @@ import 'package:web_dashboard/src/api/api.dart';
import 'package:web_dashboard/src/app.dart';
class NewCategoryForm extends StatefulWidget {
const NewCategoryForm({Key? key}) : super(key: key);
const NewCategoryForm({super.key});
@override
State<NewCategoryForm> createState() => _NewCategoryFormState();
@@ -39,8 +39,8 @@ class EditCategoryForm extends StatefulWidget {
const EditCategoryForm({
required this.category,
required this.onDone,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<EditCategoryForm> createState() => _EditCategoryFormState();

View File

@@ -11,7 +11,7 @@ import '../app.dart';
import 'edit_entry.dart';
class NewCategoryDialog extends StatelessWidget {
const NewCategoryDialog({Key? key}) : super(key: key);
const NewCategoryDialog({super.key});
@override
Widget build(BuildContext context) {
@@ -29,8 +29,8 @@ class EditCategoryDialog extends StatelessWidget {
const EditCategoryDialog({
required this.category,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {
@@ -54,7 +54,7 @@ class EditCategoryDialog extends StatelessWidget {
}
class NewEntryDialog extends StatefulWidget {
const NewEntryDialog({Key? key}) : super(key: key);
const NewEntryDialog({super.key});
@override
State<NewEntryDialog> createState() => _NewEntryDialogState();
@@ -79,8 +79,8 @@ class EditEntryDialog extends StatelessWidget {
const EditEntryDialog({
this.category,
this.entry,
Key? key,
}) : super(key: key);
super.key,
});
@override
Widget build(BuildContext context) {

View File

@@ -11,7 +11,7 @@ import '../app.dart';
import 'categories_dropdown.dart';
class NewEntryForm extends StatefulWidget {
const NewEntryForm({Key? key}) : super(key: key);
const NewEntryForm({super.key});
@override
State<NewEntryForm> createState() => _NewEntryFormState();
@@ -61,8 +61,8 @@ class EditEntryForm extends StatefulWidget {
const EditEntryForm({
required this.entry,
required this.onDone,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<EditEntryForm> createState() => _EditEntryFormState();

View File

@@ -43,8 +43,8 @@ class AdaptiveScaffold extends StatefulWidget {
required this.destinations,
this.onNavigationIndexChange,
this.floatingActionButton,
Key? key,
}) : super(key: key);
super.key,
});
@override
State<AdaptiveScaffold> createState() => _AdaptiveScaffoldState();