flutter-smell-build-side-effects

Enforce controller-driven initialization to prevent Flutter build-time side effects.

Updated Nov 7, 2025
One-click install
npx skills add https://github.com/belluga/delphi-ai --skill flutter-smell-build-side-effects
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-smell-build-side-effects
Source: https://github.com/belluga/delphi-ai/tree/main/.cline/skills/flutter-smell-build-side-effects
Command: npx skills add https://github.com/belluga/delphi-ai --skill flutter-smell-build-side-effects

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flutter UI builds often trigger IO, network, telemetry, or side effects during widget lifecycles such as build or didChangeDependencies, leading to fragility and hard-to-test code. This skill enforces guardrails to ensure side effects are controlled and initiated by a controller, not directly from UI widgets.

Core Features & Use Cases

  • Controller-driven side effects: Any IO or asynchronous work is initiated by a centralized controller during initialization or explicit actions.
  • Guarded init: Prevents side-effectful work from executing multiple times or during widget lifecycle transitions.
  • Guidance and best practices: Provides patterns to keep widgets pure and testable.

Quick Start

Create a dedicated controller to initialize and mediate all side-effectful work, keeping widgets pure.

Frequently Asked Questions about flutter-smell-build-side-effects

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

FAQPage Schema
How do I prevent side effects during Flutter build and didChangeDependencies?

To prevent side effects during Flutter widget lifecycle transitions, enforce controller-driven initialization to ensure IO, telemetry, and network calls are mediated by a central controller rather than UI widgets.

Why does executing network calls in Flutter build cause hard-to-test code?

Executing network calls in Flutter build causes hard-to-test code because widget lifecycles become fragile when triggering side effects directly during rendering, bypassing controlled controller initialization and guard rails.

What is the best way to structure controller initialization for Flutter side effects?

The best way to structure controller initialization for Flutter side effects is to create a dedicated controller to mediate asynchronous work, implementing guarded init to prevent side-effectful operations from executing multiple times across lifecycle transitions.

Can I keep Flutter widgets pure while managing telemetry and IO operations?

You can keep Flutter widgets pure while managing telemetry and IO operations by moving side-effectful work to a centralized controller during initialization, ensuring widgets remain testable and free from direct side effects.

Does controller-driven initialization stop duplicate side effects during widget lifecycle transitions?

Controller-driven initialization stops duplicate side effects during widget lifecycle transitions by applying explicit guard rails that prevent IO or asynchronous work from executing multiple times during build and didChangeDependencies.

When should I not use a central controller for Flutter side effects?

You should not bypass a central controller for Flutter side effects in projects where IO, telemetry, or network calls occur during rendering, as skipping controller initialization removes guard rails and breaks widget testability.