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

Update app startup logic to be compatible with URL-based navigation and deep links #158

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

bizz84
Copy link
Owner

@bizz84 bizz84 commented Nov 26, 2024

The old AppStartupWidget setup wasn't playing nice with deep links and URL navigation when used with MaterialApp.router / GoRouter.

This PR fixes this with two changes:

  • Remove the old /startup route (the app startup logic is about application state, but shouldn't have anything to do with routing)
  • Use MaterialApp.builder to return the AppStartupWidget. This way, AppStartupWidget can control any asynchronous app initialization without interfering with the routing logic, and returns the intended child widget only when the initialization is done.

To better support passing the child when loading is complete, a new AppStartupDataWidget class has been added.

@bizz84 bizz84 merged commit 3615f9d into master Nov 26, 2024
1 check passed
@bizz84 bizz84 deleted the update-app-startup-logic branch November 26, 2024 17:30
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.

1 participant