Skip to content

use_super_parameters to handle non-named arguments #58729

Description

@asashour
import 'package:flutter/material.dart';

class A extends StatelessWidget {
  const A(this.widget, {super.key});

  final Widget widget;

  @override
  Widget build(BuildContext context) => Container();
}

class B extends A {
  const B({Key? key}) : super(const Text(''), key: key);
}

There is not lint currently with the constructor in B.

But the constructor can be changed to be

  const B({super.key}) : super(const Text(''));

Currently the lint handles the case of:
  MyWidget({Key? key}) : super(text: '', key: key);

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-false-negativeIssues related to lint rules that fail to report a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions