ble_peer_session library
Offline 1:1 peer sessions over BLE for Flutter.
Host/client model with invitation handshake and bidirectional messaging. See Peer for the main entry point.
Classes
- BlePeerConfig
- BLE P2P session configuration (service UUIDs and app identifier).
- BlePeerUuidGenerator
-
Derives stable BLE UUIDs from
appNameso every install of the same app can find each other. - BluetoothPermissionsService
- Bluetooth runtime permission checks (Android 12+).
- Device
- Logger
- Logging contract for the BLE transport layer.
- Peer
- Entry point for offline BLE 1:1 peer sessions.
- PeerClient
- Client side of a 1:1 BLE peer session (discovers hosts and connects).
- PeerClientImpl
- PeerConnectionInfo
- Snapshot of the active peer session.
- PeerDisconnectInfo
- Emitted when an established session ends for any reason.
- PeerEndpoint
- PeerHost
- Host side of a 1:1 BLE peer session (advertises and accepts connections).
- PeerHostImpl
- PeerIdentity
- PeerMessage
- Wire envelope for session handshake and application payloads.
- PeerMessageTypes
-
Reserved
typevalues for the consent handshake between two peers. - PeerNearby
- A nearby host discovered while scanning (friendly name for Device).
- PeerSessionMessaging
- High-level text/JSON helpers shared by PeerHost and PeerClient.
- PeerUser
- The local or remote player visible to your app (not a BLE/GATT concept).
- SilentLogger
- No-op logger used when Peer.create is called without an explicit Logger.
Enums
- PeerAdapterStatus
- System Bluetooth adapter state exposed to applications.
- PeerConnectionPhase
- High-level connection lifecycle exposed to applications.
- PeerDisconnectReason
- Why an established BLE peer session ended.
- PeerErrorCode
- Classifies recoverable and diagnostic BLE peer session failures.
Extensions
Functions
-
throwPeer(
PeerErrorCode code, {Object? cause, StackTrace? stackTrace}) → Never
Exceptions / Errors
- PeerException
- Single public error type for the ble_peer_session package.