fromMap static method
Creates an IOSGoogleCastSessions instance from a Map (e.g., JSON).
Returns null
if the input json
is null
.
Throws if required fields are missing or of incorrect type.
Implementation
static IOSGoogleCastSessions? fromMap(Map<String, dynamic>? json) {
if (json == null) return null;
return IOSGoogleCastSessions(
device: GoogleCastIosDevice.fromMap(
Map<String, dynamic>.from(json['device'])),
sessionID: json['sessionID'],
connectionState: GoogleCastConnectState.values[json['connectionState']],
currentDeviceMuted: json['currentDeviceMuted'],
currentDeviceVolume: json['currentDeviceVolume'],
deviceStatusText: json['deviceStatusText'] ?? '',
);
}