SmartphoneStudy class

A study that this phone takes part in, as seen by the SmartPhoneClientManager.

Identifies the study deployment and the device role this phone plays in it. The client manager creates one when you add a study (from a protocol or an invitation), then gets its SmartphoneDeployment and runs it.

Key points:

See also SmartphoneStudyController, which controls a running study.

Inheritance

Constructors

SmartphoneStudy({String? studyId, required String studyDeploymentId, required String deviceRoleName, String? participantId, String? participantRoleName, DateTime? createdOn, StudyDeploymentStatus? deploymentStatus, SmartphoneDeployment? deployment})
Creates a SmartphoneStudy.
SmartphoneStudy.fromInvitation(ActiveParticipationInvitation invitation)
Creates a SmartphoneStudy from an invitation to a study.
SmartphoneStudy.fromMap(Map<String, Object?> map)
Creates a SmartphoneStudy from a database row saved by the PersistenceService.
factory

Properties

createdOn → DateTime
The date and time when this study was created and added to the ClientManager.
no setterinherited
deployment → SmartphoneDeployment?
The deployment for this study; null until received from the deployment service.
no setterinherited
deploymentStatus → StudyDeploymentStatus?
The deployment status of this study; null until received from the deployment service.
no setterinherited
deviceRoleName → String
The role name of the primary device in the deployment this study runtime participates in.
no setterinherited
events → Stream<SmartphoneStudyStatusEvent>
Stream of study status events.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
isDeployed → bool
Whether the deployment is available.
no setter
isSampling → bool
Whether the study is sampling data, i.e. its samplingState is resumed.
no setter
participantId ↔ String?
The ID of the participant in this study, if known.
getter/setter pairinherited
participantRoleName ↔ String?
The role of the participant in this study, if known.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samplingState ↔ SmartphoneDeploymentExecutorSamplingState?
The sampling state of this study, or null if not yet sampled.
getter/setter pair
status → StudyStatus
The status of this study, derived from deploymentStatus.
no setterinherited
studyDeploymentId → String
The ID of the deployed study for which to collect data.
no setterinherited
studyId ↔ String?
The unique id of the study in the deployment service, if known.
getter/setter pairinherited

Methods

createEvent(StudyStatusEvent<Study<PrimaryDeviceDeployment>> event) → void
Emits event on the events stream.
inherited
deploymentError([String? message]) → void
The deployment is in an error state. Print the optional message and emit a deployment error event.
inherited
deploymentStatusReceived([StudyDeploymentStatus? deploymentStatus]) → void
An updated deploymentStatus has been received.
inherited
deploymentUpdated([String? message]) → void
Mark the deployment as updated. Print the optional message and emit a deployment update event. If deployment is null, nothing happens.
inherited
deviceDeploymentReceived([PrimaryDeviceDeployment? deployment]) → void
Also takes the plain PrimaryDeviceDeployment that a deployment service like CAWS returns, and converts it to a SmartphoneDeployment.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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