responseFactory method

  1. @override
GetPostResponse responseFactory(
  1. Map<String, dynamic> json
)
override

Deserializes the JSON response into the expected type.

Implementation

@override
GetPostResponse responseFactory(Map<String, dynamic> json) {
  if (json.containsKey('post_view')) {
    return GetPostResponse.fromJson(json['post_view'] as Map<String, dynamic>);
  }
  return GetPostResponse.fromJson(json);
}