values property

Set<T> values
getter/setter pair

The set of non-null values that this RestorableEnumN may represent.

This is a required field that supplies the enum values that are serialized and restored.

If a value is encountered that is not null or a value in this set, fromPrimitives will assert when restoring.

It is typically set to the values list of the enum type.

In addition to this set, because RestorableEnumN allows nullable values, null is also a valid value, even though it doesn't appear in this set.

For example, to create a RestorableEnumN with an AxisDirection enum value, with a default value of null, you would build it like the code below:
link
RestorableEnumN<AxisDirection> axis = RestorableEnumN<AxisDirection>(null, values: AxisDirection.values);

Implementation

Set<T> values;