asJsonList method
Returns a JSON array representation from response body.
Implementation
List<Object?> asJsonList() {
if (body is String) {
return json.decode(body as String);
}
try {
var temp = body as List<dynamic>;
return List<Object?>.from(temp);
} catch (e) {
throw FormatException('body cannot be casted as List<Object?> (JSON list), type is: ${body.runtimeType}');
}
}