[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9219":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":27,"discoverSource":28},9219,"flutter_blue","pauldemarco\u002Fflutter_blue","pauldemarco","Bluetooth plugin for Flutter","",null,"Dart",2431,1242,66,670,0,2,61.48,"BSD 3-Clause \"New\" or \"Revised\" License",false,"master",true,[],"2026-06-12 04:00:43","[![pub package](https:\u002F\u002Fimg.shields.io\u002Fpub\u002Fv\u002Fflutter_blue.svg)](https:\u002F\u002Fpub.dartlang.org\u002Fpackages\u002Fflutter_blue)\n[![Chat](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F634853295160033301.svg?style=flat-square&colorB=758ED3)](https:\u002F\u002Fdiscord.gg\u002FYk5Efra)\n\n\u003Cbr>\n\u003Cp align=\"center\">\n\u003Cimg alt=\"FlutterBlue\" src=\"https:\u002F\u002Fgithub.com\u002Fpauldemarco\u002Fflutter_blue\u002Fblob\u002Fmaster\u002Fsite\u002Fflutterblue.png?raw=true\" \u002F>\n\u003C\u002Fp>\n\u003Cbr>\u003Cbr>\n\n## Introduction\n\nFlutterBlue is a bluetooth plugin for [Flutter](https:\u002F\u002Fflutter.dev), a new app SDK to help developers build modern multi-platform apps.\n\n## Alpha version\n\nThis library is actively developed alongside production apps, and the API will evolve as we continue our way to version 1.0.\n\n**Please be fully prepared to deal with breaking changes.**\n**This package must be tested on a real device.**\n\nHaving trouble adapting to the latest API?   I'd love to hear your use-case, please contact me.\n\n## Cross-Platform Bluetooth LE\nFlutterBlue aims to offer the most from both platforms (iOS and Android).\n\nUsing the FlutterBlue instance, you can scan for and connect to nearby devices ([BluetoothDevice](#bluetoothdevice-api)).\nOnce connected to a device, the BluetoothDevice object can discover services ([BluetoothService](lib\u002Fsrc\u002Fbluetooth_service.dart)), characteristics ([BluetoothCharacteristic](lib\u002Fsrc\u002Fbluetooth_characteristic.dart)), and descriptors ([BluetoothDescriptor](lib\u002Fsrc\u002Fbluetooth_descriptor.dart)).\nThe BluetoothDevice object is then used to directly interact with characteristics and descriptors.\n\n## Usage\n### Obtain an instance\n```dart\nFlutterBlue flutterBlue = FlutterBlue.instance;\n```\n\n### Scan for devices\n```dart\n\u002F\u002F Start scanning\nflutterBlue.startScan(timeout: Duration(seconds: 4));\n\n\u002F\u002F Listen to scan results\nvar subscription = flutterBlue.scanResults.listen((results) {\n    \u002F\u002F do something with scan results\n    for (ScanResult r in results) {\n        print('${r.device.name} found! rssi: ${r.rssi}');\n    }\n});\n\n\u002F\u002F Stop scanning\nflutterBlue.stopScan();\n```\n\n### Connect to a device\n```dart\n\u002F\u002F Connect to the device\nawait device.connect();\n\n\u002F\u002F Disconnect from device\ndevice.disconnect();\n```\n\n### Discover services\n```dart\nList\u003CBluetoothService> services = await device.discoverServices();\nservices.forEach((service) {\n    \u002F\u002F do something with service\n});\n```\n\n### Read and write characteristics\n```dart\n\u002F\u002F Reads all characteristics\nvar characteristics = service.characteristics;\nfor(BluetoothCharacteristic c in characteristics) {\n    List\u003Cint> value = await c.read();\n    print(value);\n}\n\n\u002F\u002F Writes to a characteristic\nawait c.write([0x12, 0x34])\n```\n\n### Read and write descriptors\n```dart\n\u002F\u002F Reads all descriptors\nvar descriptors = characteristic.descriptors;\nfor(BluetoothDescriptor d in descriptors) {\n    List\u003Cint> value = await d.read();\n    print(value);\n}\n\n\u002F\u002F Writes to a descriptor\nawait d.write([0x12, 0x34])\n```\n\n### Set notifications and listen to changes\n```dart\nawait characteristic.setNotifyValue(true);\ncharacteristic.value.listen((value) {\n    \u002F\u002F do something with new value\n});\n```\n\n### Read the MTU and request larger size\n```dart\nfinal mtu = await device.mtu.first;\nawait device.requestMtu(512);\n```\nNote that iOS will not allow requests of MTU size, and will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)\n\n## Getting Started\n### Change the minSdkVersion for Android\n\nFlutter_blue is compatible only from version 19 of Android SDK so you should change this in **android\u002Fapp\u002Fbuild.gradle**:\n```dart\nAndroid {\n  defaultConfig {\n     minSdkVersion: 19\n```\n### Add permissions for Bluetooth\nWe need to add the permission to use Bluetooth and access location:\n\n#### **Android**\nIn the **android\u002Fapp\u002Fsrc\u002Fmain\u002FAndroidManifest.xml** let’s add:\n\n```xml \n\t \u003Cuses-permission android:name=\"android.permission.BLUETOOTH\" \u002F>  \n\t \u003Cuses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" \u002F>  \n\t \u003Cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"\u002F>  \n \u003Capplication\n```\n#### **IOS**\nIn the **ios\u002FRunner\u002FInfo.plist** let’s add:\n\n```dart \n\t\u003Cdict>  \n\t    \u003Ckey>NSBluetoothAlwaysUsageDescription\u003C\u002Fkey>  \n\t    \u003Cstring>Need BLE permission\u003C\u002Fstring>  \n\t    \u003Ckey>NSBluetoothPeripheralUsageDescription\u003C\u002Fkey>  \n\t    \u003Cstring>Need BLE permission\u003C\u002Fstring>  \n\t    \u003Ckey>NSLocationAlwaysAndWhenInUseUsageDescription\u003C\u002Fkey>  \n\t    \u003Cstring>Need Location permission\u003C\u002Fstring>  \n\t    \u003Ckey>NSLocationAlwaysUsageDescription\u003C\u002Fkey>  \n\t    \u003Cstring>Need Location permission\u003C\u002Fstring>  \n\t    \u003Ckey>NSLocationWhenInUseUsageDescription\u003C\u002Fkey>  \n\t    \u003Cstring>Need Location permission\u003C\u002Fstring>\n```\n\nFor location permissions on iOS see more at: [https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcorelocation\u002Frequesting_authorization_for_location_services](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fcorelocation\u002Frequesting_authorization_for_location_services)\n\n\n## Reference\n### FlutterBlue API\n|                  |      Android       |         iOS          |             Description            |\n| :--------------- | :----------------: | :------------------: |  :-------------------------------- |\n| scan             | :white_check_mark: |  :white_check_mark:  | Starts a scan for Bluetooth Low Energy devices. |\n| state            | :white_check_mark: |  :white_check_mark:  | Stream of state changes for the Bluetooth Adapter. |\n| isAvailable      | :white_check_mark: |  :white_check_mark:  | Checks whether the device supports Bluetooth. |\n| isOn             | :white_check_mark: |  :white_check_mark:  | Checks if Bluetooth functionality is turned on. |\n\n### BluetoothDevice API\n|                             |       Android        |         iOS          |             Description            |\n| :-------------------------- | :------------------: | :------------------: |  :-------------------------------- |\n| connect                     |  :white_check_mark:  |  :white_check_mark:  | Establishes a connection to the device. |\n| disconnect                  |  :white_check_mark:  |  :white_check_mark:  | Cancels an active or pending connection to the device. |\n| discoverServices            |  :white_check_mark:  |  :white_check_mark:  | Discovers services offered by the remote device as well as their characteristics and descriptors. |\n| services                    |  :white_check_mark:  |  :white_check_mark:  | Gets a list of services. Requires that discoverServices() has completed. |\n| state                       |  :white_check_mark:  |  :white_check_mark:  | Stream of state changes for the Bluetooth Device. |\n| mtu                         |  :white_check_mark:  |  :white_check_mark:  | Stream of mtu size changes. |\n| requestMtu                  |  :white_check_mark:  |                      | Request to change the MTU for the device. |\n\n### BluetoothCharacteristic API\n|                             |       Android        |         iOS          |             Description            |\n| :-------------------------- | :------------------: | :------------------: |  :-------------------------------- |\n| read                        |  :white_check_mark:  |  :white_check_mark:  | Retrieves the value of the characteristic.  |\n| write                       |  :white_check_mark:  |  :white_check_mark:  | Writes the value of the characteristic. |\n| setNotifyValue              |  :white_check_mark:  |  :white_check_mark:  | Sets notifications or indications on the characteristic. |\n| value                       |  :white_check_mark:  |  :white_check_mark:  | Stream of characteristic's value when changed. |\n\n### BluetoothDescriptor API\n|                             |       Android        |         iOS          |             Description            |\n| :-------------------------- | :------------------: | :------------------: |  :-------------------------------- |\n| read                        |  :white_check_mark:  |  :white_check_mark:  | Retrieves the value of the descriptor.  |\n| write                       |  :white_check_mark:  |  :white_check_mark:  | Writes the value of the descriptor. |\n\n## Troubleshooting\n### When I scan using a service UUID filter, it doesn't find any devices.\nMake sure the device is advertising which service UUID's it supports.  This is found in the advertisement\npacket as **UUID 16 bit complete list** or **UUID 128 bit complete list**.\n","FlutterBlue 是一个为 Flutter 应用程序设计的蓝牙插件。它支持跨平台（iOS 和 Android）的蓝牙低功耗（BLE）操作，允许开发者通过扫描、连接设备以及发现服务、特征和描述符来与蓝牙设备进行交互。核心功能包括启动和停止设备扫描、连接或断开与设备的连接、发现并读写服务和特征值等。此库特别适合需要在移动应用中实现蓝牙功能的场景，如智能家居控制、健康监测设备的数据收集等。需要注意的是，该项目仍处于活跃开发阶段，API 可能会发生变化，因此在生产环境中使用时需谨慎测试。","2026-06-11 03:21:46","top_language"]