read<T> static method

T read<T>(
  1. dynamic input, {
  2. String? typeName,
  3. required bool isNullable,
})

Implementation

static T read<T>(dynamic input, {String? typeName, required bool isNullable}) {
  typeName ??= '$T';
  var readValue = _serializer!.read(input, typeName: typeName, isNullable: isNullable);
  assert(readValue is T,
      "Factory didn't convert ${input?.runtimeType} into a ${T} for type: '${typeName}, instead was ${input?.runtimeType}");
  return readValue as T;
}