GoogleCastSessionAndroid.fromMap constructor
Creates a GoogleCastSessionAndroid from a map, typically received from platform channels.
The map
parameter should contain keys for device, sessionID, connectionState, isMute, volume, and statusMessage.
Implementation
factory GoogleCastSessionAndroid.fromMap(Map<String, dynamic> map) {
final device = map['device'];
return GoogleCastSessionAndroid(
device: device != null
? GoogleCastAndroidDevice.fromMap(Map.from(map['device']))
: null,
sessionID: map['sessionID'],
connectionState: GoogleCastConnectState.values[map['connectionState']],
currentDeviceMuted: map['isMute'],
currentDeviceVolume: map['volume'],
deviceStatusText: map['statusMessage'] ?? '',
);
}