getAddress method

Future<Position> getAddress(
  1. Prediction p,
  2. BuildContext context
)

Implementation

Future<Position> getAddress(Prediction p, BuildContext context) {
  return service
      .geocode(p.placeId!)
      .asStream()
      .map((event) => Position(
          latLng: event,
          formattedAddress: p.structuredFormatting?.mainText ?? ""))
      .first;
}