jonataslaw / getx

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

Getx Deeplink Issue when app terminate #3084

Open xelent-nabeel opened 5 months ago

xelent-nabeel commented 5 months ago

When i am using Getx and uni_links I am getting an Error on LabledGlobelKey. Need Help. Thanks in advance App Opened Normally (Icon Tap) Working App in Background and Link Tap Working App Terminated, Opened Normally then it is working App Terminated, Opened Tapping Link then it is not working. Then it is giving error.

jahidsakan commented 5 months ago

Im also facing the same issue . A GlobalKey was used multiple times inside one widget's child list.

The offending GlobalKey was: [LabeledGlobalKey#0f54f Key Created by default] The parent of the widgets with that key was: _FocusInheritedScope The first child to get instantiated with that key became: Navigator-[LabeledGlobalKey#0f54f Key Created by default] dirty dependencies: [UnmanagedRestorationScope] state: NavigatorState#64d70(lifecycle state: initialized) The second child that was to be instantiated with that key was: _FocusInheritedScope

TC-Shubh commented 4 months ago

I am also facing same issue, when trying to get to the profile page with the id

nandakista commented 4 months ago

Hi @xelent-nabeel, @jahidsakan, @TC-Shubh I have same issue in my old projects after spending a lot of time I found two the solutions that you can choose

  1. Make sure the initialRoute name is '/' or
  2. When the deeplink came from cold start, its always open the '/' as initial route and if your initial route name is not '/', getx throw to the unknown route property so you must set unknownRoute in the GetMaterialApp
    See the code hereScreenshot 2024-03-02 at 21 04 32

Hope this help you

*Note: it was fixed in the last merge. It's not just published. I wish he could now because trying to pull from the git commit is impossible. https://github.com/jonataslaw/getx/pull/3067

Zaboy15 commented 2 months ago

Hi @nandakista Still same issue, show LabeledGlobalKey if app after terminated.