getOrDefault<T> method

T getOrDefault<T>(
  1. K key,
  2. T defaultValue
)

Implementation

T getOrDefault<T>(K key, T defaultValue) {
  final thiz = this;
  if (thiz == null) return defaultValue;
  final value = thiz[key];
  return value is T ? value : defaultValue;
}