audioDevicesFromJson function
Converts a JSON string to a list of AudioDevices.
Takes a JSON string str
and maps it to a list of AudioDevices objects.
Example usage:
String jsonString = '[{"id":"1", "type":"speaker", "name":"Speaker 1"}]';
List<AudioDevices> audioDevicesList = audioDevicesFromJson(jsonString);
Implementation
List<AudioDevices> audioDevicesFromJson(String str) => List<AudioDevices>.from(
json.decode(str).map((x) => AudioDevices.fromJson(x)));