findLocation method

Future<LatLng?> findLocation(
  1. String address
)

Implementation

Future<LatLng?> findLocation(String address) async {
  log('MapStates findLocation $address');

  GeoCode geoCode = GeoCode();

  try {
    Coordinates coordinates = await geoCode.forwardGeocoding(
      address: address,
    );
    return LatLng(coordinates.latitude, coordinates.longitude);
  } catch (e) {
    log(e);
  }

  return null;
}