withValue<T> method

void withValue<T>(
  1. Object? key,
  2. ValueSetter<T> onValue
)

Implementation

void withValue<T>(Object? key, ValueSetter<T> onValue) {
  final thiz = this;
  if (thiz != null && thiz.containsKey(key)) {
    final value = thiz[key];
    if (value is T) {
      onValue(thiz[key] as T);
    }
  }
}