Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous street view retained #26

Open
jeromeDms opened this issue May 24, 2023 · 1 comment
Open

Previous street view retained #26

jeromeDms opened this issue May 24, 2023 · 1 comment

Comments

@jeromeDms
Copy link

Hi,
Thanks for this nice plugin.
I noticed when opening multiple street view using your plugin, the previous view is first displayed before jumping to new Lat/Lng.
I'm using your view with navigator.push
When clicking the top left back button, the widget is properly disposed, then the next call to your class shows the previous street view before jumping to the new Lat/Lng.
I'm using your plugin as follow :

@override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(S.current.decouvrirQuartier, style: TextStyle(fontSize: APP_BAR_FONT_SIZE, fontWeight: APP_BAR_FONT_WEIGHT),),
          leading: IconButton(
            icon: const Icon(Icons.arrow_back),
            onPressed: () => Navigator.pop(context),
          ),
        ),
        body: SafeArea(
          child: 
              FlutterGoogleStreetView(
                **initPos: LatLng(widget.thePoi.latitude, widget.thePoi.longitude),**
                markers: markers,
                //motionTracking: true,
                streetNamesEnabled: true,
                userNavigationEnabled: true,
                onStreetViewCreated: (controller) {
                  setState(() {
                    _controller = controller;
                  });
                },
                onPanoramaChangeListener: (location, e) {
                  if(e != null) {
                    Utils.showMyDialogAlert(
                        context,
                        "assets/images/logoH256.png",
                        S.current.Erreur,
                        S.current.StreetViewNotAvailable,
                        null,
                        "OK", () {
                      Navigator.pop(context);
                    });
                  }
                },
              ),
        ),
    );
  }

Any idea why the previous view is retained ?
Thanks

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-05-24.at.13.55.47.mov
@jannisnikoy
Copy link

Any insights on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants