init method

Future<void> init()

Implementation

Future<void> init() async {
  final session = await AudioSession.instance;
  session.devicesChangedEventStream.listen((event) async {
    final addedDevices = event.devicesAdded;
    print('addedDevices = $addedDevices');
    final removedDevices = event.devicesRemoved;
    print('removedDevices = $removedDevices');
    await _getInput();
    CallManager().notifyAudioRouteChanged();
  });
  session.devicesStream.listen((event) async {
    print('devicesStream = $event');
    await _getInput();
    CallManager().notifyAudioRouteChanged();
  });

  await _getInput();
  CallManager().notifyAudioRouteChanged();
}