getJoystickName method

String getJoystickName(
  1. int index
)

Get the implementation dependent name of a joystick.

Returns the name of the joystick with the given index.

SDL Docs

Implementation

String getJoystickName(final int index) {
  final name = sdl.SDL_JoystickNameForIndex(index);
  if (name == nullptr) {
    throw SdlError(0, getError());
  }
  return name.cast<Utf8>().toDartString();
}