asPrimitiveValue<T> method

T asPrimitiveValue<T>()

Returns this decoded value as a primitive value (specified by T).

Primitive values are of the types String, num, bool or Null. As subtypes of num, int or double will be also accepted.

Throws a JsonCastingError if this decoded value does not represents a primitive value or if T could not represents a primitive type.


T asPrimitiveValue<T>() => castAsPrimitiveValue<T>(value);