mapCastOfType<K, V> function
Returns a valid Map<K, V> found at the specified Map key
, null otherwise.
Implementation
Map<K, V>? mapCastOfType<K, V>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is Map ? value.cast<K, V>() : null;
}