headset_event 0.0.2 copy "headset_event: ^0.0.2" to clipboard
headset_event: ^0.0.2 copied to clipboard

Flutter Plugin for headset events. Detect headset is plugged and unplugged. Get current headset state.

Headset Event Flutter Plugin #

A Flutter plugin to get a headset event.

Migrated to AndroidX

Usage #

To use this plugin, add headset_event as a dependency in your pubspec.yaml file.

Example #

    // Import package
    import 'package:headset_event/headset_event.dart';

    // Instantiate it
    HeadsetEvent headsetPlugin = new HeadsetEvent();
    HeadsetState headsetEvent;

    /// if headset is plugged
    headsetPlugin.getCurrentState.then((_val){
      setState(() {
        headsetEvent = _val;
      });
    });

    /// Detect the moment headset is plugged or unplugged
    headsetPlugin.setListener((_val) {
      setState(() {
        headsetEvent = _val;
      });
    });
5
likes
30
pub points
21%
popularity

Publisher

unverified uploader

Flutter Plugin for headset events. Detect headset is plugged and unplugged. Get current headset state.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on headset_event