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 AppleHealthDoseEventOne 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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
uuid | String | required named | |
medicationIdentifier | String | required named | |
medicationDisplayText | String | required named | |
startDate | DateTime | required named | |
status | AppleHealthDoseStatus | required named | |
doseQuantity | num? | named | |
unit | String? | named |
Properties
AppleHealthDoseEvent.uuid
final String uuidThe HealthKit sample UUID; the source identity.
AppleHealthDoseEvent.medicationIdentifier
final String medicationIdentifierThe concept identifier of the medication taken.
AppleHealthDoseEvent.medicationDisplayText
final String medicationDisplayTextThe medication name HealthKit shows.
AppleHealthDoseEvent.startDate
final DateTime startDateWhen the dose happened.
AppleHealthDoseEvent.status
final AppleHealthDoseStatus statusHow the dose was logged.
AppleHealthDoseEvent.doseQuantity
final num? doseQuantityThe amount taken, when HealthKit has one.
AppleHealthDoseEvent.unit
final String? unitThe unit of doseQuantity.
AppleHealthDoseEventBatch
class AppleHealthDoseEventBatchDose 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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
events | List<AppleHealthDoseEvent> | required named | |
deletedEventUuids | List<String> | required named | |
nextAnchor | String? | named |
Properties
AppleHealthDoseEventBatch.events
final List<AppleHealthDoseEvent> eventsNew or changed dose events.
AppleHealthDoseEventBatch.deletedEventUuids
final List<String> deletedEventUuidsUUIDs HealthKit reports as deleted.
AppleHealthDoseEventBatch.nextAnchor
final String? nextAnchorAn opaque cursor for the next read.
AppleHealthDoseStatus
enum AppleHealthDoseStatusHow HealthKit logged a medication dose.
Values
AppleHealthDoseStatus.taken
static const AppleHealthDoseStatus takenThe person took the dose.
AppleHealthDoseStatus.skipped
static const AppleHealthDoseStatus skippedThe person skipped the dose.
AppleHealthDoseStatus.notLogged
static const AppleHealthDoseStatus notLoggedAn earlier log was cleared; the imported event is retracted.
AppleHealthDoseStatus.other
static const AppleHealthDoseStatus otherA reminder state with no log; ignored.
AppleHealthMedication
class AppleHealthMedicationOne 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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
identifier | String | required named | |
displayText | String | required named | |
nickname | String? | named | |
isArchived | bool | named | false |
relatedCodings | List<Map<String, dynamic>> | named | const [] |
Properties
AppleHealthMedication.identifier
final String identifierThe HealthKit medication concept identifier; the source identity.
AppleHealthMedication.displayText
final String displayTextThe name HealthKit shows.
AppleHealthMedication.nickname
final String? nicknameThe name the person gave it.
AppleHealthMedication.isArchived
final bool isArchivedWhether the person archived the medication.
AppleHealthMedication.relatedCodings
final List<Map<String, dynamic>> relatedCodingsCodings such as RxNorm that HealthKit relates to the concept.
AppleHealthMedicationSource
abstract interface class AppleHealthMedicationSourceReads 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.
| Parameter | Type | Kind | Default |
|---|---|---|---|
anchor | String? | named |
Returns Future<AppleHealthDoseEventBatch>.
AppleHealthMedicationUnsupportedReason
enum AppleHealthMedicationUnsupportedReasonWhy an Apple Health medication import cannot run on this device.
Values
AppleHealthMedicationUnsupportedReason.iosOnly
static const AppleHealthMedicationUnsupportedReason iosOnlyThe device is not running iOS.
AppleHealthMedicationUnsupportedReason.requiresIos26
static const AppleHealthMedicationUnsupportedReason requiresIos26HealthKit medications need iOS 26 or later.
Last updated on