jsonFromResponse function

Future<Map<String, dynamic>> jsonFromResponse(
  1. StreamedResponse rs
)

Implementation

Future<Map<String, dynamic>> jsonFromResponse(StreamedResponse rs) async {
  final body = await rs.stream.bytesToString();
  return body.isEmpty
      ? <String, dynamic>{}
      : jsonDecode(body) as Map<String, dynamic>;
}