You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ApiError {
final String message;
ApiError({this.message});
}
class ApiResponse<T> {
final T data;
final ApiError error;
ApiError({this.data, this.error});
}
I would like to create a serializer for ApiResponse. However, I cannot figure out how to use jaguar_serializer to achieve this. Every instance of T would have a serializer.
I have tried to specify a list containing all available serializers through the serializers argument to @GenSerializer, but this does not work as the builder does not understand how to handle T.
I have also tried to set a custom processor to the field data through the fields argument to @GenSerializer, but this does not work either as the type T cannot be found.
The text was updated successfully, but these errors were encountered:
I have two classes that look like this:
I would like to create a serializer for ApiResponse. However, I cannot figure out how to use jaguar_serializer to achieve this. Every instance of T would have a serializer.
I have tried to specify a list containing all available serializers through the serializers argument to @GenSerializer, but this does not work as the builder does not understand how to handle T.
I have also tried to set a custom processor to the field
data
through the fields argument to @GenSerializer, but this does not work either as the type T cannot be found.The text was updated successfully, but these errors were encountered: