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

feat!: Adds new route methods pushReplacement, pushReplacementNamed, and pushReplacementOverlay #2249

Merged
merged 17 commits into from
Jan 10, 2023

Conversation

munsterlander
Copy link
Contributor

@munsterlander munsterlander commented Jan 2, 2023

Description

This PR adds the aforementioned methods to the router component so a user can replace the current route / overlay with something else without having to call pop then push. Additionally, it corrects an error in the router documents as popPage() does not exist as the call is just pop().

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is barely a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes: #2177

@spydon spydon requested review from st-pasha and a team January 2, 2023 22:59
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Some minor comments.

packages/flame/lib/src/components/router_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/router_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/router_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/router_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/router_component.dart Outdated Show resolved Hide resolved
@munsterlander munsterlander changed the title feat: Adds new route methods pushNamedReplacement, pushReplacement, and pushReplacementOverlay feat!: Adds new route methods pushNamedReplacement, pushReplacement, and pushReplacementOverlay Jan 7, 2023
Copy link
Contributor

@st-pasha st-pasha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an OverlayRoute we can try to define
@override String get name => super.name!;, because overlays should always have names

packages/flame/lib/src/components/route.dart Outdated Show resolved Hide resolved
@spydon spydon requested review from st-pasha and a team January 10, 2023 14:20
doc/flame/router.md Outdated Show resolved Hide resolved
@st-pasha st-pasha changed the title feat!: Adds new route methods pushNamedReplacement, pushReplacement, and pushReplacementOverlay feat!: Adds new route methods pushReplacement, pushReplacementNamed, and pushReplacementOverlay Jan 10, 2023
@spydon spydon merged commit a2772b4 into flame-engine:main Jan 10, 2023
@munsterlander munsterlander deleted the Adds-route-methods branch January 10, 2023 22:40
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

Successfully merging this pull request may close these issues.

Need a pushReplacementNamed and pushReplacement for RouterComponent
3 participants