passsy / dart-lint

An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Apache License 2.0
277 stars 82 forks source link

field initializer and argument type not assignable #35

Open SeanZom opened 3 years ago

SeanZom commented 3 years ago

I got massive errors from the analyzer includes:

Most of them are from the Map<String, dynamic> json parsing to a model class.

I tried to turn them off in the analysis_options.yaml, but it didn't help.

jigarfumakiya commented 3 years ago

Same issue Any update?

passsy commented 3 years ago

Could you please provide some example code?

SeanZom commented 3 years ago

@passsy please check this: arg_type field_type

jigarfumakiya commented 3 years ago

Hey @SeanZom I found the solution Please try below code and save it.

Screenshot 2021-05-04 at 7 02 57 PM

This is what you need

analyzer:
  strong-mode:
    implicit-casts: true
SeanZom commented 3 years ago

Hi @jigarfumakiya , that helps, thanks.

FYI, I can find the explanation of those 2 rules on: https://dart.dev/tools/diagnostic-messages