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

Issue in ScreenObserver #81

Closed
mschlegelaware opened this issue May 21, 2024 · 1 comment
Closed

Issue in ScreenObserver #81

mschlegelaware opened this issue May 21, 2024 · 1 comment

Comments

@mschlegelaware
Copy link

In the didPop function inside the ScreenObserver is an issue.

the code:

  @override
  void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
    final name = route.settings.name;
    if (name != null) {
      screenStreamController.add(name);
    }
  }

From the documentation from didPop:

The Navigator popped route.
The route immediately below that one, and thus the newly active route, is previousRoute.
Copied from NavigatorObserver.

Therefore the code should be:

  @override
  void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
    final name = previousRoute.settings.name;
    if (name != null) {
      screenStreamController.add(name);
    }
  }

previousRoute is the new route, and therefore that is the name which should be tracked, not route.

@edsonjab
Copy link
Contributor

Hi @mschlegelaware thank you for your report, we start looking into 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