routeSharingPolicy property

(UNTESTED)

Implementation

Future<AVAudioSessionRouteSharingPolicy?> get routeSharingPolicy async {
  // TODO: Use this code without the '?' once a Dart bug is fixed.
  // (similar instances occur elsewhere)
  //final index = await _channel.invokeMethod<int>('getRouteSharingPolicy');
  final index = await _channel.invokeMethod<int?>('getRouteSharingPolicy');
  return index == null
      ? null
      : decodeEnum(AVAudioSessionRouteSharingPolicy.values, index,
          defaultValue: AVAudioSessionRouteSharingPolicy.defaultPolicy);
}