flutter_ble_peripheral
3.2.0, released 3 weeks ago by steenbakker.dev
Set a device into BLE peripheral mode and advertise custom services.
What it does
Enables a mobile or desktop device to act as a Bluetooth Low Energy peripheral, broadcasting service UUIDs, manufacturer data, and service data. It also supports serving a local GATT server with characteristics for notifying and writing.
AI-written summary of version 3.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need your Flutter app to act as a Bluetooth beacon or peripheral.
- You want to host a GATT server to communicate with nearby central devices.
Skip it when
- You only need to scan or connect to peripherals as a central device.
- You need complex multi-service GATT hosting on platforms that restrict it.
Strengths
- Cross-platform support for Android, iOS, macOS, and Windows.
- Includes GATT server capabilities with custom characteristics.
- Handles background advertising on supported platforms.
Weaknesses
- Platform limitations restrict certain advertisement fields on iOS and macOS.
- Requires native permission configurations for Bluetooth and location.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 1
Requires permissions in AndroidManifest.xml, usage descriptions in Info.plist for iOS/macOS, and Bluetooth entitlements on macOS.
import 'package:flutter_ble_peripheral/flutter_ble_peripheral.dart';
final peripheral = FlutterBlePeripheral();
await peripheral.start(
advertiseData: AdvertiseDataCore(
serviceUuid: 'bf27730d-860a-4e09-889c-2d8b6a9e0fe7',
localName: 'My peripheral',
manufacturerId: 1234,
manufacturerData: Uint8List.fromList([1, 2, 3]),
),
);Alternatives
Packages that do the same job and could replace flutter_ble_peripheral.
- in_app_update
Triggers official Google Play In-App Updates on Android devices.
81Compare - flutter_foreground_task
Implement and manage foreground services on Android and iOS platforms.
89Compare - google_api_availability
Check the availability of Google Play services on an Android device.
88Compare - auto_orientation_v2
Programmatically control device orientation on iOS, Android, and Web.
72Compare
Works with
Packages commonly used together with flutter_ble_peripheral: ones it builds on, ones built on it, and its own family.