deserialize<T> static method

T deserialize<T>(
  1. String json, [
  2. JsonSerializerOptions? options
])

Deserializes the given json string into an object of type T using the provided options. Returns the deserialized object.

Implementation

static T deserialize<T>(String json, [JsonSerializerOptions? options]) {
  final opts = JsonSerializer.options.merge(options);
  final type = DartParser.parseType(T.toString());
  return decode(jsonDecode(json), type, opts) as T;
}