audioDevicesToJson function

String audioDevicesToJson(
  1. List<AudioDevices> data
)

Converts a list of AudioDevices to a JSON string.

Takes a list of AudioDevices objects data and converts it to a JSON string.

Example usage:

List<AudioDevices> audioDevicesList = [AudioDevices(id: "1", type: "speaker", name: "Speaker 1")];
String jsonString = audioDevicesToJson(audioDevicesList);

Implementation

String audioDevicesToJson(List<AudioDevices> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));