
Dart Flutter Patterns
- 1.4k installs
- 238k repo stars
- Updated August 5, 2026
- affaan-m/ecc
This is a copy of dart-flutter-patterns by affaan-m - installs and ranking accrue to the original listing.
dart-flutter-patterns is a Claude Code skill that provides copy-paste Dart and Flutter patterns for null safety, state management, GoRouter, and clean architecture for developers building production mobile apps with BLoC
About
dart-flutter-patterns is an ECC skill with production-ready, copy-paste Dart and Flutter patterns organized by concern. Coverage includes null safety (avoiding `!`, preferring `?.`/`??`/pattern matching), immutable state with sealed types, freezed, and copyWith, async composition, widget architecture, BLoC, Riverpod, and Provider state management, GoRouter navigation with auth guards, Dio HTTP clients, Freezed code generation, WebView integration, local storage, and widget/Cubit/Riverpod tests. Developers reach for dart-flutter-patterns when starting Flutter features, choosing state libraries, wiring authenticated routes, or reviewing Dart for null-safety and sealed-type conventions. The skill accelerates consistent mobile code instead of mixing ad hoc patterns across modules.
- 7 core pattern categories including null safety, immutable state, async composition, widget architecture, state manageme
- Covers BLoC, Riverpod, Provider, GoRouter with auth guards, Dio clients, Freezed code generation
- Includes secure HTTP patterns, WebView integration, local storage and widget testing guidance
- Delivers idiomatic Dart with sealed classes, pattern matching and const propagation
- Next-skill handoff to implementation after pattern selection
Dart Flutter Patterns by the numbers
- 1,393 all-time installs (skills.sh)
- +89 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/affaan-m/ecc --skill dart-flutter-patternsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.4k |
|---|---|
| repo stars | ★ 238k |
| Last updated | August 5, 2026 |
| Repository | affaan-m/ecc ↗ |
How do you structure Flutter apps with clean architecture?
Get production-ready, copy-paste Dart and Flutter patterns for state management, navigation, networking and clean architecture.
Who is it for?
Flutter developers implementing features with BLoC, Riverpod, or Provider who need GoRouter, Dio, Freezed, and null-safe Dart patterns.
Skip if: Native iOS SwiftUI or Android Jetpack Compose projects without Dart or Flutter dependencies.
When should I use this skill?
The user builds Flutter features, picks BLoC vs Riverpod vs Provider, wires GoRouter auth guards, or writes Dio and Freezed data layers.
What you get
Copy-paste Flutter modules with state management, GoRouter routes, Dio clients, and Freezed immutable models
- State management modules
- GoRouter route configuration
- Dio and Freezed data layer code
By the numbers
- Covers three state management frameworks: BLoC, Riverpod, and Provider
Files
Dart/Flutterパターン
使用時期
次の場合にこのスキルを使用:
- 新しいFlutter機能を開始し、状態管理、ナビゲーション、またはデータアクセスのイディオマティックパターンが必要
- Dartコードのレビューまたは作成とnull安全性、シール型、非同期構成のガイダンスが必要
- 新しいFlutterプロジェクトをセットアップしBLoC、Riverpod、またはProviderのうち選択
- 安全なHTTPクライアント、WebView統合、ローカルストレージを実装
- FlutterウィジェットEt、Cubit、またはRiverpodプロバイダーのテストを作成
- GoRouterを認証ガードでワイヤリング
動作方法
このスキルは、懸念事項で整理されたコピーペーストの準備ができたDart/Flutterコードパターンを提供: 1. Null安全性 — !を避ける、?./??/パターンマッチングを好む 2. 不変状態 — シール型、freezed、copyWith 3. 非同期構成 — 並行Future.wait、await後の安全なBuildContext 4. ウィジェットアーキテクチャ — クラスに抽出(メソッドではなく)、const伝播、スコープ付きリビルド 5. 状態管理 — BLoC/Cubityベント、Riverpodノーティファイアおよび派生プロバイダー 6. ナビゲーション — refreshListenable経由の反応型認証ガード付きGoRouter 7. ネットワーキング — インターセプタ付きDio、ワンタイム再試行ガード付きトークンリフレッシュ 8. エラーハンドリング — グローバルキャプチャ、ErrorWidget.builder、crashlyticsワイヤリング 9. テスト — ユニット(BLoC test)、ウィジェット(ProviderScopeオーバーライド)、モック上のフェイク
例
// シール状態 — 不可能な状態を防止
sealed class AsyncState<T> {}
final class Loading<T> extends AsyncState<T> {}
final class Success<T> extends AsyncState<T> { final T data; const Success(this.data); }
final class Failure<T> extends AsyncState<T> { final Object error; const Failure(this.error); }
// 反応型認証リダイレクト付きGoRouter
final router = GoRouter(
refreshListenable: GoRouterRefreshStream(authCubit.stream),
redirect: (context, state) {
final authed = context.read<AuthCubit>().state is AuthAuthenticated;
if (!authed && !state.matchedLocation.startsWith('/login')) return '/login';
return null;
},
routes: [...],
);詳細については、ドキュメントを参照してください。
Related skills
How it compares
Use dart-flutter-patterns over generic mobile skills when the stack is Flutter with GoRouter, Dio, and Freezed rather than cross-framework abstractions.
FAQ
Which state libraries does dart-flutter-patterns cover?
dart-flutter-patterns documents idiomatic patterns for BLoC, Riverpod, and Provider, plus Cubit and Riverpod provider testing. It also covers GoRouter navigation with auth guards, Dio networking, Freezed immutable models, and null-safe Dart conventions.
What Flutter concerns are included?
dart-flutter-patterns spans null safety, immutable state with freezed and copyWith, async composition, widget architecture, HTTP with Dio, WebView integration, local storage, and clean architecture layouts with copy-paste-ready code for production Flutter apps.