Bad state Unexpected diagnostics on json_serializable package with flutter Bad state Unexpected diagnostics on json_serializable package with flutter flutter flutter

Bad state Unexpected diagnostics on json_serializable package with flutter


I solved this problem with adding

dependency_overrides:  analyzer: '0.39.14'

to pubspec.yaml


2 options

change channel to dev (where dart 2.10+ is available)

or

as mentioned before, add

analyzer: '0.39.14' to dependency_overrides section


For me the fix was upgrading analyzer: '0.39.15'I am using sdk: ">=2.10.0 <3.0.0"