isPrimitiveValue<T> method

bool isPrimitiveValue<T>()

Returns true if this decoded value represents a primitive value (specified by T).

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

Throws a JsonCheckingError if T could not represent a primitive type.


bool isPrimitiveValue<T>() => checkPrimitiveValue<T>(value);