zyzdev / flutter_street_view

10 stars 34 forks source link

App crush if the street view not available #36

Open sadiqkhan61651 opened 7 months ago

sadiqkhan61651 commented 7 months ago

App crush if the street view not available, there must be bool check which check whether the street view available or not. If it doesn't so don't show street view or show an error message . But don't crush the map

thebyndr commented 7 months ago
 flutter_google_street_view:
   git:
      url: https://github.com/liorboyango/flutter_street_view.git
      path: flutter_google_street_view
      ref: master

then you can check like this :


isStreetView? StreetViewPac.FlutterGoogleStreetView(

                    onPanoramaChangeListener: (location, e) {
                      location==null? setState((){
                      isStreetViev=false;
                      }):print('');
                    },
                        initPos: StreetViewPac.LatLng(
                            widget.vehicle.lat!, widget.vehicle.lon!),

                        initSource: StreetViewPac.StreetViewSource.outdoor,

                        initBearing: 30,

                        userNavigationEnabled: true,

                        zoomGesturesEnabled: false,

                        onStreetViewCreated: (StreetViewPac.StreetViewController controller) async {
                        print(controller.isAddressControl);

                        },
                      )
                  :Center( child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text('noDATA', style: TextStyle(fontFamily: 'Poppins',fontWeight:FontWeight.w500, color: Theme.of(context).canvasColor, fontSize: MediaQuery.sizeOf(context).width/38), ),
                  ))
subins829 commented 7 months ago

could you please provide the full code fro this implementation ?

liorboyango commented 3 months ago

See solution here: https://github.com/zyzdev/flutter_street_view/issues/39

yogi1610 commented 2 months ago

@subins829 @sadiqkhan61651 @thebyndr

Does somebody found the solution for app crashing using flutter_google_street_view: ^3.1.4 package?