flutter_android_volume_keydown 0.0.1 copy "flutter_android_volume_keydown: ^0.0.1" to clipboard
flutter_android_volume_keydown: ^0.0.1 copied to clipboard

PlatformAndroid
outdated

A simple plugin for listening to the Android volume keydown event

flutter_android_volume_keydown #

A simple flutter plugin for Android that listens to the volume down button. It blocks the button from lowering the volume while listening for events.

How to use #

Using the plugin is very simple:

  • Add flutter_android_volume_keydown to your pubspec.yaml
  • Change your MainActivity.java or MainActivity.kt to extend FlutterAndroidVolumeKeydownActivity
  • Implement a simple listener:
var subscription = FlutterAndroidVolumeKeydown.stream.listen((event) {
      print("Volume Keydown received");
    });

To stop listening:

subscription?.cancel();

While listening the Volume Keydown events are not handled by Android, when you stop listening the button resumes its normal functionality again.

15
likes
130
pub points
86%
popularity

Publisher

verified publisherdart-tools.dev

A simple plugin for listening to the Android volume keydown event

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_android_volume_keydown