avoid_positional_fields_in_records

SeverityQuick FixOptions
Info

Details

DO avoid using record positional field getters.

Bad
void fn((String, String) record) {
  final first = record.$1;
  final second = record.$2;
}
Good
void fn(({String first, String second}) record) {
  final first = record.first;
  final second = record.second;
}

Usage

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

custom_lint:
  rules:
    - avoid_positional_fields_in_records