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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL display is wrong with multiple beamers after page refresh #523

Closed
ygotthilf opened this issue May 25, 2022 · 4 comments
Closed

URL display is wrong with multiple beamers after page refresh #523

ygotthilf opened this issue May 25, 2022 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@ygotthilf
Copy link

Hello 馃憢

Describe the bug
In my app (with several beamers) and in the bottom_navigation_multiple_beamers example, I had an issue after refreshing the page. The url is updated to the wrong path.

Beamer version:
master

To Reproduce

Just refresh the page.

Here a screencast of the issue with the bottom_navigation_multiple_beamers example

Expected behavior
The path should be the same.

Desktop (please complete the following information):

Chrome 101.0.4951.64 on MacOS

Thank for your support and this great package ! 馃ぉ

@ygotthilf
Copy link
Author

It seems the issue comes from the NotFound location use at this line in the example.

The actual implementation

/// Default location to choose if requested URI doesn't parse to any location.
class NotFound extends BeamLocation<BeamState> {
  /// Creates a [NotFound] [BeamLocation] with
  /// `RouteInformation(location: path)` as its state.
  NotFound({String path = '/'}) : super(RouteInformation(location: path));

  @override
  List<BeamPage> buildPages(BuildContext context, BeamState state) => [];

  @override
  List<String> get pathPatterns => [];
}

The implementation that works

class NotFound extends BeamLocation<BeamState> {

  NotFound([
    RouteInformation? routeInformation,
    BeamParameters? beamParameters,
  ]) : super(routeInformation, beamParameters);

  @override
  List<BeamPage> buildPages(BuildContext context, BeamState state) => [];

  @override
  List<String> get pathPatterns => [];
}

And, obviously, the routeInformation and beamParameters should be passed by the locationBuilder.

Let me know if you have any question. I let you close the issue.

@slovnicki
Copy link
Owner

Hey @ygotthilf 馃憢

Thanks for creating an issue and solving it 馃槷? 馃挋

I've also seen some strange behavior when using similar custom locationBuilders and have a feeling that it would work if BeamerLocationBuilder was used instead. I will take a closer look at the example and your solution tomorrow morning and will get back to you. If I verify that your solution solves the issue, would you be interested in making a PR?

Thanks again for everything!

@slovnicki slovnicki added the bug Something isn't working label May 26, 2022
@slovnicki slovnicki added this to the v1.5.0 milestone May 27, 2022
@slovnicki
Copy link
Owner

@ygotthilf
This seems to be a deeper problem than NotFound implementation.
I'll need to work on this some more...

@slovnicki
Copy link
Owner

Hey @ygotthilf
This should be now fixed with cc2c265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants