Map<String, dynamic> ensureJsonDecodeToMap(dynamic json) { if (json is Map<String, dynamic>) return json; return convert.jsonDecode('$json'); }