Skip to content

Add required keyword fix to file #60113

@FMorschel

Description

@FMorschel

If you have the following code:

class A {
  const A(this.a, this.b, this.c, this.d, this.e, this.f);
  
  final int a;
  final int b;
  final int c;
  final int d;
  final int e;
  final int f;
}

When you wrap more than one, let's say all, of the positional parameters for the constructor into curly braces, you get a diagnostic of missing_default_value_for_parameter which has currently only one fix that is to add the required keyword to the selected parameter. There is no way for you to use that fix easily for the whole constructor/file.

My request is to make it possible to use the Add 'required' keyword to file-level fix.

There is no reason not to, if the user chooses that, it is easy to undo on the IDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-completionIssues with the analysis server's code completion featuretype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions