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

PlatformAndroid
outdated

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
    await BluetoothManager.getBluetoothState.then((value) async => {
        // ...
        print(value)
    });

Example turn on/off bluetooth #

    // Enable bluetooth
    await BluetoothManager.enableBluetooth();
    // Disble bluetooth
    await BluetoothManager.disableBluetooth();

Example turn on/off bluetooth with ActionResponse #


    // return a ActionResponse
    // bluetoothIsOn, bluetoothIsOff, bluetoothAlreadyOn, bluetoothAlreadyOff, responseError

    // Enable bluetooth and return state
    await BluetoothManager.enableBluetooth().then((value) => {
        // ...
        print(value),
    });
    // Disble bluetooth and return state
    await BluetoothManager.disableBluetooth().then((value) => {
        // ...
        print(value),
     });

    
8
likes
150
pub points
80%
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

More

Packages that depend on bluetooth_manager