Closed vipuluthaiah closed 3 years ago
What exactly is the problem? Doesn't it vibrate this way? It's quite a rare case, so vibrating indefinitely is not "officially" supported, but it's possible.
vibration works fine but for me when the button is clicked i want the vibration to last for one hour or more how to implement this?
i am working on a alarm app: when the alarm is on it shouble keep on vibrating for one hr or more when the user click on off button the vibration should off . so how can i do that?
Well, you just set the duration to 1000 60 60. Or use the Duration class for that.
Thanks a lot!!great package by the way
i tried to final dur = Duration( days: 5, hours: 23, minutes: 59, seconds: 59, milliseconds: 999, microseconds: 999, ); RaisedButton( child: Text('Vibrate for 1000ms'), onPressed: () { Vibration.vibrate(duration: 1000 60 60, ); }, ), but its not working! and i did try Duration class for one hr its not working child: Text('Vibrate for 1000ms'), onPressed: () { Vibration.vibrate(duration: 100 60 60, ); // Vibration.vibrate(duration: Duration.secondsPerMinute); // Vibration.vibrate(duration:d1.inMinutes 10060*600); Vibration.vibrate(duration:dur.inMinutes );
},
),
Judging by your code you are passing minutes to the vibrate
method. What happens when you run Vibration.vibrate(duration: 1000 * 60 * 60);
?
it doesnt workk
it will not vibrate at all
RaisedButton( child: Text('Vibrate for default 500ms'), onPressed: () { Vibration.vibrate(duration: 1000 60 60); }, ),
Vibrated for :10s0
How can i set the interval of vibration for more than hrs, eg: RaisedButton( child: Text('Vibrate for 1000ms'), onPressed: () { Vibration.vibrate(duration: 100000, repeat: 90000000); }, ),
how can i set it for hrs? or vibrate untill we tap Vibration.cancel();