Repository inventory

hoangnguyen0403/agent-skills-standard

Skills indexed from this repository, with install-style signals scoped to the repo.
6 skills1.4K GitHub stars0 weekly installsTypeScriptGitHubOwner profile

Overview

This skill codifies standards for predictable, testable Flutter state management using flutter_bloc, freezed, and equatable. It provides a clear workflow for designing events, states, and BLoC logic to keep UI layers thin and side effects isolated. The goal is robust, maintainable flows that are easy to test and reason about.

How this skill works

Start by modeling user interactions and outcomes as @freezed union types for Events and States. Implement a BLoC that maps Events to States using on<Event> handlers, async emit patterns, and transformers for concurrency. Connect the UI with BlocBuilder for rendering and BlocListener for navigation and other side effects, while ensuring errors become Failure states rather than thrown exceptions.

When to use it

  • When you need predictable, testable state flows across screens or features.
  • When UI must reflect asynchronous data sources such as APIs or streams.
  • When multiple UI components need to react to the same business logic.
  • When you want to keep navigation and one‑off effects out of build methods.
  • When you need easy unit and blocTest coverage for state transitions.

Best practices

  • Define all Events and States with @freezed to get exhaustive unions and pattern matching.
  • Emit errors as Failure states; avoid throwing inside on<Event> handlers.
  • Use await or emit.forEach for async work; avoid .then() chains that complicate tests.
  • Keep BlocBuilder pure (rendering only); place navigation and Snackbars in BlocListener.
  • Use transformer: restartable() (or debounce) for search/typeahead to manage concurrency.

Example use cases

  • A search screen using restartable transformer to handle rapid query changes and emit Loading/Data/Error states.
  • An authentication flow with Initial, Loading, Authenticated, and Unauthenticated states and tests covering all transitions.
  • A realtime feed implemented with emit.forEach(stream) to map incoming items to Data states while preserving testability.
  • A form submission flow where validation and API calls are handled in the BLoC and UI shows states via BlocBuilder and Snackbars via BlocListener.

FAQ

Emit states that represent outcomes and handle navigation or Snackbars in BlocListener rather than in BlocBuilder or the BLoC emitting direct navigator calls.

What testing approach is required?

Use blocTest to cover all state transitions, verify the initial state, and mock async dependencies so tests assert emitted states only.

6 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational