win32_gamepad
1.0.11, released 9 months ago by halildurmus.dev
Type-safe Dart API for accessing Windows gamepads via Win32
What it does
Provides a high-level, type-safe interface to query and control up to four XInput gamepads on Windows. It wraps native Win32 calls, exposing state, vibration, and battery information.
AI-written summary of version 1.0.11, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to read gamepad input in a Flutter or Dart app on Windows
- You want vibration or battery info without dealing with raw FFI
- You prefer a clean, object-oriented API over low-level Win32 calls
Skip it when
- You target non-Windows platforms
- You need a cross-platform gamepad library
- You require advanced game engine features beyond input polling
Strengths
- Type-safe, modern Dart API
- Supports up to four controllers with clean state objects
- Includes vibration and battery info out of the box
Weaknesses
- Windows-only
- Depends on the win32 package
- No cross-platform support
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'package:win32_gamepad/win32_gamepad.dart';
final gamepad = Gamepad(0);
if (gamepad.isConnected) {
gamepad.updateState();
print(gamepad.state.buttons.aPressed);
gamepad.vibrate(leftMotorSpeed: 32767);
}Works with
Packages commonly used together with win32_gamepad: ones it builds on, ones built on it, and its own family.
- ffiwin32_gamepad depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- win32win32_gamepad depends on itCall common Windows APIs and COM objects directly from Dart using FFI.
- win32_registrySame familyType‑safe Dart API for accessing and managing the Windows Registry
- filepicker_windowsSame familyWindows file and directory picker using native dialog controls
- win32_clipboardSame familyType‑safe Dart API for reading, writing and monitoring the Windows clipboard.