Health sync configuration

Generated reference for ovok_flutter: health sync configuration.

  • Stable unknown
  • Release candidate since 0.1.0-rc.6
  • Development since 0.1.0-dev.32+1028d01

HealthSyncConfiguration

class HealthSyncConfiguration<TType>

Immutable configuration shared by Apple Health and Health Connect sync.

Constructors

HealthSyncConfiguration.new

HealthSyncConfiguration<TType>({
  required Map<HealthSyncKey, HealthSyncTypeConfiguration<TType>> dataToSync,
  int chunkSize = defaultHealthSyncChunkSize,
  bool wifiOnly = false,
  void Function(Object?)? onError,
  void Function(Map<HealthSyncKey, SyncProgress>)? onProgress,
})

Creates a health sync configuration.

ParameterTypeKindDefault
dataToSyncMap<String, HealthSyncTypeConfiguration<TType>>required named
chunkSizeintnameddefaultHealthSyncChunkSize
wifiOnlyboolnamedfalse
onErrorvoid Function(Object?)?named
onProgressvoid Function(Map<String, SyncProgress>)?named

Properties

HealthSyncConfiguration.dataToSync

final Map<String, HealthSyncTypeConfiguration<TType>> dataToSync

Data types and source identifiers to import.

HealthSyncConfiguration.chunkSize

final int chunkSize

Maximum number of records in one provider read.

HealthSyncConfiguration.wifiOnly

final bool wifiOnly

Whether reads wait for Wi-Fi instead of using cellular data.

HealthSyncConfiguration.onError

final void Function(Object?)? onError

Receives a provider or save failure.

HealthSyncConfiguration.onProgress

final void Function(Map<String, SyncProgress>)? onProgress

Receives progress snapshots keyed by health sync key.

HealthSyncTypeConfiguration

class HealthSyncTypeConfiguration<TType>

Sync settings for one health key.

Constructors

HealthSyncTypeConfiguration.new

HealthSyncTypeConfiguration<TType>({
  required Iterable<HealthSyncTypeIdentifier<TType>> typeIdentifiers,
  DateTime? minDate,
  HealthDataMode? mode,
})

Creates an immutable mapping for one health key.

ParameterTypeKindDefault
typeIdentifiersIterable<HealthSyncTypeIdentifier<TType>>required named
minDateDateTime?named
modeHealthDataMode?named

Properties

HealthSyncTypeConfiguration.typeIdentifiers

final List<HealthSyncTypeIdentifier<TType>> typeIdentifiers

Health-source identifiers included for this key.

HealthSyncTypeConfiguration.minDate

final DateTime? minDate

Earliest record date to read.

HealthSyncTypeConfiguration.mode

final HealthDataMode? mode

Overrides the default aggregation mode for this key.

HealthSyncTypeIdentifier

class HealthSyncTypeIdentifier<TType>

A platform type identifier and its optional Ovok observation coding.

Constructors

HealthSyncTypeIdentifier.new

HealthSyncTypeIdentifier<TType>({
  required TType typeIdentifier,
  String? code,
  String? system,
  String? display,
})

Creates a health-source identifier with optional observation coding.

ParameterTypeKindDefault
typeIdentifierTTyperequired named
codeString?named
systemString?named
displayString?named

Properties

HealthSyncTypeIdentifier.typeIdentifier

final TType typeIdentifier

Identifier understood by the configured health source.

HealthSyncTypeIdentifier.code

final String? code

Observation code; defaults to the SDK's reviewed mapping.

HealthSyncTypeIdentifier.system

final String? system

Coding system for code.

HealthSyncTypeIdentifier.display

final String? display

Human-readable display for code.

defaultHealthSyncChunkSize

int get defaultHealthSyncChunkSize

Last updated on

On this page