zyzdev / flutter_street_view

10 stars 29 forks source link

Error on location no available, throwed in web #21

Closed lautarozanuttini closed 1 year ago

lautarozanuttini commented 1 year ago

Hi zyzdev, great package by the way, I've an issue throwing on web platform of flutter and its when location its not available. I saw the page where you show how to fix it but nothing, its keep crashing, I will attached images of that error. Thanks. Screenshot 2022-10-19 171411 Screenshot 2022-10-19 171430

zyzdev commented 1 year ago

Hi @lautarozanuttini,

In my opinion, the problem is onPanoramaChangeListener didn't receive exception when feeding invalid initPos or initPanoId to FlutterGoogleStreetView. It's a bug. Version [3.1.2-dev.1] fix it and you can try it. example/street_view_panorama_events.dart may help you testing it.

Thanks.

lautarozanuttini commented 1 year ago

Hi zyzdev, first thanks a lot for your help, i am testing now but still the issue with version 3.1.2-dev.1 here is the error. Screenshot 2022-10-20 154648

zyzdev commented 1 year ago

Hi lautarozanuttini,

The exception was thrown by plugin google_maps, function Future<StreetViewResponse> getPanorama. Change return type of getPanorama to Future<StreetViewResponse?> can solve the exception.

flutter_google_street_view depend on google_maps to implement web platform.

For plugin flutter_google_street_view, this exception is meaning the location is no panorama available, and will throw exception at onPanoramaChangeListener to notice user the location is no panorama available.

The exception should report to google_maps issues if it make a problem to your work.

lautarozanuttini commented 1 year ago

Hi zyzdev, perfect! im going to do that now and report this to google_maps, thank you a lot.