Untitled

mail@pastecode.io avatar
unknown
dart
2 years ago
799 B
1
Indexable
Never
 Future<void> getAddress(bool twoPoints) async {
    if (!twoPoints) {
      await reverseGeocodingSearch(
              address.LatLon(_originLatitude, _originLongitude))
          .then((value) {
        setState(() {
          startAddress = value[0].formattedAddress;
          destinationAddress = "";
        });
      });
    } else {
      await reverseGeocodingSearch(
              address.LatLon(_originLatitude, _originLongitude))
          .then((value) {
        setState(() {
          startAddress = value[0].formattedAddress;
        });
      });
      await reverseGeocodingSearch(
              address.LatLon(_destLatitude, _destLongitude))
          .then((value) {
        setState(() {
          destinationAddress = value[0].formattedAddress;
        });
      });
    }
  }