1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 23:08:59 +00:00

Enforce use_key_in_widget_constructors and file_names lints (#913)

* Start enforcing use_key_in_widget_constructors and file_names lints

* dart format

* analysis fixes

* analysis fixes, pt2

* analysis fixes, part 3

* Revert platform_design (test failure)

* More reverts

* Notate why we aren't enforcing a lint
This commit is contained in:
Brett Morgan
2021-10-09 08:30:28 +11:00
committed by GitHub
parent e160f5261c
commit e2e2713986
69 changed files with 174 additions and 114 deletions

View File

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

View File

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

View File

@@ -8,6 +8,8 @@ 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);
@override
_NewCategoryFormState createState() => _NewCategoryFormState();
}
@@ -37,7 +39,8 @@ class EditCategoryForm extends StatefulWidget {
const EditCategoryForm({
@required this.category,
@required this.onDone,
});
Key key,
}) : super(key: key);
@override
_EditCategoryFormState createState() => _EditCategoryFormState();

View File

@@ -11,10 +11,12 @@ import '../app.dart';
import 'edit_entry.dart';
class NewCategoryDialog extends StatelessWidget {
const NewCategoryDialog({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: const Text('New Category'),
return const SimpleDialog(
title: Text('New Category'),
children: <Widget>[
NewCategoryForm(),
],
@@ -27,7 +29,8 @@ class EditCategoryDialog extends StatelessWidget {
const EditCategoryDialog({
@required this.category,
});
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -51,6 +54,8 @@ class EditCategoryDialog extends StatelessWidget {
}
class NewEntryDialog extends StatefulWidget {
const NewEntryDialog({Key key}) : super(key: key);
@override
_NewEntryDialogState createState() => _NewEntryDialogState();
}
@@ -58,8 +63,8 @@ class NewEntryDialog extends StatefulWidget {
class _NewEntryDialogState extends State<NewEntryDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: const Text('New Entry'),
return const SimpleDialog(
title: Text('New Entry'),
children: [
NewEntryForm(),
],
@@ -74,7 +79,8 @@ class EditEntryDialog extends StatelessWidget {
const EditEntryDialog({
this.category,
this.entry,
});
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {

View File

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

View File

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