recordingEnabled method

void recordingEnabled(
  1. bool enabled
)

Mirroring the code that controls the playback UI, this allows the recorder to be disabled during playback

Implementation

void recordingEnabled(bool enabled) {
  // take no action if recording is currently ongoing or paused.
  assert(_recorder!.isRecording != true && _recorder!.isPaused != true);
  setState(() {
    if (enabled) {
      _recordingState = _RecorderState.isStopped;
    } else {
      _recordingState = _RecorderState.isDisabled;
    }
  });
}