getting error when adding json_serializable

301 Views Asked by At

I added json serializabe in my pubspec.yaml and getting below error :

Bad state: Could not parse the options provided for json_serializable. Unrecognized keys: [super-parameters, enhanced-enums]; supported keys: [any_map, checked, constructor, create_factory, create_field_map, create_to_json, disallow_unrecognized_keys, explicit_to_json, field_rename, generic_argument_factories, ignore_unannotated, include_if_null]

my pubsec yaml is


environment:
  sdk: ">2.18.0 <3.3.0"

dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^1.0.0 freezed: ^2.3.2 build_runner: ^2.1.8 dropdown_search: ^4.0.1 json_serializable: ^6.5.3

When i remove json_serializable from depndency build passes

1

There are 1 best solutions below

3
On

According to this link https://pub.dev/packages/json_serializable/install

You must add json_serializable to dependencies section. You added it to dev_dependencies in the pubspec.yaml file you shared.