$new static method

$Value? $new(
  1. Runtime runtime,
  2. $Value? thisValue,
  3. List<$Value?> args
)

Wrapper for the MapOptions.new constructor

Implementation

static $Value? $new(Runtime runtime, $Value? thisValue, List<$Value?> args) {
  return $MapOptions.wrap(
    MapOptions(
      crs: args[0]?.$value ?? const Epsg3857(),
      initialCenter: args[1]?.$value ?? const LatLng(50.5, 30.51),
      initialZoom: args[2]?.$value ?? 13.0,
      initialRotation: args[3]?.$value ?? 0.0,
      initialCameraFit: args[4]?.$value,
      cameraConstraint:
          args[5]?.$value ?? const CameraConstraint.unconstrained(),
      interactionOptions: args[6]?.$value ?? const InteractionOptions(),
      minZoom: args[7]?.$value,
      maxZoom: args[8]?.$value,
      backgroundColor: args[9]?.$value ?? const Color(0xFFE0E0E0),
      onTap: (TapPosition tapPosition, LatLng point) {
        (args[10]! as EvalCallable?)?.call(runtime, null, [
          $TapPosition.wrap(tapPosition),
          runtime.wrapAlways(point),
        ]);
      },
      onSecondaryTap: (TapPosition tapPosition, LatLng point) {
        (args[11]! as EvalCallable?)?.call(runtime, null, [
          $TapPosition.wrap(tapPosition),
          runtime.wrapAlways(point),
        ]);
      },
      onLongPress: (TapPosition tapPosition, LatLng point) {
        (args[12]! as EvalCallable?)?.call(runtime, null, [
          $TapPosition.wrap(tapPosition),
          runtime.wrapAlways(point),
        ]);
      },
      onPointerDown: (PointerDownEvent event, LatLng point) {
        (args[13]! as EvalCallable?)?.call(runtime, null, [
          runtime.wrapAlways(event),
          runtime.wrapAlways(point),
        ]);
      },
      onPointerUp: (PointerUpEvent event, LatLng point) {
        (args[14]! as EvalCallable?)?.call(runtime, null, [
          runtime.wrapAlways(event),
          runtime.wrapAlways(point),
        ]);
      },
      onPointerCancel: (PointerCancelEvent event, LatLng point) {
        (args[15]! as EvalCallable?)?.call(runtime, null, [
          runtime.wrapAlways(event),
          runtime.wrapAlways(point),
        ]);
      },
      onPointerHover: (PointerHoverEvent event, LatLng point) {
        (args[16]! as EvalCallable?)?.call(runtime, null, [
          runtime.wrapAlways(event),
          runtime.wrapAlways(point),
        ]);
      },
      onPositionChanged: (MapCamera camera, bool hasGesture) {
        (args[17]! as EvalCallable?)?.call(runtime, null, [
          $MapCamera.wrap(camera),
          $bool(hasGesture),
        ]);
      },
      onMapEvent: (MapEvent arg0) {
        (args[18]! as EvalCallable?)?.call(runtime, null, [
          $MapEvent.wrap(arg0),
        ]);
      },
      onMapReady: () {
        (args[19]! as EvalCallable?)?.call(runtime, null, []);
      },
      keepAlive: args[20]?.$value ?? false,
    ),
  );
}