decode<T> method

T decode<T>(
  1. dynamic value,
  2. T fn(
    1. 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;
}