Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field initializer and argument type not assignable #35

Open
SeanZom opened this issue May 1, 2021 · 5 comments
Open

field initializer and argument type not assignable #35

SeanZom opened this issue May 1, 2021 · 5 comments

Comments

@SeanZom
Copy link

SeanZom commented May 1, 2021

I got massive errors from the analyzer includes:

  • argument_type_not_assignable
  • field_initializer_not_assignable

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
Copy link

Same issue
Any update?

@passsy
Copy link
Owner

passsy commented May 4, 2021

Could you please provide some example code?

@SeanZom
Copy link
Author

SeanZom commented May 4, 2021

@passsy please check this:
arg_type
field_type

@jigarfumakiya
Copy link

jigarfumakiya commented May 4, 2021

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
Copy link
Author

SeanZom commented May 6, 2021

Hi @jigarfumakiya , that helps, thanks.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants