vibration 0.0.1 copy "vibration: ^0.0.1" to clipboard
vibration: ^0.0.1 copied to clipboard

outdated

Handle vibration on iOS and Android

Vibration #

Build Status

A plugin for handling Vibration API in Flutter apps.

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.

769
likes
0
pub points
99%
popularity

Publisher

unverified uploader

Handle vibration on iOS and Android

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_test

More

Packages that depend on vibration