vibrateWithPauses static method
Vibrates with pauses
in between each vibration
Will always vibrate once before the first pause
and once after the last pause
Implementation
static Future vibrateWithPauses(Iterable<Duration> pauses) async {
for (final Duration d in pauses) {
await vibrate();
//Because the native vibration is not awaited, we need to wait for
//the vibration to end before launching another one
await Future.delayed(defaultVibrationDuration);
await Future.delayed(d);
}
await vibrate();
}