letSetOrNull<T> function
Let's you convert input
to a Set type if possible, or returns null
if
the conversion cannot be performed.
If filterNulls
is true, the returned set will not contain any null
values. If nullFallback
is provided, it will be used as a fallback value
for null
values.
Implementation
Set<T>? letSetOrNull<T>(
dynamic input, {
bool filterNulls = false,
T? nullFallback,
}) {
return letIterableOrNull<T>(
input,
filterNulls: filterNulls,
nullFallback: nullFallback,
)?.toSet();
}