dart-flutter-patterns

Generate Dart and Flutter feature skeletons with Riverpod, Dio, and GoRouter.

Updated Sep 13, 2025
One-click install
npx skills add https://github.com/llmh333/employee_management_spring --skill dart-flutter-patterns-llmh333
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-flutter-patterns
Source: https://github.com/llmh333/employee_management_spring/tree/main/.gemini/skills/dart-flutter-patterns
Command: npx skills add https://github.com/llmh333/employee_management_spring --skill dart-flutter-patterns-llmh333

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Dart and Flutter developers struggle to consistently write null-safe, maintainable, production-ready code for state management, navigation, networking, and testing.

Core Features & Use Cases

  • Null safety & sealed/immutable state: Use pattern matching and sealed types (with freezed) to prevent runtime null errors and impossible UI states.
  • Async composition & UI safety: Coordinate concurrent work (Future.wait) and avoid using BuildContext after await with mounted checks.
  • Production architecture for apps: Apply widget architecture, BLoC/Cubit or Riverpod patterns, GoRouter auth redirects, Dio interceptors with guarded token refresh, and pragmatic error handling and testing.

Quick Start

Ask the skill to generate an end-to-end Dart/Flutter feature skeleton using Riverpod state, Dio networking with an auth refresh interceptor, and GoRouter protected routes for a null-safe async flow.

Frequently Asked Questions about dart-flutter-patterns

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

FAQPage Schema
How do I implement secure Dio interceptors for token refresh in Flutter?

Implement secure Dio interceptors by setting up guarded token refresh logic that handles authentication retries safely. This pattern protects networking requests from failures during token expiration and ensures robust HTTP communication in your Flutter app.

What is the best way to manage immutable state with Riverpod or BLoC in Flutter?

The best way to manage immutable state is using sealed types and freezed for pattern matching. This approach prevents runtime null errors and impossible UI states by enforcing null-safe, union state design within Riverpod or BLoC/Cubit architectures.

How do I configure GoRouter navigation with reactive authentication guards in Flutter?

Configure GoRouter navigation with reactive authentication guards by applying protected route redirects. This pattern ensures secure routing by dynamically redirecting unauthenticated users, maintaining safe async UI interactions without invalid BuildContext usage.

How do I avoid using BuildContext after await in Flutter async operations?

Avoid using BuildContext after await by implementing mounted checks before UI interaction. This pattern coordinates concurrent work safely using Future.wait and satisfies null-safety requirements to prevent state errors during async composition.

Can I generate a full Flutter feature skeleton with Riverpod, Dio, and GoRouter?

Yes, you can generate an end-to-end Flutter feature skeleton integrating Riverpod state, Dio networking with auth refresh interceptors, and GoRouter protected routes. This provides a production-ready architecture satisfying null-safe async flow requirements.