initialize method
Future<void>
initialize(
- DataEndPoint dataEndPoint,
- SmartphoneDeployment deployment,
- 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));
}