onStart method

  1. @override
Future<bool> onStart()
override

Callback when this executor is started. Returns true if successfully started, false otherwise.

Implementation

@override
Future<bool> onStart() async {
  _subscription ??= SmartPhoneClientManager()
      .lookupStudyRuntime(deployment!.studyDeploymentId,
          deployment!.deviceConfiguration.roleName)
      ?.measurementsByType(configuration!.measureType)
      .listen((measurement) {
    if (configuration!.triggerCondition != null &&
        configuration!.triggerCondition!(measurement)) onTrigger();
  });
  return true;
}