How to disable a linting rule inline in flutter

General answer

To ignore a single line, you can add a comment above the line:

// ignore: non_constant_identifier_names
final NEW = 'NEW';

To ignore for the whole file, you can add a comment at the top of the file:

// ignore_for_file: non_constant_identifier_names

To ignore for the whole project, you can set the rule to false in your analysis_options.yaml file:

include: package:lints/recommended.yaml

linter:
  rules:
    non_constant_identifier_names: false

See also

  • Customizing static analysis
  • Setting up Lint Rules in Dart-Flutter

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)