getGamepads method Null safety

List<Gamepad?> getGamepads ()

Implementation

List<Gamepad?> getGamepads() {
  var gamepadList = _getGamepads();

  // If no prototype we need one for the world to hookup to the proper Dart class.
  var jsProto = JS('', '#.prototype', gamepadList);
  if (jsProto == null) {
    JS('', '#.prototype = Object.create(null)', gamepadList);
  }

  applyExtension('GamepadList', gamepadList);
  return gamepadList;
}