getOr<T> method
T
getOr<T>(
- K key,
- T fallback
Value of key as T, or fallback when missing or another type. json.getOr<String>("name", "")
Implementation
T getOr<T>(K key, T fallback) {
final V? value = this[key];
return value is T ? value as T : fallback;
}