initialize method

  1. @override
  2. @mustCallSuper
Future<void> initialize(
  1. DataEndPoint dataEndPoint,
  2. SmartphoneDeployment deployment,
  3. Stream<Measurement> measurements
)
override

Initialize the data manager by specifying the study deployment, the dataEndPoint, and the stream of measurements events to handle.

Implementation

@override
@mustCallSuper
Future<void> initialize(
  DataEndPoint dataEndPoint,
  SmartphoneDeployment deployment,
  Stream<Measurement> measurements,
) async {
  info('Initializing $runtimeType...');
  _deployment = deployment;
  _dataEndPoint = dataEndPoint;
  _subscription = measurements.listen(
    (measurement) => onMeasurement(measurement),
    onError: onError,
    onDone: onDone,
  );
  addEvent(DataManagerEvent(DataManagerEventTypes.initialized));
}