initState method

  1. @override
void initState()
override

Implementation

@override
void initState() {
  _recorder = FlutterSoundRecorder();
  _recorder!
      .openAudioSession(
          focus: AudioFocus.requestFocusAndDuckOthers,
          category: SessionCategory.playAndRecord,
          mode: SessionMode.modeDefault,
          device: AudioDevice.speaker,
          audioFlags: outputToSpeaker | allowBlueToothA2DP | allowAirPlay)
      .then((toto) {
    registerRecorder(context, this);
  });
  super.initState();
}