dart-flutter-patterns

Solid

Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.

AI & Automation 196,640 stars 30253 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Dart/Flutter Patterns ## When to Use Use this skill when: - Starting a new Flutter feature and need idiomatic patterns for state management, navigation, or data access - Reviewing or writing Dart code and need guidance on null safety, sealed types, or async composition - Setting up a new Flutter project and choosing between BLoC, Riverpod, or Provider - Implementing secure HTTP clients, WebView integration, or local storage - Writing tests for Flutter widgets, Cubits, or Riverpod providers - Wiring up GoRouter with authentication guards ## How It Works This skill provides copy-paste-ready Dart/Flutter code patterns organized by concern: 1. **Null safety** — avoid `!`, prefer `?.`/`??`/pattern matching 2. **Immutable state** — sealed classes, `freezed`, `copyWith` 3. **Async composition** — concurrent `Future.wait`, safe `BuildContext` after `await` 4. **Widget architecture** — extract to classes (not methods), `const` propagation, scoped rebuilds 5. **State management** — BLoC/Cubit events, Riverpod notifiers and derived providers 6. **Navigation** — GoRouter with reactive auth guards via `refreshListenable` 7. **Networking** — Dio with interceptors, token refresh with one-time retry guard 8. **Error handling** — global capture, `ErrorWidget.builder`, crashlytics wiring 9. **Testing** — unit (BLoC test), widget (ProviderScope overrides), fakes over mocks ## Examples ```dart // Sealed state — prevents impossible states sealed class AsyncState<T> {} final class Loading<...

Details

Author
affaan-m
Repository
affaan-m/everything-claude-code
Created
4 months ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Integrates with

Related Skills