Is It possible to turn all the vibrations of the phone off using Android / Flutter?
263
For vibrating phone one can use flutter vibration package (Link :https://pub.dev/packages/vibration). Here is simple demo code. Make sure that you have add vibration package in your pubspec.yaml dependencies and also update the AndroidManifest.xml with this permission
<uses-permission android:name="android.permission.VIBRATE"/>
import 'package:flutter/material.dart';
import 'package:vibration/vibration.dart';
void main() => runApp(VibratingApp());
class VibratingApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Vibration Plugin example app'),
),
body: RaisedButton(
child: Text('Vibrate for default 500ms'),
onPressed: () {
Vibration.vibrate();
},
)));
}
}
Author by
Taha Malik
Updated on December 20, 2022Comments
-
Taha Malik over 1 year
I need to turn off all the vibrations of the phone i.e. fingerprint, notifications, keyboard tap, charger in and out, wrong password and any other vibration there is. Is it possible on Android using Java/Kotlin, or It will be better if it is possible on Flutter.
Thanks,
-
Zahid almost 4 yearscheck out this answer, don't know if it will help you stackoverflow.com/questions/8801310/…
-