osIndexes property
A list of Gamepad.controllerIndexes for each currently connected controller.
This set exists because the order of indexes that the operating system assigns may, and usually will, differ from the order that the operators are in. For example, if the OS assigns indexes 0 and 2, we'd still want the gamepads to appear in indexes 0 and 1 and save the disconnected gamepad for index 2.
Implementation
Set<int> get osIndexes => {
for (final gamepad in gamepads)
if (gamepad.isConnected)
gamepad.controllerIndex,
};