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