cameraMoving function

Future cameraMoving(
  1. GoogleMapController mapController,
  2. Position? position, {
  3. double zoomFactor = 16.0,
})

Camera moving action to animate map's camera to the marker

It's also controlling map's zoom with zoomFactor parameter

  • zoomFactor has default value 16.0

Implementation

Future cameraMoving(
  GoogleMapController mapController,
  Position? position, {
  double zoomFactor = 16.0,
}) =>
    mapController.animateCamera(
      CameraUpdate.newCameraPosition(
        CameraPosition(
          zoom: zoomFactor,
          target: LatLng(position!.latitude, position.longitude),
        ),
      ),
    );