Skill Market

dart flutter patterns

本番環境対応のDartおよびFlutterパターンは、null安全性、不変状態、非同期構成、ウィジェットアーキテクチャ、人気のある状態管理フレームワーク(BLoC、Riverpod、Provider)、GoRouterナビゲーション、Dioネットワーキング、Freezedコード生成、クリーンアーキテクチャをカバー。

GitHub
githubcommunity
0.0
0 installs262.1K GitHub starsby affaan-m

Skill Introduction

Overview
本番環境対応のDartおよびFlutterパターンは、null安全性、不変状態、非同期構成、ウィジェットアーキテクチャ、人気のある状態管理フレームワーク(BLoC、Riverpod、Provider)、GoRouterナビゲーション、Dioネットワーキング、Freezedコード生成、クリーンアーキテクチャをカバー。

Core value

Turns reusable Testing know-how into an installable skill, helping users complete github, community work faster.

Target users

  • Developers, testers, and maintainers who handle Testing tasks in Focus Code.
  • Teams that already trust workflows or content from affaan-m.
  • Users who want standardized prompts, steps, or conventions instead of repeating setup work.

Best practices

  • Read the skill content first to confirm required inputs, expected outputs, and dependencies.
  • Try it on a small task before relying on it for critical work.
  • Add project-specific constraints such as coding style, target platform, test expectations, and delivery format.
  • For external sources, verify the source link, version, and recent maintenance activity.

Best use cases

  • Tasks related to github, community that need a reusable execution flow.
  • Converting a community repo, team convention, or personal workflow into day-to-day assistance.
  • Starting from a proven skill instead of writing prompts or procedures from scratch.

Limits and boundaries

  • Results depend on the quality of the original skill content and may need human correction.
  • It does not replace code review, tests, security review, or professional judgment.
  • External tools, APIs, account permissions, and local dependencies still need separate setup.

Differentiation

  • Structured around Testing, making it easier to discover and reuse than loose prompt snippets.
  • Marked as GitHub, which helps users judge trust and maintenance expectations.
  • Keeps the original source link available for repository, documentation, or discussion follow-up.
  • Tagged with github, community, so it can be filtered by concrete task intent.

Install and use

Install
Copy Install Command
focus install dart-flutter-patterns-6d7802
View source

Detail Preview

SKILL.md

Primary filemarkdown4 KB

name: dart-flutter-patterns description: 本番環境対応のDartおよびFlutterパターンは、null安全性、不変状態、非同期構成、ウィジェットアーキテクチャ、人気のある状態管理フレームワーク(BLoC、Riverpod、Provider)、GoRouterナビゲーション、Dioネットワーキング、Freezedコード生成、クリーンアーキテクチャをカバー。 origin: ECC

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: [...],
);

詳細については、ドキュメントを参照してください。

Reviews

Overall rating

0.0
0.0

0 comments

No reviews yet