RestorableEnumN<T extends Enum> constructor
- T? defaultValue, {
- required Iterable<
T> values,
Creates a RestorableEnumN.
If no restoration data is available to restore the value in this property
from, the property will be initialized with the provided defaultValue
.
Implementation
RestorableEnumN(T? defaultValue, { required Iterable<T> values })
: assert(defaultValue == null || values.contains(defaultValue),
'Default value $defaultValue not found in $T values: $values'),
_defaultValue = defaultValue,
values = values.toSet();