From fae9dcc468509ecf4fa03e4f9f3a71db0d7c377b Mon Sep 17 00:00:00 2001 From: Aniki312 Date: Sat, 31 Mar 2018 18:43:11 +0800 Subject: [PATCH] Allow client to set custom duration --- lib/vibrate.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vibrate.dart b/lib/vibrate.dart index 30c0605..617ca03 100644 --- a/lib/vibrate.dart +++ b/lib/vibrate.dart @@ -7,7 +7,7 @@ class Vibrate { static const Duration _DEFAULT_VIBRATION_DURATION = const 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', {"duration" : _DEFAULT_VIBRATION_DURATION.inMilliseconds}); + static Future vibrate({Duration duration = _DEFAULT_VIBRATION_DURATION}) => _channel.invokeMethod('vibrate', {"duration" : duration.inMilliseconds}); //Whether the device can actually vibrate or not static Future get canVibrate => _channel.invokeMethod('canVibrate'); /**