asMap method
Convert Json to the JsonMap or create JsonMap from defaultValue
The jsonObject
must be Map<String, dynamic>, String or JsonMap otherwise throw FormatException
Implementation
JsonMap asMap([Map<String, dynamic>? defaultValue]) {
final jsonMap = asMapOr(defaultValue);
if (jsonMap != null) {
return jsonMap;
}
throw const FormatException("Json object is not map");
}