open_earable_flutter 0.1.0 copy "open_earable_flutter: ^0.1.0" to clipboard
open_earable_flutter: ^0.1.0 copied to clipboard

This package provides functionality for interacting with OpenEarable devices. Control LED colors, control audio, and access raw sensor data.

OpenEarable Flutter #

Pub Likes Pub Points Pub Version (including pre-releases)

This Dart package provides functionality for interacting with OpenEarable devices and some other wearables.

Try it online, provided your browser supports Web Bluetooth.

Button

Button

Permissions #

For your app to be able to use UniversalBLE in this package, you need to grant the following permissions:

Android #

You need to add the following permissions to your AndroidManifest.xml file:

<!-- flutter_reactive_ble permissions -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<!-- location permissions -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>

If you use location services in your app, remove android:maxSdkVersion="30" from the location permission tags

iOS / macOS #

For iOS it is required you add the following entries to the Info.plist file of your app. It is not allowed to access Core BLuetooth without this. See our example app on how to implement this. For more indepth details: Blog post on iOS bluetooth permissions

iOS 13 and higher

  • NSBluetoothAlwaysUsageDescription

iOS 12 and lower

  • NSBluetoothPeripheralUsageDescription

For macOS, add the Bluetooth capability to the macOS app from Xcode.

Getting Started #

To get started with the OpenEarable Flutter package, follow these steps:

  1. Installation: Add the package to your flutter project: \
flutter pub add open_earable_flutter

Alternatively, you can follow the instructions on pub.dev

  1. Import the package:
import 'package:open_earable_flutter/open_earable_flutter.dart';
  1. Initialize WearableManager
final WearableManager _wearableManager = WearableManager();
  1. Scan for devices:
_wearableManager.scanStream.listen((scannedDevice) {
  // Handle scanned devices
});

_wearableManager.startScan();
  1. Handle new connections:
// Deal with new connected devices
_wearableManager.connectStream.listen((wearable) {
  // Handle new wearable connection
  
  wearable.addDisconnectListener(() {
    // Handle disconnection
  });
});
  1. Connect to a device:
_wearableManager.connectToDevice(scannedDevice);
2
likes
130
points
88
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides functionality for interacting with OpenEarable devices. Control LED colors, control audio, and access raw sensor data.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

convert, flutter, logger, permission_handler, typed_data, universal_ble

More

Packages that depend on open_earable_flutter