Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: How to use HapticFeedback

I have imported

import 'package:flutter/services.dart';

and then called

HapticFeedback.lightImpact();

nothing happens. What do I need to do to get it working? I am testing with the latest Flutter version 1.6.6 on a Galaxy S8 running Android 9.0

like image 325
Ymi_Yugy Avatar asked May 31 '19 22:05

Ymi_Yugy


People also ask

What is haptic feedback?

Haptic feedback is the use of touch to communicate with users. Most people know the feeling of a vibration in a mobile phone or the rumble in a game controller – but haptic feedback is much more than that. Robert Blenkinsopp, VP Engineering at Ultraleap, explains why.


1 Answers

Please make sure that Vibration feedback is enabled on the android device, and make sure to add

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

to the AndroidManifest.xml. See more info here: https://github.com/flutter/flutter/issues/33750

like image 198
Sergey Avatar answered Sep 20 '22 23:09

Sergey