Add `use_super_parameters` lint (#1269)

pull/1273/head
Brett Morgan 2 years ago committed by GitHub
parent 58bc5d7a58
commit 3a0a652984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@ import 'package:flutter_module_books/api.dart';
void main() => runApp(const MyApp()); void main() => runApp(const MyApp());
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,8 +35,7 @@ class FlutterBookApiHandler extends FlutterBookApi {
} }
class BookDetail extends StatefulWidget { class BookDetail extends StatefulWidget {
const BookDetail({Key? key, this.hostApi, this.flutterApi, this.book}) const BookDetail({super.key, this.hostApi, this.flutterApi, this.book});
: super(key: key);
// These are the outgoing and incoming APIs that are here for injection for // These are the outgoing and incoming APIs that are here for injection for
// tests. // tests.
@ -148,13 +147,13 @@ class _BookDetailState extends State<BookDetail> {
class BookForm extends StatelessWidget { class BookForm extends StatelessWidget {
const BookForm({ const BookForm({
Key? key, super.key,
required this.book, required this.book,
required this.focusNode, required this.focusNode,
required this.authorTextController, required this.authorTextController,
required this.subtitleTextController, required this.subtitleTextController,
required this.titleTextController, required this.titleTextController,
}) : super(key: key); });
final Book book; final Book book;
final FocusNode focusNode; final FocusNode focusNode;

@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier {
/// It offers two routes, one suitable for displaying as a full screen and /// 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 { /// another designed to be part of a larger UI.class MyApp extends StatelessWidget {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
/// full-screen. /// full-screen.
class FullScreenView extends StatelessWidget { class FullScreenView extends StatelessWidget {
const FullScreenView({Key? key}) : super(key: key); const FullScreenView({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget {
class Contents extends StatelessWidget { class Contents extends StatelessWidget {
final bool showExit; final bool showExit;
const Contents({this.showExit = false, Key? key}) : super(key: key); const Contents({this.showExit = false, super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -15,7 +15,7 @@ void topMain() => runApp(const MyApp(color: Colors.green));
void bottomMain() => runApp(const MyApp(color: Colors.purple)); void bottomMain() => runApp(const MyApp(color: Colors.purple));
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key, required this.color}) : super(key: key); const MyApp({super.key, required this.color});
final MaterialColor color; final MaterialColor color;
@ -32,7 +32,7 @@ class MyApp extends StatelessWidget {
} }
class MyHomePage extends StatefulWidget { class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key); const MyHomePage({super.key, required this.title});
final String title; final String title;
@override @override

@ -15,7 +15,7 @@ void main() {
} }
class Cell extends StatefulWidget { class Cell extends StatefulWidget {
const Cell({Key? key}) : super(key: key); const Cell({super.key});
@override @override
State<StatefulWidget> createState() => _CellState(); State<StatefulWidget> createState() => _CellState();

@ -69,7 +69,7 @@ class CounterModel extends ChangeNotifier {
/// It offers two routes, one suitable for displaying as a full screen and /// It offers two routes, one suitable for displaying as a full screen and
/// another designed to be part of a larger UI. /// 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -86,7 +86,7 @@ class MyApp extends StatelessWidget {
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
/// full-screen. /// full-screen.
class FullScreenView extends StatelessWidget { class FullScreenView extends StatelessWidget {
const FullScreenView({Key? key}) : super(key: key); const FullScreenView({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -108,7 +108,7 @@ class FullScreenView extends StatelessWidget {
class Contents extends StatelessWidget { class Contents extends StatelessWidget {
final bool showExit; final bool showExit;
const Contents({Key? key, this.showExit = false}) : super(key: key); const Contents({super.key, this.showExit = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -58,7 +58,7 @@ class CounterModel extends ChangeNotifier {
/// It offers two routes, one suitable for displaying as a full screen and /// 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 { /// another designed to be part of a larger UI.class MyApp extends StatelessWidget {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -75,7 +75,7 @@ class MyApp extends StatelessWidget {
/// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed /// Wraps [Contents] in a Material [Scaffold] so it looks correct when displayed
/// full-screen. /// full-screen.
class FullScreenView extends StatelessWidget { class FullScreenView extends StatelessWidget {
const FullScreenView({Key? key}) : super(key: key); const FullScreenView({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -96,7 +96,7 @@ class FullScreenView extends StatelessWidget {
class Contents extends StatelessWidget { class Contents extends StatelessWidget {
final bool showExit; final bool showExit;
const Contents({Key? key, this.showExit = false}) : super(key: key); const Contents({super.key, this.showExit = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -18,3 +18,4 @@ linter:
throw_in_finally: true throw_in_finally: true
unawaited_futures: true unawaited_futures: true
unnecessary_statements: true unnecessary_statements: true
use_super_parameters: true

@ -22,7 +22,7 @@ Future<void> main() async {
/* Main widget that contains the Flutter starter app. */ /* Main widget that contains the Flutter starter app. */
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,7 +37,7 @@ class MyApp extends StatelessWidget {
} }
class MyHomePage extends StatefulWidget { class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key); const MyHomePage({super.key, required this.title});
final String title; final String title;
@ -85,7 +85,7 @@ class _MyHomePageState extends State<MyHomePage> {
/* A Flutter implementation of the last frame of the splashscreen animation */ /* A Flutter implementation of the last frame of the splashscreen animation */
class CustomAppBar extends StatelessWidget { class CustomAppBar extends StatelessWidget {
const CustomAppBar({Key? key}) : super(key: key); const CustomAppBar({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -9,10 +9,10 @@ class FadeTransitionPage<T> extends Page<T> {
final Duration duration; final Duration duration;
const FadeTransitionPage({ const FadeTransitionPage({
LocalKey? key, super.key,
required this.child, required this.child,
this.duration = const Duration(milliseconds: 300), this.duration = const Duration(milliseconds: 300),
}) : super(key: key); });
@override @override
Route<T> createRoute(BuildContext context) => Route<T> createRoute(BuildContext context) =>

@ -389,19 +389,18 @@ class TextEditingInlineSpanReplacement {
class ReplacementTextEditingController extends TextEditingController { class ReplacementTextEditingController extends TextEditingController {
/// Constructs a controller with optional text that handles the provided list of replacements. /// Constructs a controller with optional text that handles the provided list of replacements.
ReplacementTextEditingController({ ReplacementTextEditingController({
String? text, super.text,
List<TextEditingInlineSpanReplacement>? replacements, List<TextEditingInlineSpanReplacement>? replacements,
this.composingRegionReplaceable = true, this.composingRegionReplaceable = true,
}) : replacements = replacements ?? [], }) : replacements = replacements ?? [];
super(text: text);
/// Creates a controller for an editable text field from an initial [TextEditingValue]. /// 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]. /// This constructor treats a null [value] argument as if it were [TextEditingValue.empty].
ReplacementTextEditingController.fromValue(TextEditingValue? value, ReplacementTextEditingController.fromValue(super.value,
{List<TextEditingInlineSpanReplacement>? replacements, {List<TextEditingInlineSpanReplacement>? replacements,
this.composingRegionReplaceable = true}) this.composingRegionReplaceable = true})
: super.fromValue(value); : super.fromValue();
/// The [TextEditingInlineSpanReplacement]s that are evaluated on the editing value. /// The [TextEditingInlineSpanReplacement]s that are evaluated on the editing value.
/// ///

@ -6,7 +6,7 @@ import 'package:particle_background/simple_animations_package.dart';
void main() => runApp(const ParticleApp()); void main() => runApp(const ParticleApp());
class ParticleApp extends StatelessWidget { class ParticleApp extends StatelessWidget {
const ParticleApp({Key? key}) : super(key: key); const ParticleApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -19,7 +19,7 @@ class ParticleApp extends StatelessWidget {
} }
class ParticleBackgroundPage extends StatelessWidget { class ParticleBackgroundPage extends StatelessWidget {
const ParticleBackgroundPage({Key? key}) : super(key: key); const ParticleBackgroundPage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class ParticleBackgroundPage extends StatelessWidget {
class Particles extends StatefulWidget { class Particles extends StatefulWidget {
final int numberOfParticles; final int numberOfParticles;
const Particles(this.numberOfParticles, {key}) : super(key: key); const Particles(this.numberOfParticles, {super.key});
@override @override
State<Particles> createState() => _ParticlesState(); State<Particles> createState() => _ParticlesState();
@ -133,7 +133,7 @@ class ParticlePainter extends CustomPainter {
} }
class AnimatedBackground extends StatelessWidget { class AnimatedBackground extends StatelessWidget {
const AnimatedBackground({Key? key}) : super(key: key); const AnimatedBackground({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -165,8 +165,8 @@ class AnimatedBackground extends StatelessWidget {
class CenteredText extends StatelessWidget { class CenteredText extends StatelessWidget {
const CenteredText({ const CenteredText({
Key? key, super.key,
}) : super(key: key); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -32,8 +32,7 @@ class Rendering extends StatefulWidget {
this.onTick, this.onTick,
this.startTime = Duration.zero, this.startTime = Duration.zero,
this.startTimeSimulationTicks = 20, this.startTimeSimulationTicks = 20,
Key? key}) super.key});
: super(key: key);
@override @override
State<Rendering> createState() => _RenderingState(); State<Rendering> createState() => _RenderingState();
@ -323,7 +322,7 @@ class ControlledAnimation<T> extends StatefulWidget {
this.child, this.child,
this.animationControllerStatusListener, this.animationControllerStatusListener,
this.startPosition = 0.0, this.startPosition = 0.0,
Key? key}) super.key})
: assert( : assert(
(builderWithChild != null && child != null && builder == null) || (builderWithChild != null && child != null && builder == null) ||
(builder != null && builderWithChild == null && child == null), (builder != null && builderWithChild == null && child == null),
@ -332,8 +331,7 @@ class ControlledAnimation<T> extends StatefulWidget {
assert( assert(
startPosition >= 0 && startPosition <= 1, startPosition >= 0 && startPosition <= 1,
"The property startPosition " "The property startPosition "
"must have a value between 0.0 and 1.0."), "must have a value between 0.0 and 1.0.");
super(key: key);
@override @override
State<ControlledAnimation> createState() => _ControlledAnimationState<T>(); State<ControlledAnimation> createState() => _ControlledAnimationState<T>();

Loading…
Cancel
Save