decode static method Null safety

MapOptions decode(
  1. Object message
)

Implementation

static MapOptions decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return MapOptions(
    contextMode: pigeonMap['contextMode'] != null
        ? ContextMode.values[pigeonMap['contextMode']! as int]
        : null,
    constrainMode: pigeonMap['constrainMode'] != null
        ? ConstrainMode.values[pigeonMap['constrainMode']! as int]
        : null,
    viewportMode: pigeonMap['viewportMode'] != null
        ? ViewportMode.values[pigeonMap['viewportMode']! as int]
        : null,
    orientation: pigeonMap['orientation'] != null
        ? NorthOrientation.values[pigeonMap['orientation']! as int]
        : null,
    crossSourceCollisions: pigeonMap['crossSourceCollisions'] as bool?,
    optimizeForTerrain: pigeonMap['optimizeForTerrain'] as bool?,
    size: pigeonMap['size'] != null ? Size.decode(pigeonMap['size']!) : null,
    pixelRatio: pigeonMap['pixelRatio']! as double,
    glyphsRasterizationOptions:
        pigeonMap['glyphsRasterizationOptions'] != null
            ? GlyphsRasterizationOptions.decode(
                pigeonMap['glyphsRasterizationOptions']!)
            : null,
  );
}