parseJson<T> method
Parses the response body as JSON and converts it using the provided function.
Implementation
T? parseJson<T>(T Function(Map<String, dynamic> json) fromJson) {
final json = jsonBody;
if (json == null) return null;
try {
return fromJson(json);
} catch (_) {
return null;
}
}