asObject<E, T> method

T asObject<E, T>(
  1. ObjectTransformer<E, T> transformer,
  2. {bool skipIfNull = false}
)

Returns this decoded value as a dart object (specified by T), built using transformer).

If skipIfNull is set to true, transformation is no applied when this decoded value is null.

Throws a JsonTransformationError if:

  • transformer is null.
  • E could not represent an encodable object.
  • this decoded value is not an instance of T.

Implementation

T asObject<E, T>(ObjectTransformer<E, T> transformer,
        {bool skipIfNull = false}) =>
    transformObject<E, T>(value, transformer, skipIfNull);