How to have dynamic multitype value in Dart/Flutter when using @JsonSerializable()?

Issue I am using Flutter with json_annotation library and have one data class that is used to represent json response coming from one api. import ‘package:json_annotation/json_annotation.dart’; import ‘package:app/dtos/user.dart’; import ‘package:app/dtos/limited_user.dart’; part ‘pending_project.g.dart’; @JsonSerializable() class PendingProject { @JsonKey(name: "user") final User|LimitedUser

Continue reading