native_haptics

pub package GitHub stars License: MIT

Maintained by Shanu Nanminda (shanuNanminda)

Advanced haptic feedback plugin for Flutter. Provides custom and platform-specific haptic patterns for Android and iOS, including advanced effects and custom vibration patterns.

Features

  • Custom haptic patterns for Android (API 26+)
  • iOS and Android impact, selection, and notification feedback
  • Easy-to-use API for common and advanced haptic effects

Installation

Add this to your pubspec.yaml:

dependencies:
	native_haptics: ^0.0.1

Then run:

flutter pub get

Usage

Import the package:

import 'package:native_haptics/native_haptics.dart';

Trigger a simple haptic feedback:

final haptics = NativeHaptics();
await haptics.heavyImpact();

Trigger a custom vibration pattern (Android only):

await haptics.vibratePattern(
	pattern: [0, 100, 50, 200],
	amplitudes: [0, 255, 0, 128],
	repeat: false,
);

See the API Reference for all available methods.

Example

See the example directory for a complete sample app.

API Reference

See the pub.dev documentation for full API details.

Contributing

Contributions are welcome! Please open issues and submit pull requests on GitHub.

License

This project is licensed under the MIT License.