Flutter / Dart Convert Int to Enum

int idx = 2;
print(ThemeColor.values[idx]);

should give you

ThemeColor.blue

You can use:

ThemeColor.red.index

should give you

0