Masterarbeit Richard Stern. Flutter App, sich mit einem Bluetooth-Gerät verbindet und Berührungen auf einem Sensor visualisiert.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vibrate.dart 595B

1234567891011121314151617181920212223242526
  1. import 'dart:async';
  2. import 'package:vibrate/vibrate.dart';
  3. bool canVibrate = false;
  4. void vibrate(FeedbackType feedbackType) async{
  5. canVibrate = await Vibrate.canVibrate;
  6. print('_vibrate');
  7. if (canVibrate) {
  8. print('vibrate -- type: $feedbackType');
  9. Vibrate.feedback(feedbackType);
  10. }
  11. }
  12. void vibrateDelayed(FeedbackType feedbackType, Duration duration) async{
  13. canVibrate = await Vibrate.canVibrate;
  14. Future.delayed(duration,()
  15. {
  16. print('_vibrate');
  17. if (canVibrate) {
  18. print('vibrate -- type: $feedbackType');
  19. Vibrate.feedback(feedbackType);
  20. }
  21. });
  22. }