ledger_flutter_plus library

Classes

AndroidOptions
Scan models Android options to scan devices requestLocationPermission is used to request location permission on Android 12+ (API 31+). scanMode is used to set the scan mode for Bluetooth LE scan. Set reportDelayMillis timestamp for Bluetooth LE scan. If set to 0, you will be notified of scan results immediately. If > 0, scan results are queued up and delivered after the requested delay or 5000 milliseconds (whichever is higher). Note scan results may be delivered sooner if the internal buffers fill up. callbackType, matchMode, and numOfMatches map directly to the equivalent android.bluetooth.le.ScanSettings setters. When null, the plugin leaves them at the platform default — set them only if you need to override platform-side advert de-duplication (e.g. on Pixel hardware where the default settings throttle advertisements compared with nRF Connect).
AppleConnectionOptions
Apple options for connect.
BleCapabilities
BleCharacteristic
BleCommand
BleConnectionParametersUpdated
Link-layer connection parameters reported by Android onConnectionUpdated.
BleDescriptor
BleDevice
BlePacker
BlePeripheralAdvertisingStateChanged
BlePeripheralCapabilities
BlePeripheralCharacteristic
Peripheral/GATT server characteristic model that reuses BleCharacteristic.
BlePeripheralCharacteristicSubscriptionChanged
BlePeripheralConnectionStateChanged
BlePeripheralDescriptor
Peripheral/GATT server descriptor model that reuses BleDescriptor.
BlePeripheralEvent
BlePeripheralMtuChanged
BlePeripheralService
Peripheral/GATT server service model that reuses BleService.
BlePeripheralServiceAdded
BleSearchManager
BleService
BleUuidParser
BluetoothOptions
ByteDataReader
A class for parsing byte arrays.
ByteDataWriter
A class for building byte arrays with a BytesBuffer and a fixed-length work buffer.
BytesBuffer
A class for concatenating byte arrays efficiently.
CharacteristicSubscription
Manages subscription to a characteristic's notifications or indications.
ConnectionManager
ConnectionPlatformConfig
DiscoveredLedger
ExclusionFilter
GattGateway
GATT is an acronym for the Generic ATTribute Profile, and it defines the way that two Bluetooth Low Energy devices transfer data back and forth using concepts called Services and Characteristics.
LedgerBleConnectionManager
LedgerBleSearchManager
LedgerConnection
LedgerDevice
LedgerGattGateway
LedgerGattReader
LedgerInterface
LedgerOperation<T>
LedgerPacker
LedgerTransformer
LedgerUsbManager
ManufacturerData
Represents the manufacturer data of a BLE device.
ManufacturerDataFilter
PeripheralAndroidOptions
PeripheralPlatformConfig
PeripheralReadRequestResult
PeripheralWriteRequestResult
PlatformConfig
Platform specific config to scan devices
ScanFilter
UniversalBle
UniversalBlePeripheral
UniversalBlePeripheralPlatform
UniversalBlePeripheralUnsupported
UniversalBlePlatform
WebOptions
Web options to scan devices optionalServices is a list of service uuid's to ensure that you can access the specified services after connecting to the device, by default services from scanFilter will be used optionalManufacturerData is list of CompanyIdentifier's and used to add ManufacturerData in advertisement results of selected device from web dialog, by default manufacturerData from scanFilter will be used Checkout more details on web Note: you will only get advertisements if Experimental Flag is enabled in the browser

Enums

AndroidScanCallbackType
Mirrors android.bluetooth.le.ScanSettings#setCallbackType. Pass any combination via AndroidOptions.callbackType (the plugin OR-folds the list before calling setCallbackType).
AndroidScanMatchMode
Mirrors android.bluetooth.le.ScanSettings#setMatchMode.
AndroidScanMode
AndroidScanNumOfMatches
Mirrors android.bluetooth.le.ScanSettings#setNumOfMatches.
AvailabilityState
BleConnectionPriority
Connection priority hint passed to requestConnectionPriority.
BleConnectionState
BleInputProperty
BleLogLevel
BleOutputProperty
CharacteristicProperty
ConnectionType
LedgerDeviceType
PeripheralAdvertisingState
PeripheralAttributePermission
PeripheralReadinessState
QueueType
UnexpectedDataPacketReason
UniversalBleErrorCode
Unified error codes for all platforms

Extensions

BleCharacteristicExtension on BleCharacteristic
Extension methods for BleCharacteristic to simplify common operations.
BleConnectionParametersUpdatedX on BleConnectionParametersUpdated
Helpers for BleConnectionParametersUpdated reported on Android.
BleDeviceExtension on BleDevice
Extension methods for BleDevice to simplify common operations.
BleServiceExtension on BleService
Extension methods for BleService objects.
ObjectExt on T
StringListToUUID on List<String>
Parse a list of strings to a list of UUIDs.

Functions

castBytes(List<int> bytes, {bool copy = false}) Uint8List
Cast the list of bytes into a typed Uint8List.
readAsBytes(Stream<List<int>> stream, {int? maxLength, bool copy = false}) Future<Uint8List>
Read stream into a typed byte buffer.
sliceStream(Stream<List<int>> stream, int sliceLength, {int? maxLength, bool copy = false}) Stream<Uint8List>
Read stream and slice the content into chunks with target/max length of sliceLength.

Typedefs

OnAvailabilityChange = void Function(AvailabilityState state)
OnConnectionChange = void Function(String deviceId, bool isConnected, String? error)
Central mode callbacks
OnConnectionParametersChange = void Function(BleConnectionParametersUpdated update)
OnPairingStateChange = void Function(String deviceId, bool isPaired)
OnPeripheralDescriptorReadRequest = PeripheralReadRequestResult? Function(String deviceId, String characteristicId, String descriptorId, int offset, Uint8List? value)
OnPeripheralDescriptorWriteRequest = PeripheralWriteRequestResult? Function(String deviceId, String characteristicId, String descriptorId, int offset, Uint8List? value)
OnPeripheralReadRequest = PeripheralReadRequestResult? Function(String deviceId, String characteristicId, int offset, Uint8List? value)
Peripheral mode callbacks
OnPeripheralWriteRequest = PeripheralWriteRequestResult? Function(String deviceId, String characteristicId, int offset, Uint8List? value)
OnQueueUpdate = void Function(String id, int remainingQueueItems)
OnScanResult = void Function(BleDevice scanResult)
OnValueChange = void Function(String deviceId, String characteristicId, Uint8List value, int? timestamp)
PermissionRequestCallback = Future<bool> Function(AvailabilityState status)

Exceptions / Errors

ConnectionException
Exception thrown when connection-related errors occur
ConnectionLostException
DeviceNotConnectedException
DisposeException
EstablishConnectionException
LedgerDeviceException
LedgerException
LedgerManagerDisposedException
PairingException
Exception thrown when pairing-related errors occur
PermissionException
ServiceNotSupportedException
UnexpectedDataPacketException
UniversalBleException
Base exception class for all BLE errors with typed error codes
WebBluetoothGloballyDisabled
Exception thrown when Web Bluetooth API is globally disabled