Skip to content

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