addStudy method

  1. @mustCallSuper
Future<Study> addStudy(
  1. Study study
)

Add a study which needs to be executed on this client. This involves registering this device for the specified study deployment.

A Study specifies:

  • studyDeploymentId - The ID of a study which has been deployed already and for which to collect data.
  • deviceRoleName - The role which the client device this runtime is intended for plays as part of the deployment identified by studyDeploymentId.

Returns the added study.

Implementation

@mustCallSuper
Future<Study> addStudy(Study study) async {
  assert(isConfigured,
      'The client manager has not been configured yet. Call configure() first.');
  assert(!repository.containsKey(study.studyDeploymentId),
      'A study with the same study deployment ID and device role name has already been added.');
  studies[study.studyDeploymentId] = study;

  return study;
}