toMap<T1, T2> static method

Map<T1, T2> toMap<T1, T2>(
  1. dynamic d,
  2. Map<T1, T2> def
)

Converts a dynamic value to a non-nullable map.

d - The dynamic value to be converted. def - The default map value if conversion fails. Returns a map.

Implementation

static Map<T1, T2> toMap<T1, T2>(dynamic d, Map<T1, T2> def) {
  return toMapN(d) ?? def;
}