removeStudy method
Remove the study with studyDeploymentId and deviceRoleName from this
client manager.
Note that by removing a study, the deployment is not marked as stopped permanently in the deployment service. Hence, the study can later be added and deployed again using the addStudy and tryDeployment methods.
If a study deployment is to be permanently stopped, use the stopStudy method.
Implementation
@override
@mustCallSuper
Future<void> removeStudy(
String studyDeploymentId,
String deviceRoleName,
) async {
var study = getStudy(studyDeploymentId, deviceRoleName);
// fast out if not a valid study
if (study == null) return;
info('$runtimeType - Removing study: $study');
AppTaskController().removeStudy(study);
var controller = _controllers[study];
if (controller != null) _group.remove(controller.measurements);
controller?.dispose();
_controllers.remove(study);
await super.removeStudy(studyDeploymentId, deviceRoleName);
notifyListeners();
}