[RFC] Another take on unified Provider syntax
Hello Riverpod community! I'd like to discuss a second take on the "Simplified Riverpod syntax without code-generation". This is similar to [#4008](https://github.com/rrousselGit/riverpod/issues/4008), but proposes an alternate syntax. Long story short: ## Defining a provider Providers would be defined as plain functions that take a `Ref` argument: ```dart // Equivalent of Provider<Repository> Repository myRepositoryProvider(Ref ref) { return MyRepository(); } // Equivalent of FutureProvider<User> Future<User> fetchUserProvider(Ref ref) { return http.get(...); } // Equivalent of StreamProvider<User> Stream<User> fetchUserProvider(Ref ref) { return firebase.auth... } ``` ## Notifiers There are two possible paths for Notifiers. 1. Stay as similar to today as possible: Use classes Notifiers would instead be classes that extend `Notifier/AsyncNotifier/StreamNotifier`, with an optionally defined constant next to the next ```dart class Counter extends Notifier<int> { // TODO override build as usual } const counterProvider = Counter.new; // Optional class TodoList extends AsyncNotifier<List<Todo>> { // TODO override build as usual } const todoListProvider = TodoList.new; // Optional ``` 2, Fuse providers/notifiers by exposing an `update` method on all providers. We could allow: ```dart int counterProvider(Ref ref) => 0; ... counterProvider.update(ref, (state) => state + 1); ``` > [!NOTE] > For this sake of good coding practices, we'd likely introduce li
Posted by rrousselGit on Apr 29, 2026, 4:08 PM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
[RFC] Another take on unified Provider syntax
Hello Riverpod community! I'd like to discuss a second take on the "Simplified Riverpod syntax without code-generation". This is similar to [#4008](https://github.com/rrousselGit/riverpod/issues/4008), but proposes an alternate syntax. Long story short: ## Defining a provider Providers would be defined as plain functions that take a `Ref` argument: ```dart // Equivalent of Provider<Repository> Repository myRepositoryProvider(Ref ref) { return MyRepository(); } // Equivalent of FutureProvider<User> Future<User> fetchUserProvider(Ref ref) { return http.get(...); } // Equivalent of StreamProvider<User> Stream<User> fetchUserProvider(Ref ref) { return firebase.auth... } ``` ## Notifiers There are two possible paths for Notifiers. 1. Stay as similar to today as possible: Use classes Notifiers would instead be classes that extend `Notifier/AsyncNotifier/StreamNotifier`, with an optionally defined constant next to the next ```dart class Counter extends Notifier<int> { // TODO override build as usual } const counterProvider = Counter.new; // Optional class TodoList extends AsyncNotifier<List<Todo>> { // TODO override build as usual } const todoListProvider = TodoList.new; // Optional ``` 2, Fuse providers/notifiers by exposing an `update` method on all providers. We could allow: ```dart int counterProvider(Ref ref) => 0; ... counterProvider.update(ref, (state) => state + 1); ``` > [!NOTE] > For this sake of good coding practices, we'd likely introduce li
Comments (0)
No comments yet. Start the discussion.