decode static method Null safety

LocationComponentSettings decode(
  1. Object message
)

Implementation

static LocationComponentSettings decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return LocationComponentSettings(
    enabled: pigeonMap['enabled'] as bool?,
    pulsingEnabled: pigeonMap['pulsingEnabled'] as bool?,
    pulsingColor: pigeonMap['pulsingColor'] as int?,
    pulsingMaxRadius: pigeonMap['pulsingMaxRadius'] as double?,
    showAccuracyRing: pigeonMap['showAccuracyRing'] as bool?,
    accuracyRingColor: pigeonMap['accuracyRingColor'] as int?,
    accuracyRingBorderColor: pigeonMap['accuracyRingBorderColor'] as int?,
    layerAbove: pigeonMap['layerAbove'] as String?,
    layerBelow: pigeonMap['layerBelow'] as String?,
    puckBearingEnabled: pigeonMap['puckBearingEnabled'] as bool?,
    puckBearingSource: pigeonMap['puckBearingSource'] != null
        ? PuckBearingSource.values[pigeonMap['puckBearingSource']! as int]
        : null,
    locationPuck: pigeonMap['locationPuck'] != null
        ? LocationPuck.decode(pigeonMap['locationPuck']!)
        : null,
  );
}