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