Skip to content

Commit

Permalink
feat: workaround onResume when popping all
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Sep 19, 2023
1 parent ead3cb5 commit 96c707f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions app_navigator/lib/src/content_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,21 @@ class ContentNavigatorBloc extends BaseBloc {

void _popUntilPathOrPush(BuildContext context, ContentPath path) {
var found = false;

Navigator.of(context).popUntil((route) {
// print('popUntil($path) checking ${route.settings.name}');
var matches = route.settings.name != null &&
path.matchesString(route.settings.name!);
if (!matches) {
if (_routeAwareManager != null) {
routeAwareManager.popPaths.add(route.settings.name!);
var name = route.settings.name;
if (name != null) {
var matches = path.matchesString(name);
if (!matches) {
if (_routeAwareManager != null) {
routeAwareManager.popPaths.add(name);
}
}
}

found = found || matches;
return matches;
found = found || matches;
return matches;
}
return false;
});
// print('popUntil($path) found $found');
if (!found) {
Expand Down
2 changes: 1 addition & 1 deletion app_navigator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tekartik_app_navigator_flutter
description: Experimental app navigator flutter
version: 0.4.5
version: 0.4.6
publish_to: none

environment:
Expand Down

0 comments on commit 96c707f

Please sign in to comment.