encode method

dynamic encode(
  1. T value,
  2. EncodingContext context
)

Implementation

dynamic encode(T value, EncodingContext context) {
  var options = context.options;
  if (data != null) {
    options = options?.copyWith(data: data) ?? EncodingOptions(data: data);
  }
  if (arg == null) {
    return context.$enc<V>(get(value), name, options, hook);
  } else {
    return context.callWith(
      arg!,
      <U>() => context.$enc<U>(get(value), name, options, hook),
    );
  }
}