toMap<K, V> static method
Map<K, V>
toMap<K, V>(
- dynamic object, {
- dynamic mapKey,
- int? listIndex,
- Map<
K, V> ? defaultValue, - ElementConverter<
K> ? keyConverter, - ElementConverter<
V> ? valueConverter,
Converts object to a strongly-typed Map, optionally transforming keys
and values with keyConverter and valueConverter.
JSON strings are decoded before conversion. Throws ConversionException
when mapping fails and defaultValue is null.
Implementation
static Map<K, V> toMap<K, V>(
dynamic object, {
dynamic mapKey,
int? listIndex,
Map<K, V>? defaultValue,
ElementConverter<K>? keyConverter,
ElementConverter<V>? valueConverter,
}) => ConvertObjectImpl.toMap<K, V>(
object,
mapKey: mapKey,
listIndex: listIndex,
defaultValue: defaultValue,
keyConverter: keyConverter,
valueConverter: valueConverter,
);