nativeValues property

List<int>? nativeValues
final

Optional explicit native integer value for each enum case. When set, nativeValues[i] is the wire integer for the i-th enum case — allowing non-contiguous mappings (e.g. OS enums with gaps like 0, 50, 100). Length must match the number of enum cases. When null, values are contiguous starting at startValue.

Example:

@HybridEnum(nativeValues: [0, 50, 100])
enum Quality { low, medium, high }

Implementation

final List<int>? nativeValues;