toMap method

Map<String, dynamic> toMap(
  1. Response? response
)

Implementation

Map<String, dynamic> toMap(Response? response) {
  if (response == null) return <String, dynamic>{};
  final dynamic _res = json.decode(utf8.decode(response.bodyBytes));
  if (_res is List<dynamic>) return _res[0] as Map<String, dynamic>;
  return _res as Map<String, dynamic>;
}