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

fix(lib/get_navigation): Improve preventDuplicates and preventDuplicateHandlingMode in navigator2 #3262

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

linpengteng
Copy link

@linpengteng linpengteng commented Nov 22, 2024

  1. support merge preventDuplicateHandlingMode by copyWith (GetPage)

  2. add and using preventDuplicates option of Getx5 Navigator2 API

    • to、off、offNamed、offUntil、backAndtoNamed、
    • toNamed、offNamedUntil、toNamedAndOffUntil
  3. merge preventDuplicates option in _configureRouterDecoder API

  4. execute _activePages.add(res) when route.preventDuplicates == false

Pre-launch Checklist

  • All existing and new tests are passing.

@linpengteng
Copy link
Author

linpengteng commented Nov 22, 2024

fix: #3261

1. using preventDuplicates option of Get Navigation
    - to、off、offNamed、offUntil、backAndtoNamed、
    - toNamed、offNamedUntil、toNamedAndOffUntil
2.  merge preventDuplicates option in _configureRouterDecoder API
3.  execute _activePages.add(res) when route.preventDuplicates == false
@linpengteng linpengteng changed the title fix(lib/get_navigation): support preventDuplicateHandlingMode in copyWith (GetPage) fix(lib/get_navigation): Improve preventDuplicates and preventDuplicateHandlingMode in navigator2 Nov 22, 2024
Copy link
Owner

@jonataslaw jonataslaw left a comment

Choose a reason for hiding this comment

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

Nice! Thank you for this change. Could you please change the value to false by default?

@@ -690,6 +691,7 @@ extension GetNavigationExt on GetInterface {
String? id,
dynamic arguments,
Map<String, String>? parameters,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe this value should be false by default

@@ -629,6 +629,7 @@ extension GetNavigationExt on GetInterface {
dynamic arguments,
String? id,
Map<String, String>? parameters,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -702,6 +704,7 @@ extension GetNavigationExt on GetInterface {
id: id,
arguments: arguments,
parameters: parameters,
preventDuplicates: preventDuplicates,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -722,6 +725,7 @@ extension GetNavigationExt on GetInterface {
String? id,
dynamic result,
Map<String, String>? parameters,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -1003,11 +1008,13 @@ extension GetNavigationExt on GetInterface {
bool Function(GetPage) predicate, [
Object? arguments,
String? id,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

String page, {
T? result,
Object? arguments,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -521,9 +527,13 @@ class GetDelegate extends RouterDelegate<RouteDecoder>
dynamic arguments,
String? id,
Map<String, String>? parameters,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -541,9 +551,13 @@ class GetDelegate extends RouterDelegate<RouteDecoder>
dynamic arguments,
String? id,
Map<String, String>? parameters,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -554,10 +568,14 @@ class GetDelegate extends RouterDelegate<RouteDecoder>
String page,
bool Function(GetPage) predicate, [
Object? data,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

@@ -573,12 +591,17 @@ class GetDelegate extends RouterDelegate<RouteDecoder>
Widget Function() page,
bool Function(GetPage) predicate, [
Object? arguments,
bool preventDuplicates = true,
Copy link
Owner

Choose a reason for hiding this comment

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

IDEM

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.

2 participants