Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/flutter_vibrate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class Vibrate {
static const MethodChannel _channel = MethodChannel('vibrate');
static const Duration defaultVibrationDuration = Duration(milliseconds: 500);

/// Vibrate for 500ms on Android, and for the default time on iOS (about 500ms as well)
static Future vibrate() => _channel.invokeMethod(
/// Vibrate for duration milliseconds or default 500ms on Android, and for the default time on iOS (about 500ms as well)
static Future vibrate({duration = defaultVibrationDuration}) => _channel.invokeMethod(
'vibrate',
{'duration': defaultVibrationDuration.inMilliseconds},
{'duration': duration.inMilliseconds},
);

/// Whether the device can actually vibrate or not
Expand Down