decode method

  1. @override
T? decode(
  1. int? index
)
override

Decodes a value of storage type TStore back to type T.

Returns null if the stored value is null or cannot be decoded.

Implementation

@override
T? decode(int? index) {
  if (index == null || index < 0 || index >= values.length) {
    return null;
  }
  return values[index];
}