Skip to content
pubscout

gamepads_platform_interface

0.1.4, released 2 months ago by flame-engine.org

Handle gamepad and joystick input across multiple platforms

WASM-ready
$ flutter pub add gamepads_platform_interface
Source repository

What it does

A Flutter plugin that enables applications to listen to gamepad inputs, track connection states of multiple controllers, and trigger controller vibration across Android, iOS, macOS, Windows, Linux, and Web.

AI-written summary of version 0.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Building a game or app that needs to support physical controllers and joysticks
  • Handling controller connection and disconnection events dynamically
  • Triggering haptic feedback or rumble effects on supported gamepads

Skip it when

  • Building standard touch-only mobile apps with no need for hardware peripheral input
  • Needing advanced features like adaptive triggers or arbitrary force feedback

Strengths

  • Supports multiple platforms including Android, iOS, macOS, Windows, Linux, and Web
  • Provides normalized events for consistent button and axis mappings across controllers
  • Includes cross-platform controller rumble/vibration support

Weaknesses

  • Vendor ID and product ID are null on macOS and iOS because GCController does not expose them
  • Requires platform-specific boilerplate or configuration such as custom Android Activity implementation
  • Linux requires write access to the event device for rumble support

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
1

Requires platform-specific setup on Android (custom MainActivity implementing GamepadsCompatibleActivity) and ensuring Windows SDK / C++ desktop development is installed for Windows targets.

final gamepads = await Gamepads.list();

Gamepads.normalizedEvents.listen((event) {
  if (event.button == GamepadButton.a && event.value != 0) {
    print('A button pressed!');
  }
});

Alternatives

Packages that do the same job and could replace gamepads_platform_interface.

Works with

Packages commonly used together with gamepads_platform_interface: ones it builds on, ones built on it, and its own family.