flutter-controller-pattern

Move Flutter business logic into Riverpod controllers with use cases and tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/auravibes-apps/auravibes --skill flutter-controller-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-controller-pattern
Source: https://github.com/auravibes-apps/auravibes/tree/main/.agents/skills/flutter-controller-pattern
Command: npx skills add https://github.com/auravibes-apps/auravibes --skill flutter-controller-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Moves business logic and orchestration out of Flutter widgets/providers into Riverpod controllers to improve testability and maintainability.

Core Features & Use Cases

  • Defines a Controller pattern where widgets dispatch intents and controllers coordinate use cases, keeping domain logic in use cases.
  • Provides clear responsibility boundaries, common methods (runTask, grantToolCall, skipToolCall, stopAllToolCalls), and migration guidance from older provider-based patterns.
  • Supports testing across controller state, orchestration, and widget intents.

Quick Start

Integrate a Riverpod controller by replacing the old provider pattern with a keepAlive controller and connect intents to widgets.

Frequently Asked Questions about flutter-controller-pattern

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

FAQPage Schema
How do I move business logic out of Flutter widgets with Riverpod?

Use a controller pattern where widgets dispatch intents and controllers coordinate use cases, moving business logic out of Flutter widgets with Riverpod. This centralizes orchestration and keeps domain rules in use cases.

What is the controller pattern in Flutter for UI orchestration?

The controller pattern in Flutter is a design approach where controllers own UI orchestration and expose explicit intent and query APIs. Widgets dispatch intents to the controller, which coordinates domain logic and use cases without cluttering the widget tree.

How do I test Riverpod controllers and widget intents in Flutter?

Test Riverpod controllers by verifying controller state, orchestration logic, and widget dispatch intents. The pattern requires controllers to provide tests for transitions and widget dispatch, ensuring centralized UI logic is fully testable.

Can I migrate my existing Flutter provider pattern to a Riverpod controller?

Yes, you can migrate from an older provider-based pattern to a Riverpod controller by replacing old providers with a keepAlive controller. Connect your widget intents to the new controller to establish clear responsibility boundaries.

When should I not use a controller pattern for Flutter UI logic?

You should avoid the controller pattern for Flutter UI logic when a feature lacks centralized orchestration needs or does not require reusable intent methods across multiple widgets. Simple stateless widgets without domain rules do not need this orchestration layer.