headsetevent_fix 0.0.1 icon indicating copy to clipboard operation
headsetevent_fix: ^0.0.1 copied to clipboard

Detect headset plugged, unplugged.

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:headsetevent/headsetevent.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;
      });
    });
0
likes
90
pub points
0%
popularity

Publisher

unverified uploader

Detect headset plugged, unplugged.

Homepage

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on headsetevent_fix