QueryKey<T extends Object?>.fromJson constructor

QueryKey<T extends Object?>.fromJson(
  1. Object? value
)

Restores a key from its JSON representation.

Implementation

factory QueryKey.fromJson(Object? value) {
  if (value is! List || value.isEmpty || value.first is! String) {
    throw FormatException('A query key must be a non-empty JSON array.');
  }
  return QueryKey<T>(value.first as String, value.skip(1));
}