0 purchases
bluetooth state
bluetooth_state #
A Plugin Flutter Bluetooth turn off/on
Getting Started #
Install #
Add the following lines in your pubspec.yaml file
bluetooth_state: ^latest_version
copied to clipboard
API #
Is Bluetooth Enable
Future<bool> get isBluetoothEnable async {
try {
return await BluetoothState().isBluetoothEnable;
} catch (e) {
print(e);
throw 'Failed to get is bluetooth enable';
}
}
copied to clipboard
Request Enable Bluetooth
Future<void> requestEnableBluetooth() async {
try {
await BluetoothState.requestEnableBluetooth();
} catch (e) {
print(e);
throw 'Failed to request enable bluetooth';
}
}
copied to clipboard
Request Disable Bluetooth
Future<void> requestDisableBluetooth() async {
try {
await BluetoothState.requestDisableBluetooth();
} catch (e) {
print(e);
throw 'Failed to request disable bluetooth';
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.