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

Beamer not retaining state of previous screen #635

Open
kdomingo opened this issue Sep 8, 2023 · 3 comments
Open

Beamer not retaining state of previous screen #635

kdomingo opened this issue Sep 8, 2023 · 3 comments

Comments

@kdomingo
Copy link

kdomingo commented Sep 8, 2023

Navigating to an item's details screen and going back makes the list screen rebuild.

@jenisnavadiya
Copy link

Same issue

@felixdollack
Copy link

I noticed the same.
It seems state is only kept when the previous screen is part of the location stack.

E.g. going from LocationA -> LocationB

class LocationB extends BeamLocation<BeamState> {
  @override
  List<BeamPage> buildPages(BuildContext context, BeamState state) {
    return [
      // create whatever (back)stack you desire here.
      // this will also keep the current state of this location in memory
      ...LocationA().buildPages(context, state),
      const WidgetB(),
    ];
  }

  @override
  List<Pattern> get pathPatterns => ["/b"];
}

Disclaimer: I just started using beamer 2 days ago. There could be another way I don't know yet ^^;

@felixdollack
Copy link

There was also this comment that could be useful

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

3 participants