{"id":22961681,"url":"https://github.com/baseflow/flutter-blues","last_synced_at":"2025-08-24T09:30:34.509Z","repository":{"id":56826657,"uuid":"227573003","full_name":"Baseflow/flutter-blues","owner":"Baseflow","description":"Flutter plugin to provide easy access to platform specific Bluetooth low energy services","archived":false,"fork":false,"pushed_at":"2020-09-10T09:57:02.000Z","size":147,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2024-12-22T02:44:27.268Z","etag":null,"topics":["baseflow","dart","flutter","flutter-plugin"],"latest_commit_sha":null,"homepage":"https://baseflow.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Baseflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"Baseflow","custom":"https://baseflow.com/contact"}},"created_at":"2019-12-12T09:51:14.000Z","updated_at":"2023-02-21T06:28:09.000Z","dependencies_parsed_at":"2022-09-13T08:12:36.840Z","dependency_job_id":null,"html_url":"https://github.com/Baseflow/flutter-blues","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseflow%2Fflutter-blues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseflow%2Fflutter-blues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseflow%2Fflutter-blues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baseflow%2Fflutter-blues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Baseflow","download_url":"https://codeload.github.com/Baseflow/flutter-blues/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230788230,"owners_count":18280300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baseflow","dart","flutter","flutter-plugin"],"created_at":"2024-12-14T19:13:19.830Z","updated_at":"2024-12-22T02:44:43.362Z","avatar_url":"https://github.com/Baseflow.png","language":"Dart","funding_links":["https://github.com/sponsors/Baseflow","https://baseflow.com/contact"],"categories":[],"sub_categories":[],"readme":"## Flutter Blues is not supported anymore\n\nDue to better bluetooth plugins being available, we decided discontinue flutter_blues. For connecting and communication with BLE devices we recommend using flutter_reactive_ble. \n\n# Flutter Blues Plugin\n\nBlues is a bluetooth plugin for [Flutter](http://www.flutter.io) and provides Bluetooth LE connectivity for both iOS and Android.\nIt is a fork from the original [FlutterBlue plugin](https://github.com/pauldemarco/flutter_blue) with some minor fixes. \n\nUsing the Blues 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/src/bluetooth_service.dart)), characteristics ([BluetoothCharacteristic](lib/src/bluetooth_characteristic.dart)), and descriptors ([BluetoothDescriptor](lib/src/bluetooth_descriptor.dart)).\nThe BluetoothDevice object is then used to directly interact with characteristics and descriptors.\n\n## Usage\n### Obtain an instance\n```dart\nBlues flutterBlues = Blues.instance;\n```\n\n### Scan for devices\n```dart\n// Start scanning\nflutterBlues.startScan(timeout: Duration(seconds: 4));\n\n// Listen to scan results\nvar subscription = flutterBlues.scanResults.listen((scanResult) {\n    // do something with scan result\n    device = scanResult.device;\n    print('${device.name} found! rssi: ${scanResult.rssi}');\n});\n\n// Stop scanning\nflutterBlues.stopScan();\n```\n\n### Connect to a device\n```dart\n// Connect to the device\nawait device.connect();\n\n// Disconnect from device\ndevice.disconnect();\n```\n\n### Discover services\n```dart\nList\u003cBluetoothService\u003e services = await device.discoverServices();\nservices.forEach((service) {\n    // do something with service\n});\n```\n\n### Read and write characteristics\n```dart\n// Reads all characteristics\nvar characteristics = service.characteristics;\nfor(BluetoothCharacteristic c in characteristics) {\n    List\u003cint\u003e value = await c.read();\n    print(value);\n}\n\n// Writes to a characteristic\nawait c.write([0x12, 0x34])\n```\n\n### Read and write descriptors\n```dart\n// Reads all descriptors\nvar descriptors = characteristic.descriptors;\nfor(BluetoothDescriptor d in descriptors) {\n    List\u003cint\u003e value = await d.read();\n    print(value);\n}\n\n// 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    // 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 that you request the MTU size, but will always try to negotiate the highest possible MTU (iOS supports up to MTU size 185)\n\n## Reference\n### Blues 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### Scanning for service UUID's doesn't return any results\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\n## Issues\n\nPlease file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/Baseflow/blues/issues) page.\n\n## Want to contribute\n\nIf you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](CONTRIBUTING.md) and send us your [pull request](https://github.com/Baseflow/blues/pulls).\n\n## Author\n\nThis Blues plugin for Flutter is developed by [Baseflow](https://baseflow.com). You can contact us at \u003chello@baseflow.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseflow%2Fflutter-blues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaseflow%2Fflutter-blues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaseflow%2Fflutter-blues/lists"}