getMapOpt<K, V> method

Map<K, V>? getMapOpt<K, V>(
  1. String key, {
  2. MappingHooks? hooks,
})

Implementation

Map<K, V>? getMapOpt<K, V>(String key, {MappingHooks? hooks}) => hooked(hooks, key, (v) {
  if (v == null) {
    return null;
  } else if (v is! Map) {
    throw MapperException('Parameter $v with key $key is not a Map');
  }
  return v.map((dynamic key, dynamic value) => MapEntry(Mapper.fromValue<K>(key), Mapper.fromValue<V>(value)));
});