Flutter ui
Pixel-perfect Flutter UI β smooth animations, GoRouter navigation, back/forth logic, Riverpod + Provider state management. Use when building Flutter screens, navigation flows, animations, or state-connected widgets.From its SKILL.md
npx -y skills add Naimehossein77/claude-flutter-ui-skills --skill flutter-uiAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.4 KB, ~2.1k tokens by cl100k_base, as published. Nobody here has run it
Flutter UI System
Philosophy: Flutter owns every pixel. Const-first. Theme-driven. GPU-animated. State-scoped.
π§ Runtime Scripts
| Script | Purpose | Usage |
|---|---|---|
scripts/flutter_ui_audit.py | Audit: missing const, dispose leaks, deprecated APIs | python scripts/flutter_ui_audit.py <path> |
π΄ MANDATORY: Read Reference Files First
β DO NOT code until relevant files are read:
| File | Content | Priority |
|---|---|---|
| flutter-design-thinking.md | Anti-memorization, forces context analysis | β¬ CRITICAL FIRST |
| flutter-state-ui.md | Riverpod + Provider rules Claude MUST enforce | β¬ CRITICAL |
| flutter-navigation.md | GoRouter, PopScope, back logic, deep links | β¬ CRITICAL |
| flutter-animations.md | Implicit, explicit, Hero, page transitions, physics | β¬ CRITICAL |
| flutter-performance.md | const, RepaintBoundary, 60fps, shader warmup | β¬ CRITICAL |
| flutter-theme-system.md | Material 3, ColorScheme, TextTheme, ThemeExtension | β¬ Read |
| flutter-layout-system.md | Responsive, LayoutBuilder, MediaQuery, Slivers | β¬ Read |
| flutter-custom-paint.md | Canvas, CustomPainter, pixel-perfect rendering | β¬ Read |
π§ flutter-design-thinking.md FIRST β prevents AI from applying memorized patterns.
β οΈ ASK BEFORE ASSUMING
| Aspect | Ask |
|---|---|
| State manager | "Riverpod, Provider, BLoC, or vanilla?" |
| Navigation | "GoRouter, auto_route, or Navigator 1.0?" |
| Design system | "Material 3, Cupertino, or custom?" |
| Platforms | "Mobile only, or tablet/desktop adaptive?" |
| Flutter version | "3.12+? (PopScope vs WillPopScope)" |
β ANTI-PATTERNS
Performance
| β NEVER | β ALWAYS |
|---|---|
ListView with static children for long lists | ListView.builder |
setState in animation loop | AnimatedBuilder |
Opacity(opacity: 0) to hide | Visibility or conditional render |
IntrinsicHeight/IntrinsicWidth in lists | Fixed heights or SliverFixedExtentList |
Missing const on StatelessWidget | const MyWidget({super.key}) always |
Column + ListView without Expanded | Wrap ListView in Expanded |
Hardcoded Color(0xFF...) in widgets | Theme.of(context).colorScheme.primary |
Hardcoded fontSize | Theme.of(context).textTheme.bodyLarge |
Animation
| β NEVER | β ALWAYS |
|---|---|
Animate width/height | Animate Transform (scale/translate) |
AnimationController without dispose() | Dispose in dispose() method |
addListener(() => setState((){})) | AnimatedBuilder |
Missing RepaintBoundary on complex painters | Wrap CustomPaint in RepaintBoundary |
| Hero tag collision | Unique data-driven tags |
| No easing curve | Curves.easeInOut minimum |
Navigation
| β NEVER | β ALWAYS |
|---|---|
WillPopScope (Flutter 3.12+ deprecated) | PopScope with canPop + onPopInvokedWithResult |
Navigator.push in GoRouter app | context.go() / context.push() |
| Hardcoded route strings everywhere | Centralized route constants |
| No route guard for auth screens | GoRouter redirect callback |
| Back button does nothing at root | PopScope(canPop: false) + exit dialog |
State
| β NEVER | β ALWAYS |
|---|---|
ref.read() in build() (Riverpod) | ref.watch() in build() |
Provider defined inside build() | Top-level final myProvider = ... |
context.read<T>() in build() (Provider) | context.watch<T>() in build() |
BuildContext in ChangeNotifier | Pass data, not context |
notifyListeners() before mutation | Mutate first, then notifyListeners() |
.when() without error handler | Always when(data:, loading:, error:) |
Consumer<T> wrapping entire screen | Selector<T, R> on smallest widget |
πΊοΈ Navigation: go() vs push() vs replace()
| Method | Back Stack | Use When |
|---|---|---|
context.go('/path') | Replaces stack | Tab switching, auth redirect |
context.push('/path') | Adds to stack | Drill-down navigation |
context.replace('/path') | Replaces current, no pop | Login β Home after auth |
context.pop() | Removes current | Back button, close modal |
context.pop(result) | Removes + returns data | Form submit, picker result |
π¬ Animation Selection
WHAT ARE YOU ANIMATING?
βββ Simple property change β AnimatedContainer, AnimatedOpacity, TweenAnimationBuilder
βββ Complex sequence/stagger β AnimationController + CurvedAnimation + AnimatedBuilder
βββ Shared element (cross-screen) β Hero widget + unique tag
βββ Page enter/exit β GoRouter CustomTransitionPage or pageBuilder
βββ Spring/bounce/momentum β SpringSimulation, BouncingScrollPhysics
βββ Vector/sprite β Rive or Lottie package
GPU-safe: transform, opacity β smooth
CPU-bound: width, height, margin, padding β jank
π State Manager Auto-Detect
Scan imports before writing any state code:
| Import Found | Use |
|---|---|
flutter_riverpod | Riverpod rules |
provider package | Provider rules |
| Neither | Ask user β recommend Riverpod for new projects |
β‘ Performance Quick Reference
class MyCard extends StatelessWidget {
const MyCard({super.key});
@override
Widget build(BuildContext context) => const Padding(
padding: EdgeInsets.all(16),
child: Text('Hello'),
);
}
RepaintBoundary(child: AnimatedWidget(...))
ListView.builder(itemCount: n, itemBuilder: (ctx, i) => Item(items[i]))
final name = ref.watch(userProvider.select((u) => u.name));
π§ CHECKPOINT (Fill Before Any Flutter Work)
π§ FLUTTER CHECKPOINT:
State: [ Riverpod / Provider / BLoC / Vanilla ]
Navigation: [ GoRouter / auto_route / Navigator 1.0 ]
Design: [ Material 3 / Cupertino / Custom ]
Platforms: [ Mobile / Tablet / Desktop / Web ]
Files Read: [ List files read ]
3 Rules I Will Apply:
1. _______________
2. _______________
3. _______________
Anti-Patterns I Will Avoid:
1. _______________
2. _______________
π΄ Can't fill checkpoint? β Read the skill files.
π Checklists
Per Screen
-
ConsumerWidgetif Riverpod?constconstructor? - Touch targets β₯ 48dp?
- Loading + error states defined?
- Back navigation tested (PopScope or GoRouter canPop)?
- No hardcoded colors or font sizes?
Per Animation
- Animating
transform/opacity, notwidth/height? -
AnimationController.dispose()called? - Duration β₯ 150ms with easing curve?
-
RepaintBoundaryon complex painters?
Pre-Release
- Run audit script β fix all π΄ findings
-
flutter analyzeβ no missing const warnings - Android back button tested β no stuck screens
- Dark mode tested β all colors from Theme
- Tablet layout tested β no overflow
- All
.when()handle error state
π Reference Files
| File | Use When |
|---|---|
| flutter-design-thinking.md | FIRST β prevents AI defaults |
| flutter-state-ui.md | Riverpod + Provider rules, patterns, migration |
| flutter-navigation.md | GoRouter, back logic, deep links, tabs |
| flutter-animations.md | Implicit, explicit, Hero, transitions, physics |
| flutter-theme-system.md | Material 3, ColorScheme, TextTheme |
| flutter-layout-system.md | Responsive, LayoutBuilder, Slivers |
| flutter-performance.md | const, RepaintBoundary, DevTools |
| flutter-custom-paint.md | Canvas, CustomPainter, pixel-perfect |
Pixel-perfect = every spacing, color, and type choice is intentional and theme-driven. Own the pixels through your design system, not magic numbers.
What ships with it: 9 files
61.2 KB alongside SKILL.md, 1 of them executable
scripts/
- flutter_ui_audit.pyruns16.9 KB
- flutter-animations.md5.7 KB
- flutter-custom-paint.md5.4 KB
- flutter-design-thinking.md4.0 KB
- flutter-layout-system.md5.4 KB
- flutter-navigation.md7.1 KB
- flutter-performance.md5.0 KB
- flutter-state-ui.md6.5 KB
- flutter-theme-system.md5.1 KB