jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.27k stars 1.61k forks source link

Why GetX 5 removed `offAllNamed` `predicate` #3175

Closed Ssiswent closed 1 month ago

Ssiswent commented 1 month ago

image

If not use this, how can I do things like the old API?

image

I tried to call offNamedUntil at new chat page, but not work as desired, when click back button in channel page, still go back to new chat page:

Get.offNamedUntil(
        Routes.channel,
        (route) => route.name == Routes.main,
        arguments: {'cid': data.cid},
      );

Screenshots:

newChat -> newGroupChat -> groupChatDetails -> channel: image

Click back button in channel page: image

jonataslaw commented 1 month ago

Thanks for opening this issue. Maybe Get.offUntil solves your use case. Could you confirm? I removed the predicate for convention reasons, offAll will always remove the entire stack.

Ssiswent commented 1 month ago

Thanks for opening this issue. Maybe Get.offUntil solves your use case. Could you confirm? I removed the predicate for convention reasons, offAll will always remove the entire stack.

Thanks for your reply, I tried Get.offNamedUntil, but the result is not as I desired. You can see codes and outputs above, I described that in my issue. image

jonataslaw commented 1 month ago

Could you try RC-10? I think it is fixed right now.

Ssiswent commented 1 month ago

Could you try RC-10?

I think it is fixed right now.

Let me try with RC-10 later, thank you.

Ssiswent commented 1 month ago

Could you try RC-10? I think it is fixed right now.

Sry, I am using firebase_analytics, and get RC-10's dependency of web is conflict with that , do you know how to fix this?

Resolving dependencies... (2.3s)
Because firebase_analytics >=11.2.1 depends on firebase_analytics_web ^0.5.9+1 which depends on firebase_core_web ^2.17.4, firebase_analytics >=11.2.1
  requires firebase_core_web ^2.17.4.
And because firebase_core_web >=2.12.0 depends on web ^0.5.1 and get >=5.0.0-release-candidate-10 <5.0.0-release-candidate-2 depends on web ^1.0.0,
  firebase_analytics >=11.2.1 is incompatible with get >=5.0.0-release-candidate-10 <5.0.0-release-candidate-2.
So, because finnplay_chat depends on both get 5.0.0-release-candidate-10 and firebase_analytics ^11.2.1, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on get: flutter pub add get:^4.6.6
Ssiswent commented 1 month ago

Could you try RC-10? I think it is fixed right now.

Sry, I am using firebase_analytics, and get RC-10's dependency of web is conflict with that , do you know how to fix this?

Resolving dependencies... (2.3s)
Because firebase_analytics >=11.2.1 depends on firebase_analytics_web ^0.5.9+1 which depends on firebase_core_web ^2.17.4, firebase_analytics >=11.2.1
  requires firebase_core_web ^2.17.4.
And because firebase_core_web >=2.12.0 depends on web ^0.5.1 and get >=5.0.0-release-candidate-10 <5.0.0-release-candidate-2 depends on web ^1.0.0,
  firebase_analytics >=11.2.1 is incompatible with get >=5.0.0-release-candidate-10 <5.0.0-release-candidate-2.
So, because finnplay_chat depends on both get 5.0.0-release-candidate-10 and firebase_analytics ^11.2.1, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on get: flutter pub add get:^4.6.6

I tried to add dependency_overrides to fix this, is this the best way now? image

And as you said, RC-10 has fixed this issue, thanks!