moveToCurrentLocation method

void moveToCurrentLocation()

The moveToCurrentLocation function moves the camera to the current location of the user. It uses the determinePosition function from the location.dart file. {@category Functions}

Implementation

void moveToCurrentLocation() async {
  BuildContext context = this.context;
  var userPosition = await determinePosition(context);

  mapController.animateCamera(
    CameraUpdate.newCameraPosition(
      CameraPosition(
        target: LatLng(userPosition.latitude, userPosition.longitude),
        zoom: 12,
      ),
    ),
  );
}