Skip to content

Commit

Permalink
Fix error removing route from the stack in the TemporaryQRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
SchabanBo committed Jul 25, 2024
1 parent bd7a190 commit f5206b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# 1.11.0

- Fix error removing route from the stack in the `TemporaryQRouter`

# 1.11.0

- Add `TemporaryQRouter` to use the router in n popups or dialogs. #126
- Fix #139
- Set min SDK to 2.17.0
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [Mix it up](#mix-it-up)
- [App Page Transition](#app-page-transition)
- [Temporary router](#temporary-router)
- [Example](#example)
- [Limitations](#limitations)
- [waiting for page result](#waiting-for-page-result)
- [Restoration management](#restoration-management)
Expand Down Expand Up @@ -427,6 +428,8 @@ This example will show the store page in a bottom sheet. the same routes are def

To Check if the temporary router is active or not you can use `QR.navigator.isTemporary`.

### [Example](https://github.com/SchabanBo/qr_samples/blob/main/lib/examples/temporary_router.dart)

### Limitations
- URL Navigation: The temporary router will not function if the user directly types the path into the URL. This limitation arises because the temporary router is designed to exist only within the widget tree and is destroyed when the widget is removed.

Expand Down
2 changes: 1 addition & 1 deletion lib/src/controllers/qrouter_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ class QRouterController extends QNavigator {
}

Future<void> disposeAsync() async {
if (!isTemporary) await _pagesController.removeAll();
isDisposed = true;
await _pagesController.removeAll();
if (isTemporary) {
// remove routes from the tree
final routesNames = routes.routes.map((e) => e.name).toList();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: qlevar_router
description: A router that helps you to manage your project routes. Create nested routes. navigation without context between your pages.

version: 1.11.0
version: 1.11.1
repository: https://github.com/SchabanBo/qlevar_router

environment:
Expand Down

0 comments on commit f5206b3

Please sign in to comment.