toJson method

Map<String, dynamic> toJson()

Converts this config to the JSON-compatible map expected by native iOS.

Implementation

Map<String, dynamic> toJson() {
  return {
    'default': defaultRoute.toJson(),
    'byOutputPort': {
      if (carAudio != null) 'carAudio': carAudio!.toJson(),
      if (builtInReceiver != null)
        'builtInReceiver': builtInReceiver!.toJson(),
      if (builtInSpeaker != null) 'builtInSpeaker': builtInSpeaker!.toJson(),
      if (bluetoothA2DP != null) 'bluetoothA2DP': bluetoothA2DP!.toJson(),
      if (bluetoothHFP != null) 'bluetoothHFP': bluetoothHFP!.toJson(),
      if (headphones != null) 'headphones': headphones!.toJson(),
    },
  };
}