decode method

FutureOr<Map> decode(
  1. String json
)

Decodes a JSON string into a Map

Implementation

FutureOr<Map> decode(String json) {
  final decoded = jsonDecode(json);
  if (decoded is Map) return decoded;
  throw FormatException('Invalid JSON payload: ${decoded.runtimeType}');
}