decode<T> method
T
decode<T>(
- dynamic value,
- T fn(
- dynamic value
Implementation
T decode<T>(dynamic value, T Function(dynamic value) fn) {
if (this == null) return fn(value);
var v = this!.beforeDecode(value);
if (v is! T) v = fn(v);
return this!.afterDecode(v) as T;
}