Giter Club home page Giter Club logo

haptic_feedback's Introduction

haptic_feedback

A haptic feedback plugin for both iOS and Android.

While it utilizes standard iOS haptics, it aims to emulate these same haptic patterns on Android for a consistent experience across platforms.

For more information on using the package in your Flutter app, you can read the article Using haptic feedback to make your Flutter app more interactive by Kamran. He provides detailed explanations on haptic feedback and when to use each type.

Getting Started

1. Add the dependency

flutter pub add haptic_feedback

2. Use the plugin

final canVibrate = await Haptics.canVibrate();

await Haptics.vibrate(HapticsType.success);
await Haptics.vibrate(HapticsType.warning);
await Haptics.vibrate(HapticsType.error);

await Haptics.vibrate(HapticsType.light);
await Haptics.vibrate(HapticsType.medium);
await Haptics.vibrate(HapticsType.heavy);

await Haptics.vibrate(HapticsType.rigid);
await Haptics.vibrate(HapticsType.soft);

await Haptics.vibrate(HapticsType.selection);

Automatic Permissions Inclusion

Android VIBRATE Permission

When you integrate the haptic_feedback plugin into your Flutter project, it will automatically include the necessary VIBRATE permission in the final merged AndroidManifest.xml of your app. This is due to the permission being declared in the plugin's manifest.

What this means for you:

  • No Manual Action Required: You don't have to add the <uses-permission android:name="android.permission.VIBRATE"/> permission to your app's AndroidManifest.xml manually. It will be automatically merged when building the app.

  • Transparency: By using the haptic_feedback plugin, your app will request the VIBRATE permission. Ensure that you are aware of all permissions your app requires, especially if you publish it on app stores. Some users may be sensitive to app permissions, even if they don't require explicit consent.

  • Permission Overview: To review all permissions that your app requests due to plugins and your own declarations, inspect the final merged AndroidManifest.xml after a build. This will provide a comprehensive view of all permissions and other manifest entries.

haptic_feedback's People

Contributors

dependabot[bot] avatar kamranbekirovyz avatar nohli avatar walid-ashik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

haptic_feedback's Issues

Only works with Haptics.vibrate(HapticsType.error);

I have implemented the plugin and it is only giving haptic feedback on errors through Haptics.vibrate(HapticsType.error);.

Rest of the methods like success, warning, soft etc aren't working. I have tried restarting phone, clearing flutter etc but nothing could fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.