zyzdev / flutter_street_view

10 stars 29 forks source link

App crush if the street view not available #36

Open sadiqkhan61651 opened 3 months ago

sadiqkhan61651 commented 3 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 3 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 2 months ago

could you please provide the full code fro this implementation ?