getEnum<E extends Enum> abstract method

Future<E?> getEnum<E extends Enum>(
  1. String key,
  2. List<E> values
)

Retrieves an enum value of type E by its key.

This method fetches an enum value previously stored using setEnum. If no value exists for the given key, or the stored value does not match any of the provided enum values, this method returns null.

Parameters:

  • key: The unique identifier of the enum value to retrieve.
  • values: A list of all possible enum values of type E.

Returns a Future that completes with the stored enum value if found, or null if the key doesn't exist or the value does not match any enum values.

Throws:

Implementation

Future<E?> getEnum<E extends Enum>(String key, List<E> values);