getOrThrow method

V getOrThrow(
  1. K key
)

Implementation

V getOrThrow(K key) {
  final value = this[key];
  if (value == null) {
    throw 'element not found: $key';
  } else {
    return value;
  }
}