riverpod_architecture: A shared structure for Flutter feature state
The author argues that Riverpod manages state but leaves feature structure to each developer, causing repeated loading and error handling code. They introduce riverpod_architecture, a package they use to start Flutter apps, which organizes each feature into a repository returning a failure or data, a notifier converting that into state, and a screen rendering it. The package provides base notifiers that handle loading and error states through a single execute() call, paginated notifiers for infinite lists, and app-wide loading and failure messages. It is built on Riverpod 3 and uses Either for results so failures are returned as values rather than thrown exceptions. The article notes that smaller apps may not need these extra base classes and can rely on Riverpod's built-in AsyncNotifier instead.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in