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

GetPage PreventDuplicateHandlingMode is reset to default when used in navigator2 (Getx5) #3261

Open
linpengteng opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@linpengteng
Copy link

linpengteng commented Nov 22, 2024

Describe the bug
GetPage PreventDuplicateHandlingMode is defined but has no effect when used in Naviger2, still uses the default PreventDuplicateHandlingMode.reorderRoutes

Reproduction code
When using Get.toNamed, one of the APIs (_configureRouterDecoder) uses copyWith of GetPage, causing PreventDuplicateHandlingMode to be lost

  // no PreventDuplicateHandlingMode
  GetPage<T> copyWith({
    LocalKey? key,
    String? name,
    GetPageBuilder? page,
    bool? popGesture,
    Map<String, String>? parameters,
    String? title,
    Transition? transition,
    Curve? curve,
    Alignment? alignment,
    bool? maintainState,
    bool? opaque,
    List<BindingsInterface>? bindings,
    BindingsInterface? binding,
    List<Bind>? binds,
    CustomTransition? customTransition,
    Duration? transitionDuration,
    Duration? reverseTransitionDuration,
    bool? fullscreenDialog,
    RouteSettings? settings,
    List<GetPage<T>>? children,
    GetPage? unknownRoute,
    List<GetMiddleware>? middlewares,
    bool? preventDuplicates,
    final double Function(BuildContext context)? gestureWidth,
    bool? participatesInRootNavigator,
    Object? arguments,
    bool? showCupertinoParallax,
    Completer<T?>? completer,
    bool? inheritParentPath,
    bool? canPop,
    PopInvokedWithResultCallback<T>? onPopInvoked,
    String? restorationId,
  })

To Reproduce
None

Expected behavior
Allow GetPage PreventDuplicateHandlingMode to be customized and used in navigator2

Screenshots
image

Flutter Version:
Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (8 days ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3

Getx Version:
^5.0.0-release-candidate-9.2.1

Describe on which device you found the bug:
ex: IPhone 12 mini

Minimal reproduce code
None

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

No branches or pull requests

2 participants