SmartphoneStudyProtocol class Null safety

A description of how a study is to be executed on a smartphone.

A SmartphoneStudyProtocol defining the master device (MasterDeviceDescriptor) responsible for aggregating data (typically this phone), the optional devices (DeviceDescriptor) connected to the master device, and the Trigger's which lead to data collection on said devices.



SmartphoneStudyProtocol({required String ownerId, required String name, StudyDescription? protocolDescription, SamplingSchemaType samplingStrategy = SamplingSchemaType.normal, DataEndPoint? dataEndPoint})
Create a new SmartphoneStudyProtocol.
SmartphoneStudyProtocol.fromJson(Map<String, dynamic> json)


connectedDevices List<DeviceDescriptor>
The devices this device needs to connect to.
read / write, inherited
connections List<DeviceConnection>
read / write, inherited
creationDate DateTime
The timestamp of the creation of this protocol in Zulu time.
read / write, inherited
dataEndPoint DataEndPoint?
Specifies where and how to stored or upload the data collected from this deployment. If null, the sensed data is not stored, but may still be used in the app.
read / write
description String
The description for the study protocol.
read / write, inherited-setter, override-getter
expectedParticipantData List<Map<String, dynamic>>?
read / write, inherited
hashCode int
The hash code for this object.
read-only, inherited
masterDevice MasterDeviceDescriptor
The first of all the masterDevices. This is a convinient method used when there is only one master device, which is most of the cases in Flutter where the master device is typically the phone.
read-only, inherited
masterDevices List<MasterDeviceDescriptor>
The master devices involved in this protocol.
read / write, inherited
name String
A unique descriptive name for the protocol.
read / write, inherited
ownerId String
The owner id of this study protocol.
read / write, inherited
protocolDescription StudyDescription?
The description of this study protocol containing the title, description, purpose, and the responsible researcher for this study.
read / write
responsible StudyResponsible?
The PI responsible for this protocol.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
samplingStrategy SamplingSchemaType
The sampling strategy used in this study based on the standard SamplingSchemaType types.
read / write
tasks Set<TaskDescriptor>
The set of tasks which can be triggered as part of this protocol.
read / write, inherited
triggeredTasks List<TriggeredTask>
The tasks (and the devices they are triggered to) for the specified trigger.
read / write, inherited
triggers Map<String, Trigger>
The set of Triggers which can trigger TaskDescriptors in this study protocol.
read / write, inherited


addConnectedDevice(DeviceDescriptor device) → void
Add a device which is connected to this masterDevice. Its role name should be unique in the protocol.
addMasterDevice(MasterDeviceDescriptor masterDevice) → void
Add a masterDevice which is responsible for aggregating and synchronizing incoming data. Its role name should be unique in the protocol.
addTask(TaskDescriptor task) → void
Add the task to this protocol.
addTrigger(Trigger trigger) → void
Add the trigger to this protocol.
addTriggeredTask(Trigger trigger, TaskDescriptor task, DeviceDescriptor targetDevice) → void
Add a task to be sent to a targetDevice once a trigger within this protocol is initiated.
addTriggeredTasks(Trigger trigger, List<TaskDescriptor> tasks, DeviceDescriptor targetDevice) → void
Add a set of tasks to be sent to a targetDevice once a trigger within this protocol is initiated. In case the trigger or tasks are not yet included in this study protocol, they will be added. The targetDevice needs to be added prior to this call since it needs to be set up as either a master device or connected device.
getTasksForDevice(DeviceDescriptor device) Set<TaskDescriptor?>
Gets all the tasks triggered for the specified device. The device must be part of either masterDevices or connectedDevices.
getTasksForDeviceRoleName(String? deviceRoleName) Set<TaskDescriptor>
Gets all the tasks triggered for the specified deviceRoleName.
getTriggeredTasks(Trigger trigger) Set<TriggeredTask>
Gets all the tasks (and the devices they are triggered to) for the specified trigger.
hasMasterDevice(String rolename) bool
Does this protocol have a master device with role name rolename?
indexOfTrigger(Trigger trigger) int
Returns the index of the trigger in the triggers. Returns -1 if not found.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
removeTask(TaskDescriptor task) → void
Remove the task currently present in this configuration including removing it from any Trigger's which initiate it.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.


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