decode static method Null safety

GesturesSettings decode(
  1. Object message
)

Implementation

static GesturesSettings decode(Object message) {
  final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
  return GesturesSettings(
    rotateEnabled: pigeonMap['rotateEnabled'] as bool?,
    pinchToZoomEnabled: pigeonMap['pinchToZoomEnabled'] as bool?,
    scrollEnabled: pigeonMap['scrollEnabled'] as bool?,
    simultaneousRotateAndPinchToZoomEnabled:
        pigeonMap['simultaneousRotateAndPinchToZoomEnabled'] as bool?,
    pitchEnabled: pigeonMap['pitchEnabled'] as bool?,
    scrollMode: pigeonMap['scrollMode'] != null
        ? ScrollMode.values[pigeonMap['scrollMode']! as int]
        : null,
    doubleTapToZoomInEnabled: pigeonMap['doubleTapToZoomInEnabled'] as bool?,
    doubleTouchToZoomOutEnabled:
        pigeonMap['doubleTouchToZoomOutEnabled'] as bool?,
    quickZoomEnabled: pigeonMap['quickZoomEnabled'] as bool?,
    focalPoint: pigeonMap['focalPoint'] != null
        ? ScreenCoordinate.decode(pigeonMap['focalPoint']!)
        : null,
    pinchToZoomDecelerationEnabled:
        pigeonMap['pinchToZoomDecelerationEnabled'] as bool?,
    rotateDecelerationEnabled:
        pigeonMap['rotateDecelerationEnabled'] as bool?,
    scrollDecelerationEnabled:
        pigeonMap['scrollDecelerationEnabled'] as bool?,
    increaseRotateThresholdWhenPinchingToZoom:
        pigeonMap['increaseRotateThresholdWhenPinchingToZoom'] as bool?,
    increasePinchToZoomThresholdWhenRotating:
        pigeonMap['increasePinchToZoomThresholdWhenRotating'] as bool?,
    zoomAnimationAmount: pigeonMap['zoomAnimationAmount'] as double?,
    pinchPanEnabled: pigeonMap['pinchPanEnabled'] as bool?,
  );
}