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

Add example of protecting a route with subscription #81

Open
matthewwong525 opened this issue Jul 18, 2024 · 0 comments
Open

Add example of protecting a route with subscription #81

matthewwong525 opened this issue Jul 18, 2024 · 0 comments

Comments

@matthewwong525
Copy link
Collaborator

Before i do this i probably need to add a pricing page within the app. And before i do that i probably need to #55

To protect a route:

  1. In route_notifier.dart, I need to make the redirect, data function async
  2. add the route i want to protect in an if statement
  3. add a await ref.read(metadataProvider.future) to retrieve the latest metadata data in the if statement (should be cached so it should be relatively fast)
  4. Check the subscription in the if statement to protect the route.
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

1 participant