Priyanshu Paliwal
Priyanshu Paliwal

Reputation: 2388

How to continuously vibrate phone in both android and IOS using flutter

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?

Upvotes: 1

Views: 1333

Answers (1)

Srini
Srini

Reputation: 450

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

Upvotes: 2

Related Questions