Skip to content

HealthService

A connected device that represents the health database on the phone: Apple Health on iOS and Google Health Connect on Android.

Add it to a protocol with StudyProtocol.addConnectedDevice and use it as the target device of tasks with HealthSamplingPackage.HEALTH measures. At runtime it is handled by a HealthServiceManager, which uses the health plugin.

On Android, this health package always uses Google Health Connect.

Inheritance
Annotations

Constructors

HealthService.fromJson

HealthService.fromJson(
  1. Map<String, dynamic> json
)

HealthService

HealthService({
  1. String roleName = HealthService.DEFAULT_ROLE_NAME,
})

Create a new HealthService with a default role name, if not specified.

Constants

DEFAULT_ROLE_NAME

String const DEFAULT_ROLE_NAME

The default role name for a health service.

DEVICE_TYPE

String const DEVICE_TYPE

The type of the health service.

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.