Skip to main content
NeoHaptics is initialized by NeoInitializer.initialize() in main.dart. See Install Neo.

Examples

Platform Support

NeoHaptics provides different levels of haptic feedback across platforms:
iOS: Full support, including Apple Pencil and Core Haptics.macOS: Trackpad haptic feedback for built-in MacBook trackpads and Magic Trackpads. By default, haptic feedback is disabled on macOS trackpads to prevent excessive feedback during typical interactions, since trackpads already provide haptic feedback when clicking. You can override this behavior using the enableMacOS parameter on individual methods when needed (e.g., for dragging interactions or snapping feedback while already holding down the trackpad).Android: Fallback to Flutter’s built-in haptic feedback system using device vibration motor.Web: Haptics are not supported and calls are safely ignored.

Methods

NeoHaptics.initialize()

Initializes the haptic feedback system. This method is automatically called by NeoInitializer.initialize() and typically shouldn’t be called manually.

Return Value

Future<void>
A Future that completes when the haptic system has been initialized for the current platform.

NeoHaptics.light()

Provides subtle haptic feedback, ideal for lightweight interactions like toggles, selections, or confirmations.

Optional Parameters

bool
default:"false"
Whether to enable haptic feedback on macOS trackpads. See Platform Support for details about macOS haptic behavior.

Return Value

Future<void>
A Future that completes when the haptic feedback has been triggered.

NeoHaptics.heavy()

Provides strong haptic feedback for significant interactions like completion of major actions, navigation changes, or important confirmations.

Optional Parameters

bool
default:"false"
Whether to enable haptic feedback on macOS trackpads. See Platform Support for details about macOS haptic behavior.

Return Value

Future<void>
A Future that completes when the haptic feedback has been triggered.

NeoHaptics.error()

Plays a triple-tap that gets weaker. Use it for a failed action or a validation error.

Return Value

Future<void>
A Future that completes when the error haptic sequence has been triggered.

Best Practices

  • Use light() for a small action, heavy() for a larger one, and error() for a failure.

Behavior

  • A failed haptic call is logged with NeoLogger and does not throw.
Last modified on September 30, 2026