# Dart flutter patterns

> Dart flutter patterns is an open-source agent skill for developer tools. Gives your agent Dart and Flutter patterns for state, navigation, networking and tests. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/dart-flutter-patterns
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** dart-flutter-patterns
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill is a reference of copy-paste Dart and Flutter code patterns, grouped by concern: null safety, immutable state with sealed classes and Freezed, concurrent async work, widget structure and rebuild scoping, and state management with BLoC/Cubit and Riverpod. It also covers GoRouter navigation with a reactive authentication redirect, Dio networking with an auth interceptor and a single-retry token refresh, global error capture, and testing with BLoC tests, widget tests and fakes.

The guidance is written as good versus bad examples, so an agent reviewing code can point out anti-patterns such as bang operators, widget-returning helper methods and sequential awaits, and suggest the preferred alternative. It pairs the patterns with short code snippets that the agent can adapt to the project in front of it.

The skill expects a Dart or Flutter codebase. Where it fits, the patterns name the packages they rely on, such as freezed, flutter_bloc, riverpod, go_router, dio and collection. It does not run scripts or call external services.

## When your agent uses it

> Production-ready Dart and Flutter patterns covering null safety, immutable state with Freezed, async composition, widget architecture, state management (BLoC, Riverpod, Provider), GoRouter navigation with auth guards, Dio networking, error handling, and testing. Use when writing or reviewing Dart and Flutter code — state, widgets, navigation, networking, or architecture.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/dart-flutter-patterns)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/dart-flutter-patterns)

## Features

- **Null safety guidance:** Prefers fallbacks, pattern matching and early returns over the bang operator and overused late fields.
- **Immutable state modeling:** Shows sealed state hierarchies and Freezed classes with copyWith and JSON serialization.
- **Widget performance patterns:** Covers extracting widget classes, const propagation and isolating rebuilds with Riverpod.
- **BLoC and Riverpod examples:** Provides Cubit, notifier and derived provider examples for managing application state.
- **Auth-guarded routing:** Demonstrates GoRouter redirects that react to authentication changes.
- **Dio networking with token refresh:** Shows interceptors that attach bearer tokens and retry once after a 401 response.
- **Testing references:** Includes unit, BLoC and widget test examples using fakes and provider overrides.

## Good for

- Review a Flutter widget for rebuild and const issues
- Set up GoRouter with a login redirect
- Add a Riverpod provider that derives a cart total
- Write BLoC tests for a login Cubit
- Add Dio interceptors that refresh an expired token
- Check async code for unsafe BuildContext use after await

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/dart-flutter-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dart-flutter-patterns &&
cp -R "$tmp/.agents/skills/dart-flutter-patterns" ~/.claude/skills/dart-flutter-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/dart-flutter-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/dart-flutter-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dart-flutter-patterns &&
cp -R "$tmp/.agents/skills/dart-flutter-patterns" ~/.agents/skills/dart-flutter-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/dart-flutter-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/dart-flutter-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dart-flutter-patterns &&
cp -R "$tmp/.agents/skills/dart-flutter-patterns" ~/.cursor/skills/dart-flutter-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/dart-flutter-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/dart-flutter-patterns
```

Or copy the folder to `~/.gemini/skills/dart-flutter-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/dart-flutter-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dart-flutter-patterns &&
cp -R "$tmp/.agents/skills/dart-flutter-patterns" ~/.copilot/skills/dart-flutter-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/dart-flutter-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/dart-flutter-patterns` into your agent's skills folder as `dart-flutter-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs no scripts or tools. It is a set of instructions and code patterns that an agent reads when working on Dart or Flutter code.

### When does Dart flutter patterns trigger?

It is meant for writing or reviewing Dart and Flutter code around state, widgets, navigation, networking or architecture.

### Which state management libraries does Dart flutter patterns cover?

It covers BLoC and Cubit, Riverpod and Provider, with examples for BLoC and Riverpod.

### How do I install Dart flutter patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/dart-flutter-patterns to use it in all your projects, or to .claude/skills/dart-flutter-patterns in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Dart flutter patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Dart flutter patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Dart flutter patterns?

The closest alternatives to Dart flutter patterns are Dart use pattern matching, Dart generate test mocks, Dart add unit test, Flutter add widget test and Flutter testing skill.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Dart use pattern matching](https://ai-powered.com/skills/dart-use-pattern-matching): Dart use pattern matching is an open-source agent skill for developer tools.
- [Dart generate test mocks](https://ai-powered.com/skills/dart-generate-test-mocks): Dart generate test mocks is an open-source agent skill for developer tools.
- [Dart add unit test](https://ai-powered.com/skills/dart-add-unit-test): Dart add unit test is an open-source agent skill for developer tools.
- [Flutter add widget test](https://ai-powered.com/skills/flutter-add-widget-test): Flutter add widget test is an open-source agent skill for developer tools.
- [Flutter testing skill](https://ai-powered.com/skills/flutter-testing-skill): Flutter testing skill is an open-source agent skill for developer tools.
- [Flutter SDK changelog](https://ai-powered.com/skills/flutter-sdk-changelog): Flutter SDK changelog is an open-source agent skill for developer tools.
- [Compose multiplatform patterns](https://ai-powered.com/skills/compose-multiplatform-patterns): Compose multiplatform patterns is an open-source agent skill for developer tools.
- [Dart use path package](https://ai-powered.com/skills/dart-use-path-package): Dart use path package is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/dart-flutter-patterns
