How to implement vibration with Flutter for both Android and iOS?

前端 未结 4 2735
臣服心动
臣服心动 2021-02-20 17:29

Using Flutter I am trying to implement vibration on a button click.

I find it surprisingly difficult to be honest. I\'ve tried using the following packages unsuccessfully

4条回答
  •  清歌不尽
    2021-02-20 18:29

    Found a way using HapticFeedback.vibrate(). It works for both iOS and Android. See more details with code example and other settings on this [post][1]: Flutter: How to use HapticFeedback

提交回复
热议问题