zyzdev / flutter_street_view

10 stars 34 forks source link

New feature request: attribute to display info when no street view is available #30

Open davoutuk opened 1 year ago

davoutuk commented 1 year ago

Business problem: Not all LatLng locations can be translated into a street view. Currently, if a LatLng has no street view then the widget returns a blank black image. In this case, the user does not know why the the black screen is being displayed (e.g. software bug or something wrong with Google or no street view available)

New feature proposal: Add a new attribute to the Street view widget that allow the developer to set a presentation value that would be displayed if no street view were available for a given LatLng. This could either be:

For option 'a' this could be a string value like...

noViewAvailable: 'No view available for this location' For option (b) this could be

noViewAvailable: Row(children: [Icon(Icons.block), Text('No view available for this location)]);

zyzdev commented 1 year ago

The onPanoramaChangeListener will receive exception when the location is no valid panorama. See example Street View Panorama events for usage.

FlutterGoogleStreetView(
...

onPanoramaChangeListener: (location, exception) {
    ...
},

...
)

https://github.com/zyzdev/flutter_street_view/assets/16483162/0103024e-51fb-48c7-88cf-961c24d22cae