readValue property

(Object? Function(Map, String)?) readValue
final

Specialize how a value is read from the source JSON map.

Typically, the value corresponding to a given key is read directly from the JSON map using map[key]. At times it's convenient to customize this behavior to support alternative names or to support logic that requires accessing multiple values at once.

The provided, the Function must be a top-level or static within the using class.

Note: using this feature does not change any of the subsequent decoding logic for the field. For instance, if the field is of type DateTime we expect the function provided here to return a String.

Implementation

final Object? Function(Map, String)? readValue;