fromJson<T> static method
Returns a deserialized version of the Set.
Implementation
static Set<T>? fromJson<T>(
dynamic value, {
required T Function(dynamic) itemFromJson,
}) {
if (value is Set<T>) return value;
var set = (value as List?)?.map(itemFromJson).toSet();
if (set != null && value!.length != set.length) {
throw Exception(
'Input list for Set contained duplicate items. List with length ${value.length} resulted in a set with only ${set.length} item(s).');
}
return set;
}