headset_connection_event 2.1.1 copy "headset_connection_event: ^2.1.1" to clipboard
headset_connection_event: ^2.1.1 copied to clipboard

outdated

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

Headset Connection Event Flutter Plugin #

A Flutter plugin to get a headset event.

This is a clone of headset_event, but with fix on swift errors and bluetooth connection events for Android and iOS

Migrated to AndroidX

Current Status #

Platform Physical Headset Bluetooth
iOS
Android

Usage #

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

Example #

    // Import package
    import 'package:headset_connection_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;
      });
    });
24
likes
0
pub points
90%
popularity

Publisher

verified publisherthemobilecoder.com

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_connection_event