MethodChannelFlutterSimpleBluetoothPrinter class

By Xiao 2023/1 An implementation of FlutterSimpleBluetoothPrinterPlatform that uses method channels.

Inheritance

Properties

connectionIsLe bool
no setteroverride
connectState Stream<BTConnectState>
no setteroverride
eventChannel EventChannel
final
hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanResults Stream<List<BluetoothDevice>>
no setteroverride

Methods

connect({required String address, required ConnectionConfig config}) Future<bool>
Connect to a Bluetooth device via address. Throw BTException if failed.
override
disconnect({required Duration delay}) Future<bool>
Disconnect from a Bluetooth device. Throw BTException if failed. delay is the time to wait before disconnecting.
override
discovery({List<ScanFilter>? scanFilters}) Stream<BluetoothDevice>
Starts scan for Bluetooth LE devices Note: This is a continuous behavior, don't forget to call stopDiscovery. scanFilters filters the scan results. Throw BTException if failed.
override
ensureConnected({required String address, required bool isLE}) Future<bool>
override
getAndroidPairedDevices() Future<List<BluetoothDevice>>
Get paired devices for Android. For iOS, it will return an empty list. Throw BTException if failed.
override
getBluetoothState() Future<BTState>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestMtu(int mtu) Future<int>
override
scan({required Duration timeout, List<ScanFilter>? scanFilters}) Future<List<BluetoothDevice>>
Scan for Bluetooth LE devices until timeout is reached. scanFilters filters the scan results. Throw BTException if failed.
override
setupIndication({required String characteristicUuid}) Future<bool>
override
setupNotification({required String characteristicUuid}) Future<bool>
override
stopDiscovery() Future<bool>
Stops scan for Bluetooth LE devices. Throw BTException if failed.
override
toString() String
A string representation of this object.
inherited
writeRawData(Uint8List bytes, {String? characteristicUuid}) Future<bool>
Write raw data to the connected device. Must connect to a device first. Throw BTException if failed.
override
writeText(String text, {String? characteristicUuid}) Future<bool>
Write text to the connected device. Must connect to a device first. Throw BTException if failed.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited