flutter-patterns

Implements Flutter design systems, responsive layouts, and widget testing patterns.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill flutter-patterns-hamza-haadi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-patterns
Source: https://github.com/Hamza-Haadi/disease-risk-classifier-hamza/tree/main/.claude/skills/19-flutter-patterns
Command: npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill flutter-patterns-hamza-haadi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter teams often ship inconsistent UIs with hardcoded colors, magic spacing numbers, and fragile widget tests that fail on off-screen elements or async validation. This Skill provides production-tested patterns for building token-based design systems, responsive layouts, and reliable Flutter tests. ## Core Features & Use Cases - Design System Creation: Step-by-step phased guide covering color tokens, typography, spacing, shadows, dark mode palettes, and 16 reusable components with a single-import pattern. - Responsive Layouts: Breakpoint definitions (mobile/tablet/desktop), ResponsiveBuilder, AdaptiveGrid, AdaptiveFilter, and AdaptiveForm widgets for cross-platform screens. - Testing Patterns: Proven fixes for widget test failures including ensureVisible for off-screen widgets and pumpAndSettle for validation and async states. - Use Case: When building a new Flutter app, use this Skill to scaffold a complete design system with light/dark themes, then write widget tests that pass reliably across mobile, tablet, and desktop viewports. ## Quick Start Ask the AI to create a Flutter design system with color tokens, typography, and responsive breakpoints following the flutter-patterns skill.

Frequently Asked Questions about flutter-patterns

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

FAQPage Schema
How do I create a Flutter design system from scratch?▼

Follow a phased approach: set up a lib/core/design directory, define color, typography, spacing, and shadow tokens, build 8-16 core components, add responsive utilities, and create a component showcase app. Use a single design_system.dart export file for all imports.

How to make Flutter layouts responsive across mobile, tablet, and desktop?▼

Use a ResponsiveBuilder widget with breakpoints at 600px (mobile), 1024px (tablet), and 1440px (desktop). Combine it with AdaptiveGrid, AdaptiveFilter, and AdaptiveForm widgets that automatically adjust column counts and layouts per screen size.

Why does Flutter widget test fail when tapping a button?▼

The button is likely rendered outside the 600px test viewport. Call tester.ensureVisible() to scroll it into view, then pumpAndSettle() before tapping. This pattern fixed 49 real-world auth test failures.

Should I use pump or pumpAndSettle in Flutter tests?▼

Use pumpAndSettle() after interactions that trigger validation, async operations, loading states, or animations. Use pump() only for simple synchronous widget updates or when stepping through animation frames manually.

Does the Flutter design system support dark mode?▼

Yes, it includes a separate AppColorsDark palette following Material Design 3 dark theme principles with muted saturation and higher contrast. All components adapt automatically through Theme.of(context) brightness detection.

When should I create custom Flutter components instead of using the design system?▼

Only create a new component when no existing component fits the use case and it will be reused across three or more features. New components must support light and dark mode, use design tokens, and be added to the showcase and tests.