Future<void> _getCurrentUserLocation () async { final locData = await Location().getLocation(); final double newLatitude = locData.latitude; final double newLongitude = locData.longitude; 1

Future _getCurrentUserLocation () async { final locData = await Location().getLocation(); final double newLatitude = locData.latitude; final double newLongitude = locData.longitude;

Future _getCurrentUserLocation () async {
  final locData = await Location().getLocation();
  final double newLatitude = locData.latitude;
  final double newLongitude = locData.longitude;

Here is what the above code is Doing:
1. We’re using the location package to get the current location of the user.
2. We’re storing the latitude and longitude of the user in two variables.
3. We’re setting the latitude and longitude of the user in the _currentLocation variable.

Similar Posts