Apple health medication source

Generated reference for ovok_flutter: apple health medication source.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.51+80996d9

AppleHealthDoseEvent

class AppleHealthDoseEvent

One logged dose from HealthKit.

Constructors

AppleHealthDoseEvent.new

AppleHealthDoseEvent({
  required String uuid,
  required String medicationIdentifier,
  required String medicationDisplayText,
  required DateTime startDate,
  required AppleHealthDoseStatus status,
  num? doseQuantity,
  String? unit,
})

Creates a dose event read from HealthKit.

ParameterTypeKindDefault
uuidStringrequired named
medicationIdentifierStringrequired named
medicationDisplayTextStringrequired named
startDateDateTimerequired named
statusAppleHealthDoseStatusrequired named
doseQuantitynum?named
unitString?named

Properties

AppleHealthDoseEvent.uuid

final String uuid

The HealthKit sample UUID; the source identity.

AppleHealthDoseEvent.medicationIdentifier

final String medicationIdentifier

The concept identifier of the medication taken.

AppleHealthDoseEvent.medicationDisplayText

final String medicationDisplayText

The medication name HealthKit shows.

AppleHealthDoseEvent.startDate

final DateTime startDate

When the dose happened.

AppleHealthDoseEvent.status

final AppleHealthDoseStatus status

How the dose was logged.

AppleHealthDoseEvent.doseQuantity

final num? doseQuantity

The amount taken, when HealthKit has one.

AppleHealthDoseEvent.unit

final String? unit

The unit of doseQuantity.

AppleHealthDoseEventBatch

class AppleHealthDoseEventBatch

Dose events changed since an anchor.

Constructors

AppleHealthDoseEventBatch.new

AppleHealthDoseEventBatch({
  required List<AppleHealthDoseEvent> events,
  required List<String> deletedEventUuids,
  String? nextAnchor,
})

Creates a batch; nextAnchor is the cursor to read from next time.

ParameterTypeKindDefault
eventsList<AppleHealthDoseEvent>required named
deletedEventUuidsList<String>required named
nextAnchorString?named

Properties

AppleHealthDoseEventBatch.events

final List<AppleHealthDoseEvent> events

New or changed dose events.

AppleHealthDoseEventBatch.deletedEventUuids

final List<String> deletedEventUuids

UUIDs HealthKit reports as deleted.

AppleHealthDoseEventBatch.nextAnchor

final String? nextAnchor

An opaque cursor for the next read.

AppleHealthDoseStatus

enum AppleHealthDoseStatus

How HealthKit logged a medication dose.

Values

AppleHealthDoseStatus.taken

static const AppleHealthDoseStatus taken

The person took the dose.

AppleHealthDoseStatus.skipped

static const AppleHealthDoseStatus skipped

The person skipped the dose.

AppleHealthDoseStatus.notLogged

static const AppleHealthDoseStatus notLogged

An earlier log was cleared; the imported event is retracted.

AppleHealthDoseStatus.other

static const AppleHealthDoseStatus other

A reminder state with no log; ignored.

AppleHealthMedication

class AppleHealthMedication

One medication in the person's Apple Health list.

Constructors

AppleHealthMedication.new

AppleHealthMedication({
  required String identifier,
  required String displayText,
  String? nickname,
  bool isArchived = false,
  List<Map<String, dynamic>> relatedCodings = const [],
})

Creates a medication read from HealthKit.

ParameterTypeKindDefault
identifierStringrequired named
displayTextStringrequired named
nicknameString?named
isArchivedboolnamedfalse
relatedCodingsList<Map<String, dynamic>>namedconst []

Properties

AppleHealthMedication.identifier

final String identifier

The HealthKit medication concept identifier; the source identity.

AppleHealthMedication.displayText

final String displayText

The name HealthKit shows.

AppleHealthMedication.nickname

final String? nickname

The name the person gave it.

AppleHealthMedication.isArchived

final bool isArchived

Whether the person archived the medication.

AppleHealthMedication.relatedCodings

final List<Map<String, dynamic>> relatedCodings

Codings such as RxNorm that HealthKit relates to the concept.

AppleHealthMedicationSource

abstract interface class AppleHealthMedicationSource

Reads medications from HealthKit.

The iOS 26 bridge that implements this is not in the SDK yet; the health plugin has no medication API.

Methods

AppleHealthMedicationSource.unsupportedReason

Future<AppleHealthMedicationUnsupportedReason?> unsupportedReason()

Null when medications can be read here.

Returns Future<AppleHealthMedicationUnsupportedReason?>.

AppleHealthMedicationSource.requestAuthorization

Future<void> requestAuthorization()

Asks the person to share their medications.

Returns Future<void>.

AppleHealthMedicationSource.medications

Future<List<AppleHealthMedication>> medications()

Reads the person's medication list.

Returns Future<List<AppleHealthMedication>>.

AppleHealthMedicationSource.doseEvents

Future<AppleHealthDoseEventBatch> doseEvents({String? anchor})

Reads dose events changed since anchor; null reads them all.

ParameterTypeKindDefault
anchorString?named

Returns Future<AppleHealthDoseEventBatch>.

AppleHealthMedicationUnsupportedReason

enum AppleHealthMedicationUnsupportedReason

Why an Apple Health medication import cannot run on this device.

Values

AppleHealthMedicationUnsupportedReason.iosOnly

static const AppleHealthMedicationUnsupportedReason iosOnly

The device is not running iOS.

AppleHealthMedicationUnsupportedReason.requiresIos26

static const AppleHealthMedicationUnsupportedReason requiresIos26

HealthKit medications need iOS 26 or later.

Last updated on

On this page