Home > Software design >  How to continuously vibrate phone in both android and IOS using flutter
How to continuously vibrate phone in both android and IOS using flutter

Time:08-26

I am using vibration: ^1.7.5 package in which we have to specify the time in milliseconds.

I am now using this to vibrate the device till 10 minutes Vibration.vibrate(duration: 600000, amplitude: 255);

but is there any way by which we can keep vibrating the device continuously until we want?

CodePudding user response:

You can use repeat with a pattern like below which will continue the vibration until cancelled.

Vibration.vibrate(pattern: [100, 200, 400], repeat: 1)

Link to the source Github Link

  • Related