riverpod-mutations

Manage async UI action states with Riverpod Mutation lifecycle.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/masssi164/weave --skill riverpod-mutations-masssi164
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: riverpod-mutations
Source: https://github.com/masssi164/weave/tree/main/.agent/skills/riverpod-mutations
Command: npx skills add https://github.com/masssi164/weave --skill riverpod-mutations-masssi164

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Riverpod mutations provide a clean way to model the lifecycle of an asynchronous UI action (idle, pending, success, error) without polluting the main state management logic, reducing boilerplate and improving UX feedback.

Core Features & Use Cases

  • Mutation<T> instances to represent a single async task and its result type.
  • Listen to mutation state with ref.watch to drive UI elements (loading spinners, error messages, success indicators).
  • Support for MutationIdle, MutationPending, MutationSuccess, MutationError states and automatic resets.
  • Keyed mutations for multiple concurrent actions and safe lifecycle boundaries around asynchronous work.
  • Triggering via Mutation.run(ref, callback) to execute the action and return a value.
  • Reset via Mutation.reset(ref) to restore Idle state when needed.

Quick Start

Create a Mutation<T> instance and call run with a callback that performs your async task.

Frequently Asked Questions about riverpod-mutations

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

FAQPage Schema
How do I manage asynchronous form submission states in Flutter without polluting main state management?

Riverpod mutations model async UI action lifecycles (idle, pending, success, error) separately using Mutation<T> instances, reducing boilerplate and keeping main state clean. You watch the mutation state to drive UI feedback like loading spinners and error messages.

What is the best way to handle concurrent button actions in Flutter using Riverpod?

Keyed mutations support multiple concurrent actions in Riverpod by maintaining safe lifecycle boundaries around asynchronous work. Each keyed Mutation<T> tracks its own idle, pending, success, or error state independently for precise UI feedback.

How do I trigger and reset an async UI action state in Flutter?

Trigger async UI actions by calling Mutation.run(ref, callback) to execute the task and return a value. Restore the idle state by calling Mutation.reset(ref), providing a safe reset flow for subsequent user interactions.

Can I use Riverpod mutations for item mutations in Flutter lists?

Yes, Riverpod mutations handle item mutations by tracking distinct mutation lifecycles for UI-driven async actions. Keyed mutations allow you to manage multiple items concurrently, providing individual loading and error states per item.

Why does my Flutter UI need distinct mutation lifecycles for async tasks?

Distinct mutation lifecycles prevent async task states from polluting main state management logic. Modeling idle, pending, success, and error states separately with Mutation<T> improves UX feedback and reduces boilerplate for form submissions and button actions.