vibration 0.0.2
vibration: ^0.0.2 copied to clipboard

outdated

A plugin for handling Vibration API on iOS and Android devices

Vibration #

Build Status

A plugin for handling Vibration API on iOS and Android devices.

Getting Started #

  1. Add vibration to the dependencies section of pubspec.yaml.

     dependencies:
       vibration:
         git:
           url: git@github.com:benjamindean/flutter_vibration.git
    
  2. Import package:

     import 'package:vibration/vibration.dart';
    

Methods #

Vibration.hasVibrator() #

Used to check if the target device has vibration capabilities. Returns bool.

Vibration.vibrate(...) #

Vibration.vibrate(duration: [int], pattern: [List<int>], repeat: [int])

Vibrate device for a certain duration or by pattern. Default duration is 500ms.

Vibration.cancel() #

Stop ongoing vibration.

Android #

Supports vibration with duration and pattern. On Android 8 (Oreo) and above, uses the VibrationEffect class. For the rest of the usage instructions, see Vibrator class documentation.

iOS #

Only supports singular vibrations with 500ms duration.

267
likes
0
pub points
98%
popularity

A plugin for handling Vibration API on iOS and Android devices

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_test

More

Packages that depend on vibration