diff --git a/add_to_app/books/flutter_module_books/lib/main.dart b/add_to_app/books/flutter_module_books/lib/main.dart index dc0c040e4..588eda016 100644 --- a/add_to_app/books/flutter_module_books/lib/main.dart +++ b/add_to_app/books/flutter_module_books/lib/main.dart @@ -8,7 +8,7 @@ import 'package:flutter_module_books/api.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -35,8 +35,7 @@ class FlutterBookApiHandler extends FlutterBookApi { } class BookDetail extends StatefulWidget { - const BookDetail({Key? key, this.hostApi, this.flutterApi, this.book}) - : super(key: key); + const BookDetail({super.key, this.hostApi, this.flutterApi, this.book}); // These are the outgoing and incoming APIs that are here for injection for // tests. @@ -148,13 +147,13 @@ class _BookDetailState extends State { class BookForm extends StatelessWidget { const BookForm({ - Key? key, + super.key, required this.book, required this.focusNode, required this.authorTextController, required this.subtitleTextController, required this.titleTextController, - }) : super(key: key); + }); final Book book; final FocusNode focusNode; diff --git a/add_to_app/fullscreen/flutter_module/lib/main.dart b/add_to_app/fullscreen/flutter_module/lib/main.dart index 4e991894d..475961a0a 100644 --- a/add_to_app/fullscreen/flutter_module/lib/main.dart +++ b/add_to_app/fullscreen/flutter_module/lib/main.dart @@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier { /// It offers two routes, one suitable for displaying as a full screen and /// another designed to be part of a larger UI.class MyApp extends StatelessWidget { class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -75,7 +75,7 @@ class MyApp extends StatelessWidget { /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// full-screen. class FullScreenView extends StatelessWidget { - const FullScreenView({Key? key}) : super(key: key); + const FullScreenView({super.key}); @override Widget build(BuildContext context) { @@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget { class Contents extends StatelessWidget { final bool showExit; - const Contents({this.showExit = false, Key? key}) : super(key: key); + const Contents({this.showExit = false, super.key}); @override Widget build(BuildContext context) { diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart b/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart index b7a00dcdb..6d022d0da 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart +++ b/add_to_app/multiple_flutters/multiple_flutters_module/lib/main.dart @@ -15,7 +15,7 @@ void topMain() => runApp(const MyApp(color: Colors.green)); void bottomMain() => runApp(const MyApp(color: Colors.purple)); class MyApp extends StatelessWidget { - const MyApp({Key? key, required this.color}) : super(key: key); + const MyApp({super.key, required this.color}); final MaterialColor color; @@ -32,7 +32,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key, required this.title}) : super(key: key); + const MyHomePage({super.key, required this.title}); final String title; @override diff --git a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart index 4c59ffdcd..a91c41425 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart +++ b/add_to_app/plugin/flutter_module_using_plugin/lib/cell.dart @@ -15,7 +15,7 @@ void main() { } class Cell extends StatefulWidget { - const Cell({Key? key}) : super(key: key); + const Cell({super.key}); @override State createState() => _CellState(); diff --git a/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart b/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart index 69aacdc6f..9b9c2294a 100644 --- a/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart +++ b/add_to_app/plugin/flutter_module_using_plugin/lib/main.dart @@ -69,7 +69,7 @@ class CounterModel extends ChangeNotifier { /// It offers two routes, one suitable for displaying as a full screen and /// another designed to be part of a larger UI. class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -86,7 +86,7 @@ class MyApp extends StatelessWidget { /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// full-screen. class FullScreenView extends StatelessWidget { - const FullScreenView({Key? key}) : super(key: key); + const FullScreenView({super.key}); @override Widget build(BuildContext context) { @@ -108,7 +108,7 @@ class FullScreenView extends StatelessWidget { class Contents extends StatelessWidget { final bool showExit; - const Contents({Key? key, this.showExit = false}) : super(key: key); + const Contents({super.key, this.showExit = false}); @override Widget build(BuildContext context) { diff --git a/add_to_app/prebuilt_module/flutter_module/lib/main.dart b/add_to_app/prebuilt_module/flutter_module/lib/main.dart index 3a327a9f7..9248db3e5 100644 --- a/add_to_app/prebuilt_module/flutter_module/lib/main.dart +++ b/add_to_app/prebuilt_module/flutter_module/lib/main.dart @@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier { /// It offers two routes, one suitable for displaying as a full screen and /// another designed to be part of a larger UI.class MyApp extends StatelessWidget { class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -75,7 +75,7 @@ class MyApp extends StatelessWidget { /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// full-screen. class FullScreenView extends StatelessWidget { - const FullScreenView({Key? key}) : super(key: key); + const FullScreenView({super.key}); @override Widget build(BuildContext context) { @@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget { class Contents extends StatelessWidget { final bool showExit; - const Contents({Key? key, this.showExit = false}) : super(key: key); + const Contents({super.key, this.showExit = false}); @override Widget build(BuildContext context) { diff --git a/analysis_options.yaml b/analysis_options.yaml index daef00116..455dedfa4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -18,3 +18,4 @@ linter: throw_in_finally: true unawaited_futures: true unnecessary_statements: true + use_super_parameters: true diff --git a/android_splash_screen/lib/main.dart b/android_splash_screen/lib/main.dart index 3b75c659b..7f0986a77 100644 --- a/android_splash_screen/lib/main.dart +++ b/android_splash_screen/lib/main.dart @@ -22,7 +22,7 @@ Future main() async { /* Main widget that contains the Flutter starter app. */ class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -37,7 +37,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key, required this.title}) : super(key: key); + const MyHomePage({super.key, required this.title}); final String title; @@ -85,7 +85,7 @@ class _MyHomePageState extends State { /* A Flutter implementation of the last frame of the splashscreen animation */ class CustomAppBar extends StatelessWidget { - const CustomAppBar({Key? key}) : super(key: key); + const CustomAppBar({super.key}); @override Widget build(BuildContext context) { diff --git a/experimental/linting_tool/lib/app.dart b/experimental/linting_tool/lib/app.dart index b4d2a8bc5..60781e03a 100644 --- a/experimental/linting_tool/lib/app.dart +++ b/experimental/linting_tool/lib/app.dart @@ -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; diff --git a/experimental/linting_tool/lib/pages/default_lints_page.dart b/experimental/linting_tool/lib/pages/default_lints_page.dart index 31dd2958c..81cec23e3 100644 --- a/experimental/linting_tool/lib/pages/default_lints_page.dart +++ b/experimental/linting_tool/lib/pages/default_lints_page.dart @@ -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) { diff --git a/experimental/linting_tool/lib/pages/default_rules_page.dart b/experimental/linting_tool/lib/pages/default_rules_page.dart index 39c08de8e..d23fc3718 100644 --- a/experimental/linting_tool/lib/pages/default_rules_page.dart +++ b/experimental/linting_tool/lib/pages/default_rules_page.dart @@ -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) { diff --git a/experimental/linting_tool/lib/pages/home_page.dart b/experimental/linting_tool/lib/pages/home_page.dart index 60dc32687..eef20ca9c 100644 --- a/experimental/linting_tool/lib/pages/home_page.dart +++ b/experimental/linting_tool/lib/pages/home_page.dart @@ -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) { diff --git a/experimental/linting_tool/lib/pages/rules_page.dart b/experimental/linting_tool/lib/pages/rules_page.dart index 72680590b..0e9816da1 100644 --- a/experimental/linting_tool/lib/pages/rules_page.dart +++ b/experimental/linting_tool/lib/pages/rules_page.dart @@ -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) { diff --git a/experimental/linting_tool/lib/pages/saved_lints_page.dart b/experimental/linting_tool/lib/pages/saved_lints_page.dart index 672ed49bf..45940a432 100644 --- a/experimental/linting_tool/lib/pages/saved_lints_page.dart +++ b/experimental/linting_tool/lib/pages/saved_lints_page.dart @@ -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 createState() => _SavedLintsPageState(); diff --git a/experimental/linting_tool/lib/widgets/adaptive_nav.dart b/experimental/linting_tool/lib/widgets/adaptive_nav.dart index 8868ea98e..d6327fc9d 100644 --- a/experimental/linting_tool/lib/widgets/adaptive_nav.dart +++ b/experimental/linting_tool/lib/widgets/adaptive_nav.dart @@ -15,7 +15,7 @@ import 'package:linting_tool/theme/colors.dart'; final navKey = GlobalKey(); class AdaptiveNav extends StatefulWidget { - const AdaptiveNav({Key? key}) : super(key: key); + const AdaptiveNav({super.key}); @override State createState() => _AdaptiveNavState(); @@ -60,11 +60,10 @@ class _AdaptiveNavState extends State { 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; diff --git a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart index 64df09601..7adee35a6 100644 --- a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart +++ b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart @@ -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 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 createState() => _NewProfileDialogState(); @@ -276,9 +274,9 @@ class _NewProfileDialogState extends State { class ExistingProfileDialog extends StatefulWidget { const ExistingProfileDialog({ - Key? key, + super.key, required this.rule, - }) : super(key: key); + }); final Rule rule; diff --git a/experimental/linting_tool/lib/widgets/saved_rule_tile.dart b/experimental/linting_tool/lib/widgets/saved_rule_tile.dart index 693fdbbc7..999ce523b 100644 --- a/experimental/linting_tool/lib/widgets/saved_rule_tile.dart +++ b/experimental/linting_tool/lib/widgets/saved_rule_tile.dart @@ -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 createState() => _SavedRuleTileState(); diff --git a/experimental/linting_tool/test/widget_test.dart b/experimental/linting_tool/test/widget_test.dart index b46e8ae8a..10bffef4b 100644 --- a/experimental/linting_tool/test/widget_test.dart +++ b/experimental/linting_tool/test/widget_test.dart @@ -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) { diff --git a/experimental/web_dashboard/lib/src/app.dart b/experimental/web_dashboard/lib/src/app.dart index ca2a43e33..ce856dab5 100644 --- a/experimental/web_dashboard/lib/src/app.dart +++ b/experimental/web_dashboard/lib/src/app.dart @@ -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 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 createState() => _SignInSwitcherState(); diff --git a/experimental/web_dashboard/lib/src/pages/dashboard.dart b/experimental/web_dashboard/lib/src/pages/dashboard.dart index 6b7a1f6df..d783667d7 100644 --- a/experimental/web_dashboard/lib/src/pages/dashboard.dart +++ b/experimental/web_dashboard/lib/src/pages/dashboard.dart @@ -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? categories; - const Dashboard(this.categories, {Key? key}) : super(key: key); + const Dashboard(this.categories, {super.key}); @override Widget build(BuildContext context) { diff --git a/experimental/web_dashboard/lib/src/pages/entries.dart b/experimental/web_dashboard/lib/src/pages/entries.dart index 7706dc4c9..a22ae6080 100644 --- a/experimental/web_dashboard/lib/src/pages/entries.dart +++ b/experimental/web_dashboard/lib/src/pages/entries.dart @@ -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 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) { diff --git a/experimental/web_dashboard/lib/src/pages/home.dart b/experimental/web_dashboard/lib/src/pages/home.dart index fea401a84..a2f45f52b 100644 --- a/experimental/web_dashboard/lib/src/pages/home.dart +++ b/experimental/web_dashboard/lib/src/pages/home.dart @@ -16,8 +16,8 @@ class HomePage extends StatefulWidget { const HomePage({ required this.onSignOut, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => _HomePageState(); diff --git a/experimental/web_dashboard/lib/src/pages/sign_in.dart b/experimental/web_dashboard/lib/src/pages/sign_in.dart index 1b7918b58..51749c22e 100644 --- a/experimental/web_dashboard/lib/src/pages/sign_in.dart +++ b/experimental/web_dashboard/lib/src/pages/sign_in.dart @@ -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 createState() => _SignInButtonState(); diff --git a/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart b/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart index dc737982a..ce2c65882 100644 --- a/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart +++ b/experimental/web_dashboard/lib/src/widgets/categories_dropdown.dart @@ -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 createState() => _CategoryDropdownState(); diff --git a/experimental/web_dashboard/lib/src/widgets/category_chart.dart b/experimental/web_dashboard/lib/src/widgets/category_chart.dart index 5a976e767..2c39639be 100644 --- a/experimental/web_dashboard/lib/src/widgets/category_chart.dart +++ b/experimental/web_dashboard/lib/src/widgets/category_chart.dart @@ -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) { diff --git a/experimental/web_dashboard/lib/src/widgets/category_forms.dart b/experimental/web_dashboard/lib/src/widgets/category_forms.dart index 370f49ddd..c53e643ba 100644 --- a/experimental/web_dashboard/lib/src/widgets/category_forms.dart +++ b/experimental/web_dashboard/lib/src/widgets/category_forms.dart @@ -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 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 createState() => _EditCategoryFormState(); diff --git a/experimental/web_dashboard/lib/src/widgets/dialogs.dart b/experimental/web_dashboard/lib/src/widgets/dialogs.dart index 6f933c54c..63faeca51 100644 --- a/experimental/web_dashboard/lib/src/widgets/dialogs.dart +++ b/experimental/web_dashboard/lib/src/widgets/dialogs.dart @@ -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 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) { diff --git a/experimental/web_dashboard/lib/src/widgets/edit_entry.dart b/experimental/web_dashboard/lib/src/widgets/edit_entry.dart index 3edf854d0..5c45c7251 100644 --- a/experimental/web_dashboard/lib/src/widgets/edit_entry.dart +++ b/experimental/web_dashboard/lib/src/widgets/edit_entry.dart @@ -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 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 createState() => _EditEntryFormState(); diff --git a/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart b/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart index 2f8a33f05..975c22dcd 100644 --- a/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart +++ b/experimental/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart @@ -43,8 +43,8 @@ class AdaptiveScaffold extends StatefulWidget { required this.destinations, this.onNavigationIndexChange, this.floatingActionButton, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => _AdaptiveScaffoldState(); diff --git a/navigation_and_routing/lib/src/widgets/fade_transition_page.dart b/navigation_and_routing/lib/src/widgets/fade_transition_page.dart index 52df8d04c..552171b06 100644 --- a/navigation_and_routing/lib/src/widgets/fade_transition_page.dart +++ b/navigation_and_routing/lib/src/widgets/fade_transition_page.dart @@ -9,10 +9,10 @@ class FadeTransitionPage extends Page { final Duration duration; const FadeTransitionPage({ - LocalKey? key, + super.key, required this.child, this.duration = const Duration(milliseconds: 300), - }) : super(key: key); + }); @override Route createRoute(BuildContext context) => diff --git a/simplistic_editor/lib/replacements.dart b/simplistic_editor/lib/replacements.dart index 15e148914..419a8d071 100644 --- a/simplistic_editor/lib/replacements.dart +++ b/simplistic_editor/lib/replacements.dart @@ -389,19 +389,18 @@ class TextEditingInlineSpanReplacement { class ReplacementTextEditingController extends TextEditingController { /// Constructs a controller with optional text that handles the provided list of replacements. ReplacementTextEditingController({ - String? text, + super.text, List? replacements, this.composingRegionReplaceable = true, - }) : replacements = replacements ?? [], - super(text: text); + }) : replacements = replacements ?? []; /// Creates a controller for an editable text field from an initial [TextEditingValue]. /// /// This constructor treats a null [value] argument as if it were [TextEditingValue.empty]. - ReplacementTextEditingController.fromValue(TextEditingValue? value, + ReplacementTextEditingController.fromValue(super.value, {List? replacements, this.composingRegionReplaceable = true}) - : super.fromValue(value); + : super.fromValue(); /// The [TextEditingInlineSpanReplacement]s that are evaluated on the editing value. /// diff --git a/web/particle_background/lib/main.dart b/web/particle_background/lib/main.dart index 6879a2429..315c1f715 100644 --- a/web/particle_background/lib/main.dart +++ b/web/particle_background/lib/main.dart @@ -6,7 +6,7 @@ import 'package:particle_background/simple_animations_package.dart'; void main() => runApp(const ParticleApp()); class ParticleApp extends StatelessWidget { - const ParticleApp({Key? key}) : super(key: key); + const ParticleApp({super.key}); @override Widget build(BuildContext context) { @@ -19,7 +19,7 @@ class ParticleApp extends StatelessWidget { } class ParticleBackgroundPage extends StatelessWidget { - const ParticleBackgroundPage({Key? key}) : super(key: key); + const ParticleBackgroundPage({super.key}); @override Widget build(BuildContext context) { @@ -36,7 +36,7 @@ class ParticleBackgroundPage extends StatelessWidget { class Particles extends StatefulWidget { final int numberOfParticles; - const Particles(this.numberOfParticles, {key}) : super(key: key); + const Particles(this.numberOfParticles, {super.key}); @override State createState() => _ParticlesState(); @@ -133,7 +133,7 @@ class ParticlePainter extends CustomPainter { } class AnimatedBackground extends StatelessWidget { - const AnimatedBackground({Key? key}) : super(key: key); + const AnimatedBackground({super.key}); @override Widget build(BuildContext context) { @@ -165,8 +165,8 @@ class AnimatedBackground extends StatelessWidget { class CenteredText extends StatelessWidget { const CenteredText({ - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/web/particle_background/lib/simple_animations_package.dart b/web/particle_background/lib/simple_animations_package.dart index 1cec3f7eb..af5ae7374 100644 --- a/web/particle_background/lib/simple_animations_package.dart +++ b/web/particle_background/lib/simple_animations_package.dart @@ -32,8 +32,7 @@ class Rendering extends StatefulWidget { this.onTick, this.startTime = Duration.zero, this.startTimeSimulationTicks = 20, - Key? key}) - : super(key: key); + super.key}); @override State createState() => _RenderingState(); @@ -323,7 +322,7 @@ class ControlledAnimation extends StatefulWidget { this.child, this.animationControllerStatusListener, this.startPosition = 0.0, - Key? key}) + super.key}) : assert( (builderWithChild != null && child != null && builder == null) || (builder != null && builderWithChild == null && child == null), @@ -332,8 +331,7 @@ class ControlledAnimation extends StatefulWidget { assert( startPosition >= 0 && startPosition <= 1, "The property startPosition " - "must have a value between 0.0 and 1.0."), - super(key: key); + "must have a value between 0.0 and 1.0."); @override State createState() => _ControlledAnimationState();