Describe the bug
There is a race condition with arguments when stacking multiple pages with Modular.to.pushNamed (without using await). Since awaiting the Modular.to.pushNamed will only finish when the pages are popped, it is not possible to push multiple pages in the stack while using modular arguments with the route. It was found that the available arguments will be from the page that is simpler to build. This behavior doesn't appear in modular 3.4.1+1, but was first found in modular 5.0.3 and 6.0.3.
Environment
flutter doctor
[✓] Flutter (Channel stable, 3.10.4, on macOS 13.4.1 22F770820d darwin-x64, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.81.0)
To Reproduce
There is a debug project to validate this issue: https://github.com/fabricio-godoi/modular-push-validation
Once built, it will start with two buttons, one to replicate the issue, and another with a simple solution for whomever it may concern.
Each button will call multiple pages that will open with a single number indicating the call precedence.
Expected behavior
It is expected that all routes called with pushNamed or another method don't share the same arguments variable, since the many methods inside the push functions are async and could lead to major routing problems.
Describe the bug
There is a race condition with arguments when stacking multiple pages with Modular.to.pushNamed (without using await). Since awaiting the Modular.to.pushNamed will only finish when the pages are popped, it is not possible to push multiple pages in the stack while using modular arguments with the route. It was found that the available arguments will be from the page that is simpler to build. This behavior doesn't appear in modular 3.4.1+1, but was first found in modular 5.0.3 and 6.0.3.
Environment
flutter doctor
To Reproduce
There is a debug project to validate this issue: https://github.com/fabricio-godoi/modular-push-validation
Once built, it will start with two buttons, one to replicate the issue, and another with a simple solution for whomever it may concern.
Each button will call multiple pages that will open with a single number indicating the call precedence.
Expected behavior
It is expected that all routes called with pushNamed or another method don't share the same arguments variable, since the many methods inside the push functions are async and could lead to major routing problems.