onStart method

  1. @override
Future<bool> onStart()
override

Callback when this executor is started. Returns true if successfully started, false otherwise.

Implementation

@override
Future<bool> onStart() async {
  if (await requestPermissions()) {
    try {
      await _startAudioRecording();
      debug('Audio recording started - sound file : $_soundFileName');
    } catch (error) {
      warning('An error occurred trying to start audio recording - $error');
      addError(error);
      return false;
    }
    return true;
  } else {
    return false;
  }
}