always_specify_parameter_names

SeverityQuick FixOptions
Info

Details

DO specify parameter names in function types to enhance code readability and enable IDEs to provide code completion suggestions.

Bad
typedef ItemBuilder = Widget? Function(BuildContext, int);

// IDE's code completion with default parameter names p0, p1, ...
itemBuilder: (p0, p1) {},
Good
typedef ItemBuilder = Widget? Function(BuildContext context, int index);

// IDE's code completion with descriptive parameter names
itemBuilder: (context, index) {},

Usage

To enable the always_specify_parameter_names rule, add always_specify_parameter_names under custom_lint > rules in your analysis_options.yaml file:

custom_lint:
  rules:
    - always_specify_parameter_names