applyValueDecorator method

dynamic applyValueDecorator (
  1. dynamic value,
  2. TypeInfo typeInfo,
  3. [JsonProperty meta]
)

Implementation

dynamic applyValueDecorator(dynamic value, TypeInfo typeInfo,
    [JsonProperty meta]) {
  final valueDecoratorFunction = getValueDecorator(meta, typeInfo.type);
  // TODO: Relocate Set handling out of mapper to converter/value decorator/etc.
  if (typeInfo.isSet && value is! Set && value is Iterable) {
    value = Set.from(value);
  }
  return valueDecoratorFunction != null && value != null
      ? valueDecoratorFunction(value)
      : value;
}