deserialize<T> method

T deserialize <T>(
  1. dynamic jsonValue,
  2. [DeserializationOptions options = defaultDeserializationOptions]
)

Converts JSON string to Dart object of type T

Implementation

static T deserialize<T>(dynamic jsonValue,
    [DeserializationOptions options = defaultDeserializationOptions]) {
  final targetType = T != dynamic
      ? T
      : options.template != null ? options.template.runtimeType : dynamic;
  assert(targetType != dynamic
      ? true
      : throw MissingTypeForDeserializationError());
  return instance.deserializeObject(
      jsonValue, DeserializationContext(options, targetType));
}