A flutter plugin for device vibration and haptic feedback.

Overview

Buy Me A Coffee Donate github pages GitHub stars flutter_vibrate

Vibrate

A Flutter plugin to vibrate the device. This uses all the current Haptic Feedback APIs from Apple and provides similar feedback on Android.

Getting Started

Make sure you add the following permissions to your Android Manifest

<uses-permission android:name="android.permission.VIBRATE"/>

Usage

// Import package
import 'package:flutter_vibrate/flutter_vibrate.dart';

Vibration

// Check if the device can vibrate
bool canVibrate = await Vibrate.canVibrate;

// Vibrate
// Vibration duration is a constant 500ms because
// it cannot be set to a specific duration on iOS.
Vibrate.vibrate();

// Vibrate with pauses between each vibration
final Iterable<Duration> pauses = [
    const Duration(milliseconds: 500),
    const Duration(milliseconds: 1000),
    const Duration(milliseconds: 500),
];
// vibrate - sleep 0.5s - vibrate - sleep 1s - vibrate - sleep 0.5s - vibrate
Vibrate.vibrateWithPauses(pauses);

Haptic Feedback

// Choose from any of these available methods
enum FeedbackType {
  success,
  error,
  warning,
  selection,
  impact,
  heavy,
  medium,
  light
}

var _type = FeedbackType.impact;
Vibrate.feedback(_type);

Documentation

Android

https://developer.android.com/reference/android/view/HapticFeedbackConstants

iOS

https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/feedback/

Comments
  • Update Android Dependencies

    Update Android Dependencies

    Update Build Gradle

    Changes

    • Update the build gradle to target a higher android version and to use a higher version of the build tools to prevent errors in linking release build.
    opened by dwach414 11
  • Migrate to android v2 embedding

    Migrate to android v2 embedding

    There is a warning regarding the v2 migration during every flutter build, even just on pub get.

    The other plugins were really quick with updates - this is (for me) the last plugin that hasn't been updated yet. A new version on pub.dev would be great! :)

    This PR fixes it.

    opened by nohli 9
  • Fix deprecation warnings

    Fix deprecation warnings

    During every Android build flutter_vibrate triggers a warning about deprecation.

    See void vibrate() on https://developer.android.com/reference/android/os/Vibrator

    https://stackoverflow.com/questions/45605083/android-vibrate-is-deprecated-how-to-use-vibrationeffect-in-android-api-26

    opened by nohli 8
  • Renamed from vibrate to flutter_vibrate in a few locations to fix iOS…

    Renamed from vibrate to flutter_vibrate in a few locations to fix iOS…

    … build

    Before these changes, the iOS build failed with the following error:

    Fetching podspec for `flutter_vibrate` from `.symlinks/plugins/flutter_vibrate/ios`
    [!] No podspec found for `flutter_vibrate` in `.symlinks/plugins/flutter_vibrate/ios`
    
    opened by miguelcmedeiros 4
  • use google() maven for better network accessibility

    use google() maven for better network accessibility

    According to gradle issue #2151, https://maven.google.com is blocked in china, use google() instead.

    Currently, we are suffering from this issue in china😂

    opened by techwnn 1
Releases(v1.1.0)
Owner
Rody Davis
Developer Advocate for @material-components at @Google
Rody Davis
A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your iss

PengHui Li 112 Nov 11, 2022
SSH no ports provides ssh to a remote Linux device with out that device having any ports open

Ssh! No ports ssh no ports provides a way to ssh to a remote linux host/device without that device having any open ports (not even 22) on external int

The Atsign Foundation 224 Dec 21, 2022
A Demo application📱 which stores User feedback from 💙Flutter application into Google Sheets🗎 using Google AppScript.

?? Flutter ?? to Google Sheets ?? A Demo application which stores User feedback from Flutter application into Google Sheets using Google AppScript. Yo

Shreyas Patil 289 Dec 28, 2022
A simple widget for getting better feedback.

?? Using this library in a commercial product? Consider becoming a sponsor. A Flutter package for obtaining better feedback. It allows the user to pro

Jonas Uekötter 232 Dec 31, 2022
Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

password_strength_checker Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation wit

Dario Varriale 6 Aug 8, 2023
Resource monitor - A flutter plugin for Android and IOS to monitor CPU and RAM usage of device.

resource_monitor A flutter plugin for Android and IOS to monitor CPU and RAM usage of device. TODO Return overall system cpu/memory usage. Implement A

Skandar Munir 1 Nov 11, 2022
A Flutter plugin for iOS and Android allowing access to the device cameras.

Camera Plugin A Flutter plugin for iOS and Android allowing access to the device cameras. Note: This plugin is still under development, and some APIs

Rebar Ahmad 1 Mar 17, 2020
A Flutter plugin for Android and iOS allowing access to the device cameras, a bit deeper!!

flutter_cameraview A Flutter plugin for Android and iOS allowing access to the device cameras, a bit deeper!!. This plugin was created to offer more a

Herizo Ramaroson 18 Oct 22, 2022
Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, and web.

Wakelock Wakelock is Flutter plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping. Supported platforms Platfo

null 341 Jan 4, 2023
A Flutter plugin for iOS and Android allowing access to the device cameras.

A Flutter plugin for iOS and Android allowing access to the device cameras.

Lightsnap 140 Jan 8, 2023
A Flutter plugin to request the device unlock screen.

device_unlock A Flutter plugin to request the device unlock screen on Android and iOS. How does it work The following attempts and fallbacks are made:

Cíngulo 19 Sep 7, 2022
Flutter Plugin used to query audios/songs infos [title, artist, album, etc..] from device storage.

on_audio_query on_audio_query is a Flutter Plugin used to query audios/songs ?? infos [title, artist, album, etc..] from device storage. Help: Any pro

Lucas Josino 31 Dec 10, 2022
Flutter-Shared-Preference - The goal is to learn how to use the shared preferences plugin to save important pieces of information to your device.

Recipe Finder The goal is to learn how to use the shared preferences plugin to save important pieces of information to your device. Final App UI Resou

Ashirbad Swain 1 Jan 1, 2022
System info plus - A Flutter plugin to get device Random Access Memory (RAM) size

system_info_plus A Flutter plugin to get device Random Access Memory (RAM) size.

Sebghatullah Yusuf 2 Aug 21, 2022
A flutter plugin to query Android device Administrator (DevicePolicyManager) particulary Locking screen

device_policy_manager A flutter plugin to query Android device Administrator (DevicePolicyManager) particulary Locking screen for more info check Devi

Iheb Briki 4 Sep 29, 2022
Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your device and upload them to Firebase.

Flutter Tutorial - Upload Files To Firebase Storage Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your devic

Johannes Milke 30 Dec 28, 2022
A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity

Flutter Ready to Go A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity. Why

null 139 Nov 11, 2022
A responsive scaffold widget that adjusts to your device size, for your flutter mobile and web apps.

scaffold_responsive A responsive scaffold widget that adjusts to your device size, for your flutter mobile and web apps. Check out the Live demo here

Tushar Sadhwani 9 Sep 27, 2022