Skip to content

[BUG]: gen fails when there is only list in a JSON #323

Closed
@tomas-dorda

Description

@tomas-dorda

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.0.2

Command type

build_runner (Default)

What happened?

The JSON is not necessary Map<String, dynamic> it crashes when there is JSON like:
[ { "id": "ABC42" } ]

Relevant a pubspec.yaml.

flutter_gen:
  output: lib/gen/
  line_length: 80
  integrations:
    flutter_svg: false
    flare_flutter: false
    rive: false
    lottie: true

Relevant log output

[SEVERE] flutter_gen_runner on $package$:

type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions