decode method Null safety

CastDevice decode(
  1. Object message
)

Implementation

static CastDevice decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return CastDevice(
    deviceId: pigeonMap['deviceId'] as String?,
    friendlyName: pigeonMap['friendlyName'] as String?,
    modelName: pigeonMap['modelName'] as String?,
  );
}