Hi,
I use:
build_runner: ^2.1.7
json_serializable: ^6.1.4
json_annotation: ^4.4.0
In my code I have:
List<PlaceDto>? places;
And then when I run flutter pub run build_runner build --delete-conflicting-outputs
It generates in the .g file:
..places = json['places'] as List<dynamic>?
And I have the error:
A value of type 'List<dynamic>?' can't be assigned to a variable of type 'List<PlaceDto>?'.
Try changing the type of the variable, or casting the right-hand type to 'List<PlaceDto>?'.
But I can't change the generated code.
How can I fix this?