Skip to content

Drift demo with riverpod #259

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

Merged
merged 16 commits into from
Apr 30, 2025
Merged

Drift demo with riverpod #259

merged 16 commits into from
Apr 30, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Mar 24, 2025

This changes the supabase_todolist_drift package to also use Riverpod for state management. This example can then serve as a guide for integrating PowerSync with popular state management solutions (I'll open a PR to our documentation linking towards it).

The idea is to adopt best practices of modern state management in Flutter. This changes the example to:

  • Extract the PowerSync database and relevant fields (like the auto-updating SyncState) into Riverpod providers.
  • Consume providers from widgets (for simple queries) or through wrapping Notifiers to bundle similar functionality.
  • Adopt auto_route for declarative routing.

@simolus3 simolus3 requested a review from stevensJourney April 29, 2025 08:32
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much context on the best practices of state management in Flutter/Dart, but from a general architecture perspective this looks brilliant. Happy with these changes.

@simolus3 simolus3 merged commit 2c0d365 into main Apr 30, 2025
5 checks passed
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.

2 participants