cancelRecord method

void cancelRecord()

Implementation

void cancelRecord() async {
  try {
    _myRecorder.stopRecorder();
  } catch (ignore) {
    //ignore
  }
  emit(RecordAudioReady());
  if (onRecordCancel != null) onRecordCancel!();
  currentDuration.value = Duration.zero;
}