Apply Flutter design principles with Material Design and Cupertino (iOS-style) support when building cross-platform UI...
Build cross-platform Flutter apps with Material Design (Android) and Cupertino (iOS) support. This skill provides guidelines for adaptive widgets, theming, spacing, typography, and component patterns optimized for both platforms.
Activate this skill when:
Do NOT activate for:
Read references/design-principles.md - Cross-platform + adaptive design
Read references/color-system.md - Theme-based colors, dark mode
Read references/spacing-system.md - 8dp grid, EdgeInsets
Read references/typography.md - Material TextTheme, Cupertino text
Read references/component-patterns.md - Material + Cupertino widgets
Read references/anti-patterns.md - Common Flutter mistakes
Colors.black, Colors.white)8dp grid:
EdgeInsets.all(16.0), SizedBox(height: 16.0)Theme colors (auto dark mode):
Theme.of(context).colorScheme.primaryTheme.of(context).colorScheme.onSurfaceCupertinoTheme.of(context).primaryColorTextTheme (REQUIRED):
Theme.of(context).textTheme.headlineMediumTheme.of(context).textTheme.bodyMediumFlutter UI Component Request
│
├─ Material or Cupertino? → Material default, Cupertino for iOS feel
│
├─ What spacing? → 8dp grid (spacing-system.md)
│
├─ What colors? → Theme.of(context).colorScheme (color-system.md)
│
├─ What typography? → TextTheme (typography.md)
│
└─ Validation → Check anti-patterns.md
Good Request Flow:
User: "Create a login form in Flutter"
→ Read references/component-patterns.md (TextField section)
→ Apply: TextField, Theme colors, TextTheme, 8dp spacing
→ Validate: No hardcoded colors, proper widget tree
→ Implement with Column { TextField, ElevatedButton }
Implementation Checklist:
Text(
'제목',
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
)
ElevatedButton(
onPressed: () {},
child: Text('확인'),
)
Text(
'제목',
style: TextStyle(fontSize: 24.0, color: Colors.black), // ❌
)
Widget build(BuildContext context) {
if (Theme.of(context).platform == TargetPlatform.iOS) {
return CupertinoButton(child: Text('확인'), onPressed: () {});
}
return ElevatedButton(child: Text('확인'), onPressed: () {});
}
MaterialApp(
theme: lightTheme,
darkTheme: darkTheme,
themeMode: ThemeMode.system, // Auto dark mode
)