mapValueOfType<T> function

T? mapValueOfType<T>(
  1. dynamic map,
  2. String key
)

Returns a valid T value found at the specified Map key, null otherwise.

Implementation

T? mapValueOfType<T>(dynamic map, String key) {
  final dynamic value = map is Map ? map[key] : null;
  return value is T ? value : null;
}