Skip to content
pubscout

ble_peripheral

2.4.0, released 2 years ago by rohitsangwan.in

Flutter plugin to turn a device into a BLE peripheral and advertise GATT services.

WASM-ready
$ flutter pub add ble_peripheral
Source repository

What it does

Provides an OS‑independent API to create a BLE GATT server, add services/characteristics, and start/stop advertising. Includes callbacks for connection, read/write requests, and subscription changes across Android, iOS, macOS, and Windows.

AI-written summary of version 2.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • you need to expose custom BLE services from a Flutter app
  • testing or prototyping BLE servers on multiple platforms

Skip it when

  • you only need BLE central (client) functionality
  • targeting Linux or platforms not listed

Strengths

  • cross‑platform (Android, iOS, macOS, Windows)
  • rich callback system for read/write/connection events
  • supports adding/removing services at runtime

Weaknesses

  • no Linux support
  • requires native permission setup and may crash on some edge cases
  • documentation limited to basic usage

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
0

Add Bluetooth permissions to AndroidManifest (BLUETOOTH, BLUETOOTH_CONNECT, etc.) and NSBluetoothAlwaysUsageDescription to iOS/macOS Info.plist; request runtime permissions (e.g., via permission_handler).

await BlePeripheral.initialize();
await BlePeripheral.addService(BleService(uuid:"0000180F-0000-1000-8000-00805F9B34FB",primary:true,characteristics:[BleCharacteristic(uuid:"00002A19-0000-1000-8000-00805F9B34FB",properties:[CharacteristicProperties.read.index,CharacteristicProperties.notify.index],value:null,permissions:[AttributePermissions.readable.index])]));
await BlePeripheral.startAdvertising(services:["0000180F-0000-1000-8000-00805F9B34FB"],localName:"TestBle");

Alternatives

Packages that do the same job and could replace ble_peripheral.