dispose method

Future<void> dispose()
inherited

Dispose the recorder

Implementation

Future<void> dispose() {
  return _safeCall(() async {
    _amplitudeTimer?.cancel();
    await _amplitudeStreamCtrl?.close();
    _amplitudeStreamCtrl = null;

    await _stateStreamSubscription?.cancel();
    await _stateStreamCtrl?.close();
    _stateStreamCtrl = null;

    await _stopRecordStream();

    await _platform.dispose(_recorderId);
  });
}