mapValueOfType<T> function
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;
}