2

There are some cases where inspections are rather annoying and even mention that the file has errors.

Using // ignore: argument_type_not_assignable does supress the error message. Although I use this quite often, so it is annoying to have this comment spread accross the code base.

In the Settings > Inspections couldn't find anything neither under Dart nor General.

Is there a way to supress specific inspections?

mloureiro
  • 957
  • 1
  • 12
  • 34
  • 1
    Not sure what you are trying to achieve here, because the argument to `then` is completely wrong and it will not work. In Dart 2, it will be a compile-time error, and no amount of ignoring warnings will make it compile. It might currently run when compiled to JavaScript with no checking, but that's really an accident of compilation, and not something I recommend that you rely on. Just write `.then((_) => print('finished'))`. – lrn Feb 05 '18 at 07:19
  • Yeah, only noticed that after I asked, I'll update the question. thanks – mloureiro Feb 05 '18 at 17:43

1 Answers1

3

You can configure that using the analysis_options.yaml file

https://www.dartlang.org/guides/language/analysis-options

analyzer:
  errors:
    argument_type_not_assignable: ignore

See also Suppress hint about use of protected member

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567