asMap method

JsonMap asMap([
  1. Map<String, dynamic>? defaultValue
])

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");
}