decode method Null safety

MediaMetadata decode(
  1. Object message
)

Implementation

static MediaMetadata decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return MediaMetadata(
    mediaType: pigeonMap['mediaType'] != null
        ? MediaType.values[pigeonMap['mediaType']! as int]
        : null,
    strings: (pigeonMap['strings'] as Map<Object?, Object?>?)?.cast<String?, String?>(),
    webImages: (pigeonMap['webImages'] as List<Object?>?)?.cast<WebImage?>(),
  );
}