!Important note!
There is a bug with com.google.android.gms:play-services-maps:19.0.0 that will cause your Android app to crash if requesting to view a location that does not have Street View support.
To workaround this bug, you can check first if the location has Street View support BEFORE trying to view it.
Something like this:
final apiKey = 'YOUR API KEY'; /// Make sure your project has Street View Static API enabled in cloud console: https://console.cloud.google.com/apis/library/street-view-image-backend.googleapis.com
final latitude = 32.0;
final longitude = 35.0;
final uri = Uri.https('maps.googleapis.com', 'maps/api/streetview/metadata', {
'key': apiKey,
'location': '$latitude,$longitude',
});
final response = await Dio().getUri(uri);
final success = response.data['status'] == 'OK';
if (success) {
/// Safe to show Street View in latitude & longitude above
} else {
/// Show some error message: 'Street View not available at this location'
}
Seems like this plugin is abandoned, so I forked it and enabled support for:
To use it, replace pubspec.yaml line
flutter_google_street_view: ^3.1.4
with!Important note! There is a bug with com.google.android.gms:play-services-maps:19.0.0 that will cause your Android app to crash if requesting to view a location that does not have Street View support. To workaround this bug, you can check first if the location has Street View support BEFORE trying to view it. Something like this: