bluetooth_manager 1.0.11 copy "bluetooth_manager: ^1.0.11" to clipboard
bluetooth_manager: ^1.0.11 copied to clipboard

PlatformAndroid

A simple plugin to manage Bluetooth, turning on and off ang geting Bluetooth state.

bluetooth_manager #

Bluetooth Manager it's a Android Plugin to control the bluetooth basics, turning on/off and get the state.

How to Start #

Import the library

    import 'package:bluetooth_manager/bluetooth_manager.dart';

Use exemple #

Example get bluetooth state #

    // Get bluetooth state
    // return a BluetoothState
    // on, off and unknow
    BluetoothState bluetoothState =
                      await bluetoothManager.getBluetoothState();
    print(bluetoothState);

Example listener bluetooth state #

    // Get bluetooth state Listener
    // return a BluetoothState
    // on, off and unknow
    bluetoothManager.getBluetoothStateStream().listen((BluetoothState bluetoothState) {
        print(bluetoothState);
        // Do your logic here...
    });

Example turn on/off bluetooth #

    // Enable bluetooth
    // you can call only await 
    // bluetoothManager.disableBluetooth() or await bluetoothManager.enableBluetooth()
    // if you don't want the response
    ActionResponse actionResponse = await bluetoothManager.disableBluetooth();
    print(actionResponse);
    // Disble bluetooth
    ActionResponse actionResponse = await bluetoothManager.enableBluetooth();
    print(actionResponse);
8
likes
120
pub points
78%
popularity

Publisher

unverified uploader

A simple plugin to manage Bluetooth, turning on and off ang geting Bluetooth state.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter, permission_handler

More

Packages that depend on bluetooth_manager