Flutter SDK
Every type and function in the Flutter RT SDK, with what each platform supports.
The Flutter RT SDK wraps the iOS and Android RT SDKs. This page lists its types and functions, and notes where a call works on one platform only.
Connection
enum Connection {
ble, // Bluetooth Low Energy
apple, // iPhone's built-in sensors (iOS only)
wearOs, // Wear OS watches (Android only)
android, // Phone's built-in sensors (Android only)
ant, // ANT+ protocol (Android only)
watchOs, // Apple Watch via WatchConnectivity (iOS only)
allDevices, // Combined BLE + ANT scanning (Android only)
}Platform availability:
ble
Yes
Yes
apple
Yes
No
watchOs
Yes
No
wearOs
No
Yes
android
No
Yes
ant
No
Yes
allDevices
No (maps to ble)
Yes
DataType
Types
Update
Data points delivered through streaming callbacks.
Device
Callbacks
Initialization
init
Creates and authenticates the RT SDK instance. Makes a network call.
devId➡ Your developer ID.referenceId➡ Optional user identifier in your system.
initConnection
Authenticates the SDK user. Makes a network call. Generate the token on your backend with POST /auth/generateAuthToken.
getUserId
Returns the Terra user ID, or null if not initialized.
disconnect
Disconnects from the given connection type.
Device scanning
startDeviceScan
Starts scanning with the built-in UI. On iOS, this renders a native SwiftUI BLE scanner view (use the iOSScanView widget). On Android, this uses the native device picker.
connection➡ The connection type to scan for.useCache➡ Reconnect to a previously paired device if available.connectionCallback➡ Optional callback fired when a device connection changes.
startDeviceScanToCallback
Starts scanning and passes each discovered device to deviceCallback. Use connectDevice() to connect to a chosen device.
connectDevice
Connects to a specific Device discovered by startDeviceScanToCallback.
iOSScanView (iOS only)
A Flutter widget that embeds the native iOS BLE scanner UI. Renders an empty Container on non-iOS platforms.
Usage:
Data streaming
startRealtimeToServer
Streams data to Terra's WebSocket server. The app does not receive the data locally.
startRealtimeToApp
Streams data to a local callback only. There is no server connection.
stopRealtime
Stops streaming for the given connection type.
watchOS (iOS only)
These methods return false on Android.
connectWatchOS
Establishes a WatchConnectivity session with the paired Apple Watch.
resumeWatchOSWorkout
Resumes a paused workout on the Apple Watch.
pauseWatchOSWorkout
Pauses the current workout on the Apple Watch.
stopWatchOSWorkout
Stops the current workout on the Apple Watch.
Last updated
Was this helpful?