-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
Description
@JsonSerializable(genericArgumentFactories: true)
class Response<T> {
int status;
T value;
}
will require 2 functions
T Function(Object json) fromJsonT,
&
Object Function(T value) toJsonT,
These 2 functions require an Object. -> retrofit is already compatible. They will generate the correct generic type. But the model generator will always use Map<String,dynamic>
We should have an option to generate something like this.
factory Project.fromJson(Object? json) => _$ProjectFromJson(json as Map<String, dynamic>);