onAmplitudeChanged method
Request for amplitude at given interval
.
Implementation
Stream<Amplitude> onAmplitudeChanged(Duration interval) {
_amplitudeStreamCtrl ??= StreamController(
onCancel: () {
_amplitudeTimer?.cancel();
_amplitudeStreamCtrl?.close();
_amplitudeStreamCtrl = null;
},
);
_amplitudeTimerInterval = interval;
_startAmplitudeTimer();
return _amplitudeStreamCtrl!.stream;
}