asyncredux-state-access

Define typed BuildContext extensions for accessing Redux state in Flutter widgets.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/pro100andrey/dar --skill asyncredux-state-access-pro100andrey
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asyncredux-state-access
Source: https://github.com/pro100andrey/dar/tree/main/.claude/skills/asyncredux-state-access
Command: npx skills add https://github.com/pro100andrey/dar --skill asyncredux-state-access-pro100andrey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Widgets often need to access and react to app state, but wiring state reads can cause unnecessary rebuilds and boilerplate. This guide shows how to use BuildContext extensions and three access modes to control when widgets rebuild and how to read state safely.

Core Features & Use Cases

  • Context-based state access: use context.state, context.select, and context.read to control rebuilds and reads.
  • BuildContext extension setup: defines extension to expose typed getters for state and selectors.
  • Guidance on when to use each method: recommended scenarios for full state vs selective reads vs one-time reads.

Quick Start

Create a BuildContext extension and start accessing state in a simple widget using context.state, context.select, and context.read.

Frequently Asked Questions about asyncredux-state-access

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

FAQPage Schema
How do I access Flutter store state inside widgets without causing unnecessary rebuilds?

Access Flutter store state efficiently using BuildContext extensions with context.select for selective reads and context.read for one-time reads, minimizing unnecessary widget rebuilds. This approach controls exactly when widgets react to state changes.

When should I use context.select vs context.read vs context.state in Flutter?

Use context.select for selective state reads that trigger rebuilds only when specific slice changes, context.read for one-time reads in event handlers, and context.state for full state access in build methods. Each method controls rebuild scope differently.

How do I define a typed BuildContext extension for state access in Flutter?

Define a typed BuildContext extension in Flutter by creating extension methods that expose typed getters for store state and selectors. This setup enables context.state, context.select, and context.read access patterns inside widget build methods.

Can I safely read store state in initState and event handlers using BuildContext?

Yes, you can safely read store state in initState and event handlers using context.read for one-time reads without triggering rebuilds. This pattern avoids build-phase violations and ensures safe state access outside build methods.

What's the best way to optimize Flutter widget rebuilds when accessing app state?

Optimize Flutter widget rebuilds by applying selective state access patterns: use context.select to listen only to specific state slices, context.read for event handler reads, and context.state for full state in build methods. This minimizes unnecessary rebuilds.

Why does my Flutter widget rebuild when only unrelated store state changes?

Flutter widgets rebuild when using context.state for full state access instead of selective reads. Switch to context.select to listen only to specific state slices, preventing unnecessary rebuilds when unrelated store state changes occur.