Polar class

Flutter implementation of the PolarBleSdk

Constructors

Polar({bool bluetoothScanNeverForLocation = true})
Initialize the Polar API. Returns a singleton.
factory

Properties

batteryLevel Stream<PolarBatteryLevelEvent>
Battery level received from device.
no setter
blePowerState Stream<bool>
helper to ask ble power state
no setter
deviceConnected Stream<PolarDeviceInfo>
Device connection has been established.
no setter
deviceConnecting Stream<PolarDeviceInfo>
Callback when connection attempt is started to device
no setter
deviceDisconnected Stream<PolarDeviceDisconnectedEvent>
Connection lost to device. If PolarBleApi#disconnectFromPolarDevice is not called, a new connection attempt is dispatched automatically.
no setter
disInformation Stream<PolarDisInformationEvent>
Received DIS info.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sdkFeatureReady Stream<PolarSdkFeatureReadyEvent>
feature ready callback
no setter

Methods

connectToDevice(String identifier, {bool requestPermissions = true}) Future<void>
Request a connection to a Polar device. Invokes PolarBleApiObservers polarDeviceConnected.
disableSdkMode(String identifier) Future<void>
Disables SDK mode.
disconnectFromDevice(String identifier) Future<void>
Disconnect from the current Polar device.
doFactoryReset(String identifier, bool preservePairingInformation) Future<void>
Perform factory reset to given device.
enableSdkMode(String identifier) Future<void>
Enables SDK mode.
fetchExercise(String identifier, PolarExerciseEntry entry) Future<PolarExerciseData>
Api for fetching a single exercise from Polar H10 device. Requires polarFileTransfer feature. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.
getAvailableOnlineStreamDataTypes(String identifier) Future<Set<PolarDataType>>
Get the data types available in this device for online streaming
isSdkModeEnabled(String identifier) Future<bool>
Check if SDK mode currently enabled.
listExercises(String identifier) Future<List<PolarExerciseEntry>>
Api for fetching stored exercises list from Polar H10 device. Requires polarFileTransfer feature. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeExercise(String identifier, PolarExerciseEntry entry) Future<void>
Api for removing single exercise from Polar H10 device. Requires polarFileTransfer feature. This API is working for Polar OH1 and Polar Verity Sense devices too, however in those devices recording of exercise requires that sensor is registered to Polar Flow account.
requestPermissions() Future<void>
Request the necessary permissions on Android
requestRecordingStatus(String identifier) Future<PolarRecordingStatus>
Request current recording status. Supported only by Polar H10. Requires polarFileTransfer feature.
requestStreamSettings(String identifier, PolarDataType feature) Future<PolarSensorSetting>
Request the stream settings available in current operation mode. This request shall be used before the stream is started to decide currently available settings. The available settings depend on the state of the device. For example, if any stream(s) or optical heart rate measurement is already enabled, then the device may limit the offer of possible settings for other stream feature. Requires polarSensorStreaming feature.
searchForDevice() Stream<PolarDeviceInfo>
Start searching for Polar device(s)
setLedConfig(String identifier, LedConfig config) Future<void>
Set LedConfig to enable or disable blinking LEDs (Verity Sense 2.2.1+).
startAccStreaming(String identifier, {PolarSensorSetting? settings}) Stream<PolarAccData>
Start ACC (Accelerometer) stream. ACC stream is stopped if the connection is closed, error occurs or stream is disposed.
startEcgStreaming(String identifier, {PolarSensorSetting? settings}) Stream<PolarEcgData>
Start the ECG (Electrocardiography) stream. ECG stream is stopped if the connection is closed, error occurs or stream is disposed.
startGyroStreaming(String identifier, {PolarSensorSetting? settings}) Stream<PolarGyroData>
Start Gyro stream. Gyro stream is stopped if the connection is closed, error occurs during start or stream is disposed.
startHrStreaming(String identifier) Stream<PolarHrData>
Start heart rate stream. Heart rate stream is stopped if the connection is closed, error occurs or stream is disposed.
startMagnetometerStreaming(String identifier, {PolarSensorSetting? settings}) Stream<PolarMagnetometerData>
Start magnetometer stream. Magnetometer stream is stopped if the connection is closed, error occurs or stream is disposed.
startPpgStreaming(String identifier, {PolarSensorSetting? settings}) Stream<PolarPpgData>
Start optical sensor PPG (Photoplethysmography) stream. PPG stream is stopped if the connection is closed, error occurs or stream is disposed.
startPpiStreaming(String identifier) Stream<PolarPpiData>
Start PPI (Pulse to Pulse interval) stream. PPI stream is stopped if the connection is closed, error occurs or stream is disposed. Notice that there is a delay before PPI data stream starts.
startRecording(String identifier, {required String exerciseId, required RecordingInterval interval, required SampleType sampleType}) Future<void>
Request start recording. Supported only by Polar H10. Requires polarFileTransfer feature.
stopRecording(String identifier) Future<void>
Request stop for current recording. Supported only by Polar H10. Requires polarFileTransfer feature.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited