Haptic Feedback in Flutter

Updated 27 April 2023

Save

So, what is Haptic Feedback in Flutter? Firstly, before start coding, we should know about haptic feedback. And why we use haptic feedback.

As we know, when a user taps on the screen and feels a reaction from the device. That reaction from the device is called haptic feedback.

Generally, haptic feedback alerts the users when some action is performed or some event is clicked.

Check our Flutter app development page.

Different types of Haptic Feedback in Flutter

Steps to create Haptic Feedback in Flutter

First of all, we need to create three classes main.dart, home. dart and second.dart.

main.dart code

In this, we just created the root of the application using the stateless widget

We do not code here bcoz we don’t want to make our app’s main thread heavy.

Home.dart code

In this code, as you see I created a well-designed UI that contains buttons for performing haptic feedback.

Now when the user will tap on the button it gives a reaction. That reaction is called haptic feedback.

Second.dart code

Overall, this is my third and the last screen of UI, and the only motive to create this page is to navigate from the home page to the second page when the user taps the button.

Here, the images of the screen

I hope this blog will help you to learn about Haptic Feedback using flutter and you will be able to implement them.

Happy Learning ✍️

Reference Link

https://medium.com/tagmalogic/implement-vibration-with-flutter-c0a7d2d4007

https://api.flutter.dev/flutter/services/HapticFeedback-class.html

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home