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

fixed structure and moved onPopPage to onDidRemovePage #3258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/get_navigation/src/router_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class RouterReportManager<T> {
_routesKey[routeName]?.remove(element);
}
}

_routesKey.remove(routeName);

keysToRemove.clear();
Expand Down
19 changes: 10 additions & 9 deletions lib/get_navigation/src/routes/get_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ import '../../../get.dart';
class GetNavigator extends Navigator {
GetNavigator.onGenerateRoute({
GlobalKey<NavigatorState>? super.key,
bool Function(Route<dynamic>, dynamic)? onPopPage,
// bool Function(Route<dynamic>, dynamic)? onPopPage,
required List<GetPage> super.pages,
super.onDidRemovePage,
List<NavigatorObserver>? observers,
super.reportsRouteUpdateToEngine,
TransitionDelegate? transitionDelegate,
super.initialRoute,
super.restorationScopeId,
}) : super(
//keys should be optional
onPopPage: onPopPage ??
(route, result) {
final didPop = route.didPop(result);
if (!didPop) {
return false;
}
return true;
},
// onPopPage: onPopPage ??
// (route, result) {
// final didPop = route.didPop(result);
// if (!didPop) {
// return false;
// }
// return true;
// },
onGenerateRoute: (settings) {
final selectedPageList =
pages.where((element) => element.name == settings.name);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
web: ">=0.5.0 <2.0.0"

dev_dependencies:
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0
flutter_test:
sdk: flutter

Expand Down