decode method Null safety

MediaTrack decode(
  1. Object message
)

Implementation

static MediaTrack decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return MediaTrack()
    ..id = pigeonMap['id'] as int?
    ..trackType = pigeonMap['trackType'] != null
        ? TrackType.values[pigeonMap['trackType']! as int]
        : null
    ..name = pigeonMap['name'] as String?
    ..trackSubtype = pigeonMap['trackSubtype'] != null
        ? TrackSubtype.values[pigeonMap['trackSubtype']! as int]
        : null
    ..contentId = pigeonMap['contentId'] as String?
    ..language = pigeonMap['language'] as String?;
}