updateLocalityDetailsOfUser function

Future<void>? updateLocalityDetailsOfUser(
  1. SpinachUser _user
)

Implementation

Future<void>? updateLocalityDetailsOfUser(SpinachUser _user) {
  placemarkFromCoordinates(
          _user.currentLocation!.latitude, _user.currentLocation!.longitude)
      .then((placeMarkLists) => {
            if (placeMarkLists != null &&
                placeMarkLists.length > 0 &&
                placeMarkLists[0] != null)
              {
                _user.country = placeMarkLists[0].isoCountryCode,
                _user.region = placeMarkLists[0].locality
              }
          });
}