encode<T> method

dynamic encode<T>(
  1. T value,
  2. dynamic fn(
    1. T value
    )
)

Implementation

dynamic encode<T>(T value, dynamic Function(T value) fn) {
  if (this == null) return fn(value);
  var v = this!.beforeEncode(value);
  if (v is T) v = fn(v);
  return this!.afterEncode(v);
}