Future<Map<String, dynamic>> decodeAsMap()

Returns decoded data as Map, decoding it if not already decoded.

This method invokes decodedData and casts the decoded object as Map<String, dynamic>.

If there is no body data, this method returns null.

If decodedData does not produce a List that contains a single Map<String, dynamic> this method throws an HTTPBodyDecoderException.

For a non-Future variant, see asMap.

Source

Future<Map<String, dynamic>> decodeAsMap() async {
  await decodedData;

  return asMap();
}