SmartphoneDeployment.fromSmartphoneStudyProtocol constructor

SmartphoneDeployment.fromSmartphoneStudyProtocol({
  1. String? studyId,
  2. String? studyDeploymentId,
  3. required String primaryDeviceRoleName,
  4. required SmartphoneStudyProtocol protocol,
})

Create a SmartphoneDeployment based on a SmartphoneStudyProtocol. This method basically makes a 1:1 mapping from the protocol to the deployment using a Smartphone as the primary device with the specified primaryDeviceRoleName.

Implementation

SmartphoneDeployment.fromSmartphoneStudyProtocol({
  this.studyId,
  String? studyDeploymentId,
  required String primaryDeviceRoleName,
  required SmartphoneStudyProtocol protocol,
}) : super(
       deviceConfiguration: Smartphone(roleName: primaryDeviceRoleName),
       registration: DefaultDeviceRegistration(),
       connectedDevices: protocol.connectedDevices ?? {},
       connectedDeviceRegistrations: {},
       tasks: protocol.tasks,
       triggers: protocol.triggers,
       taskControls: protocol.taskControls,
       expectedParticipantData: protocol.expectedParticipantData ?? {},
     ) {
  _studyDeploymentId = studyDeploymentId ?? const Uuid().v1;
  _data.protocolVersionTag = protocol.protocolVersionTag;
  _data.protocolApiLevel = protocol.protocolApiLevel;
  _data.studyDescription = protocol.studyDescription;
  _data.dataEndPoint = protocol.dataEndPoint;
  _data.privacySchemaName = protocol.privacySchemaName;
  _data.applicationData = protocol._data.applicationData;
}