I am trying to get a list of addresses using postal codes.
This is a snippet of code:
import 'package:google_maps_webservice/places.dart';
final _places = GoogleMapsPlaces(apiKey: '<API-Key>');
void main() async {
// This is a valid British postal code.
final postalCode = 'WC2N 5DU';
final response = await _places.autocomplete(
postalCode,
components: [
Component(Component.postalCode, postalCode),
Component(Component.country, 'UK'),
],
);
if (response.isOkay) {
for (Prediction prediction in response.predictions) {
print(prediction.description);
}
} else {
print(response.status);
}
}
I am trying to get a list of addresses using postal codes.
This is a snippet of code:
I am getting an
INVALID_REQUEST
status.