flutter-riverpod-architecture

Automate Riverpod 2.x provider generation with @riverpod annotations and part directives.

Updated Jan 13, 2026
One-click install
npx skills add https://github.com/xnemesy/Fyne --skill flutter-riverpod-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-riverpod-architecture
Source: https://github.com/xnemesy/Fyne/tree/main/.agent/skills/flutter-riverpod-architecture
Command: npx skills add https://github.com/xnemesy/Fyne --skill flutter-riverpod-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes Riverpod 2.x-based state management with code generation, reducing boilerplate and ensuring consistent Provider usage across Flutter apps.

Core Features & Use Cases

  • Code generation: Uses Riverpod annotations to auto-generate providers and boilerplate.
  • Structured state: Supports simple read-only providers and mutable Notifier-based states with generated code.
  • Seamless integration: Works with widgets through ref.watch/ref.read patterns and with business logic via controllers.

Quick Start

Set up a Riverpod-enabled provider using the @riverpod annotation, declare the file with part statements as required, and run the code generation step to produce the *.g.dart files. Then consume providers in widgets via ref.watch or in logic via ref.read.

Frequently Asked Questions about flutter-riverpod-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Riverpod 2.x state management with codegen in Flutter?

To set up Riverpod 2.x state management with codegen, apply the @riverpod annotation to your providers, declare the required part directives in your file, and run the build step to generate the .g.dart files for consumption.

What is the best way to reduce Riverpod provider boilerplate in a Flutter app?

Using Riverpod code generation is the best way to reduce provider boilerplate, as it automates provider creation via annotations and standardizes state management patterns across your Flutter application.

How does ref.watch and ref.read work with generated Riverpod providers?

You consume generated Riverpod providers in widgets via ref.watch for reactive UI updates, and access them in business logic using ref.read to trigger state mutations without rebuilding the widget tree.

Can I use Notifier-based mutable state with Riverpod codegen?

Yes, Riverpod codegen supports mutable Notifier-based states alongside simple read-only providers, generating the necessary boilerplate to handle scalable state mutations across your business logic.

Do I need part directives for Riverpod codegen to work properly?

Yes, you must include part directives in your Dart file before running the code generation step, ensuring the build process can correctly link and produce the required .g.dart files.