flutter-development
Comprehensive Flutter development guidance covering widget composition (including ADHD-friendly UI patterns), state management (Bloc and Riverpod), navigation with go_router, platform-specific code for iOS/Android/Web/Desktop, Material Design 3 implementation, and performance optimization. Use when building Flutter applications, implementing state management, creating cross-platform features, optimizing performance, or designing accessible user interfaces.
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- flutter-development
- description
- Comprehensive Flutter development guidance covering widget composition (including ADHD-friendly UI patterns), state management (Bloc and Riverpod), navigation with go_router, platform-specific code for iOS/Android/Web/Desktop, Material Design 3 implementation, and performance optimization. Use when building Flutter applications, implementing state management, creating cross-platform features, optimizing performance, or designing accessible user interfaces.
02 资源文件 7
- 参考文档references/adhd_friendly_ui.md8.6 KB
- 参考文档references/material_design_3.md17.0 KB
- 参考文档references/navigation_routing.md15.1 KB
- 参考文档references/performance_optimization.md16.6 KB
- 参考文档references/platform_specific.md17.0 KB
- 参考文档references/state_management.md13.2 KB
- 参考文档references/widget_composition.md18.2 KB
03 SKILL.md 正文
Flutter Development
Overview
Provide expert guidance on Flutter application development with focus on modern best practices, accessible UI design, efficient state management, and cross-platform development. Leverage comprehensive reference documentation for detailed patterns and techniques.
When to Use This Skill
Use this skill when:
- Building or maintaining Flutter applications
- Implementing state management with Bloc or Riverpod
- Creating ADHD-friendly or accessible user interfaces
- Setting up navigation and routing (especially with go_router)
- Writing platform-specific code for iOS, Android, Web, or Desktop
- Implementing Material Design 3 components and theming
- Optimizing Flutter app performance
- Designing reusable widget compositions
- Debugging performance issues or memory leaks
- Migrating from Material 2 to Material 3
Core Capabilities
1. ADHD-Friendly UI Design
Create user interfaces optimized for users with ADHD, following principles that reduce cognitive load and improve focus.
Key considerations:
- Minimize visual clutter and distractions
- Establish clear visual hierarchies
- Provide immediate, obvious feedback
- Use card-based layouts for information chunking
- Implement focus management and progressive disclosure
- Apply consistent color coding for states
Reference: Load references/adhd_friendly_ui.md for comprehensive patterns including:
- Simplified navigation patterns
- Distraction-free mode implementations
- Progress visualization techniques
- Typography and spacing guidelines
- Form design best practices
Example request: "Design a task management screen with ADHD-friendly UI patterns"
2. State Management
Implement robust state management using Bloc (event-driven) or Riverpod (reactive) patterns.
Choose Bloc when:
- Building large-scale applications with complex business logic
- Need clear separation between UI and business logic
- Want predictable state transitions with events
- Prefer event-driven architecture
Choose Riverpod when:
- Need simpler, more flexible state management
- Want compile-time safety
- Building small to medium applications
- Prefer declarative, reactive patterns
Reference: Load references/state_management.md for:
- Complete Bloc implementation patterns with sealed classes
- Riverpod provider types and advanced patterns
- Testing strategies for both approaches
- Performance optimization techniques
- Migration guides between state management solutions
Example requests:
- "Implement authentication flow using Bloc with loading states"
- "Create a Riverpod provider for user profile data with caching"
- "Set up state management for a shopping cart feature"
3. Navigation and Routing
Implement modern, declarative navigation using go_router with support for deep linking, route guards, and nested navigation.
Key capabilities:
- Declarative routing with go_router
- Nested routes and shell routes
- Route guards and redirects
- Deep linking for iOS, Android, and Web
- Integration with state management (Bloc/Riverpod)
- Platform-specific navigation patterns
Reference: Load references/navigation_routing.md for:
- go_router setup and configuration
- Shell routes for persistent UI (bottom nav, drawer)
- Deep linking implementation
- Route guards and authentication flows
- Custom page transitions
- Multi-platform navigation patterns
Example requests:
- "Set up go_router with authentication guards"
- "Implement bottom navigation that persists across routes"
- "Add deep linking support for product details pages"
4. Platform-Specific Code
Handle platform differences across iOS, Android, Web, Desktop (Windows, macOS, Linux), and embedded platforms.
Key capabilities:
- Platform detection and conditional code
- Platform channels (Method and Event channels)
- Adaptive widgets (Material vs Cupertino)
- Platform-specific permissions
- Conditional imports
- Responsive design for different form factors
Reference: Load references/platform_specific.md for:
- Platform detection patterns
- Platform channel implementation (iOS Swift, Android Kotlin)
- Adaptive widget patterns
- Permission handling per platform
- Desktop-specific features (window management, system tray)
- Web-specific features (URL strategy, JavaScript interop)
Example requests:
- "Implement platform-specific camera functionality"
- "Create adaptive UI that uses Cupertino on iOS and Material on Android"
- "Add desktop window management features"
- "Implement platform channels to access native APIs"
5. Material Design 3
Implement Material Design 3 (Material You) with dynamic colors, updated components, and modern theming.
Key capabilities:
- Material 3 color system with dynamic colors
- Updated component library
- Typography and shape system
- Tonal elevation
- Dark theme support
- Migration from Material 2
Reference: Load references/material_design_3.md for:
- Complete Material 3 setup and configuration
- Color scheme generation from seed colors
- All Material 3 components with examples
- Dynamic color support (Android 12+)
- Component theming
- Migration guide from Material 2
Example requests:
- "Set up Material 3 theming with dynamic colors"
- "Implement NavigationBar with badges"
- "Create a dark theme variant"
- "Migrate this Material 2 app to Material 3"
6. Performance Optimization
Optimize Flutter apps for smooth 60fps rendering, minimal memory usage, and fast load times.
Key areas:
- Widget optimization (const constructors, RepaintBoundary)
- List performance (ListView.builder, itemExtent)
- Image optimization (caching, sizing)
- Build method optimization
- Memory management (resource disposal)
- Async operations (compute, debouncing)
- Animation performance
- Build size optimization
Reference: Load references/performance_optimization.md for:
- Profiling with Flutter DevTools
- Widget optimization techniques
- Image caching strategies
- Memory leak prevention
- Async operation best practices
- JSON parsing in isolates
- Testing performance
Example requests:
- "Optimize this ListView with many images"
- "Profile and fix performance issues in this animation"
- "Reduce app size and improve load time"
- "Fix memory leaks in this widget"
7. Widget Composition
Design reusable, maintainable widget hierarchies following Flutter best practices.
Key principles:
- Single responsibility per widget
- Composition over inheritance
- Proper use of const constructors
- Clear data flow (data down, callbacks up)
- Separation of concerns
- Testability
Reference: Load references/widget_composition.md for:
- Core composition principles
- Reusable widget patterns
- Layout patterns (responsive, spacing utilities)
- State management patterns
- Error handling patterns
- Testing patterns
- Anti-patterns to avoid
Example requests:
- "Refactor this large widget into smaller, reusable components"
- "Create a reusable product card component"
- "Design a responsive layout that works on mobile and desktop"
Workflow Guidelines
Initial Assessment
When receiving a Flutter development request:
- Identify the primary concern (UI, state, navigation, platform-specific, theming, performance)
- Determine which reference(s) to load based on the request
- Consider cross-cutting concerns (accessibility, performance, platform differences)
- Ask clarifying questions if requirements are ambiguous
Reference Loading Strategy
Load reference documentation as needed rather than all at once:
- Single focus requests: Load one reference file
- Complex requests: Load multiple references progressively
- Performance concerns: Always consider loading
performance_optimization.md - UI requests: Consider if
adhd_friendly_ui.mdapplies for better accessibility
Implementation Approach
Follow these principles when implementing solutions:
- Start with current Flutter best practices (Flutter 3.x, Dart 3.x)
- Use Material 3 unless Material 2 is explicitly required
- Apply const constructors wherever possible
- Consider performance implications from the start
- Think multi-platform unless single platform specified
- Prioritize accessibility and inclusive design
- Write testable code with clear separation of concerns
- Follow widget composition best practices (small, focused widgets)
Code Quality Standards
Ensure all generated code:
- Uses modern Flutter/Dart syntax (null safety, pattern matching, records)
- Follows official Dart style guide
- Includes necessary imports
- Uses meaningful variable and widget names
- Has appropriate const constructors
- Disposes resources properly (controllers, streams, listeners)
- Handles errors gracefully
- Is testable
Examples
Example 1: ADHD-Friendly Task Manager
Request: "Build a task management screen with ADHD-friendly UI"
Approach:
- Load
references/adhd_friendly_ui.md - Implement card-based layout for discrete information chunks
- Use clear visual hierarchy with Material 3 typography
- Provide immediate feedback for all actions
- Include progress indicators for multi-step tasks
- Apply simplified navigation patterns
- Consider focus mode for distraction-free work
Example 2: Authentication with Bloc
Request: "Implement authentication flow with Bloc"
Approach:
- Load
references/state_management.md - Create sealed classes for auth states (Initial, Loading, Authenticated, Unauthenticated, Error)
- Define auth events (Login, Logout, CheckAuth)
- Implement AuthBloc with proper event handlers
- Use BlocListener for navigation side effects
- Use BlocBuilder for UI rendering
- Add proper error handling
Example 3: Multi-Platform App
Request: "Create an app that works on iOS, Android, and Web"
Approach:
- Load
references/platform_specific.mdandreferences/navigation_routing.md - Set up go_router with web-friendly URLs
- Implement adaptive widgets for iOS/Android differences
- Handle platform-specific features (permissions, deep linking)
- Create responsive layouts for different screen sizes
- Test on all target platforms
Example 4: Performance Optimization
Request: "This list is laggy with many images"
Approach:
- Load
references/performance_optimization.md - Profile with Flutter DevTools to identify bottlenecks
- Switch to ListView.builder if not already using it
- Add itemExtent for fixed-height items
- Implement image caching with cached_network_image
- Use cacheWidth/cacheHeight to decode images at appropriate size
- Add RepaintBoundary if needed
- Extract static widgets to prevent unnecessary rebuilds
Additional Notes
- Stay Current: Follow Flutter's official blog and release notes for latest features
- Test Thoroughly: Always test on target platforms (physical devices when possible)
- Consider Accessibility: Use Semantics widgets and test with screen readers
- Document Decisions: Explain why specific patterns or approaches are chosen
- Performance First: Consider performance implications from the start, not as an afterthought
- Progressive Enhancement: Start with core functionality, add enhancements progressively
Resources
This skill includes comprehensive reference documentation in the references/ directory:
- adhd_friendly_ui.md: ADHD-friendly UI design patterns and principles
- state_management.md: Bloc and Riverpod implementation patterns
- navigation_routing.md: go_router and navigation best practices
- platform_specific.md: Cross-platform development techniques
- material_design_3.md: Material Design 3 implementation guide
- performance_optimization.md: Performance profiling and optimization
- widget_composition.md: Widget composition patterns and best practices
Load these references as needed to provide detailed, accurate guidance.
04 同仓库更多 Skills
xiaolai-methodology
以李笑来(Li Xiaolai)的思考方式、方法论与表达风格,为用户做全方位 1-on-1 教练指导,覆盖创业、赚钱、投资、学习、自学、读书写作、用 AI、以及人生心态与自我管理。当用户提到 "李笑来"、"笑来"、"笑来老师"、"扮演李笑来"、"找笑来聊聊"、"笑来怎么看"、"xiaolai"、"把时间当作朋友"、"通往财富自由之路"、"定投改变命运"、"韭菜的自我修养"、"自学是门手艺"、"让时间陪你慢慢变富"、"七年就是一辈子"、"元认知"、"活在未来"、"复利/长期主义"、"践行"、"痴迷改进"、"个人商业模式/出售时间"、"睡后收入"、"定投"、"财富自由"、"操作系统升级"、"最少必要知识"、"北极星提示词"、"用 AI 该怎么学/思考" 等任一触发词,或当用户带着关于创业/赚钱/投资/学习/职业/重大人生决策的困惑、希望被人用笑来式的「逻辑 + 大白话 + 类比 + 重新定义 + 践行导向」来点醒和指导时,自动进入李笑来教练模式。
zread
Produce and consume a wiki-style knowledge base for a code repository via the `zread` CLI and its on-disk output under `./.zread/wiki/`. Use this skill whenever the user wants to understand, onboard onto, explore, summarize, map, or get an overview of an unfamiliar codebase; asks for architecture docs, a project wiki, a repo walkthrough, module/package explanations, or "what does this repo do"; wants to generate, regenerate, resume, browse, or serve code documentation locally; or mentions zread / zread.ai directly. Also use it proactively before diving into a large unknown repo — if `./.zread/wiki/current` exists, read the generated pages instead of crawling source file-by-file; if it doesn't, consider offering to run `zread generate`. The trigger is the intent (understand a codebase through generated docs), not the literal word "zread".
youtube
Launch the YouTube Creator Agent to auto-generate videos. Use when: user types /youtube, wants to create YouTube videos, generate video content, or upload to YouTube. Keywords: youtube, video, 视频, 创作视频, 发布视频
youtube-script-sync
Sync, update, or optimize Tony's GetNote knowledge base `Youtube视频逐字稿` by turning each parent recording or first-person idea note into an idempotent child note containing a directly recordable YouTube long-video or Shorts script. Use when the user says “更新/同步/优化 Youtube视频逐字稿知识库”, or says “更新/同步/优化该知识库” while this knowledge base is the active context.
writing-skills
How to write SKILL.md files that trigger reliably and teach effectively. Use when creating, improving, or reviewing Claude Code skills.
writing-rules
How to write .claude/rules/ files that Claude actually follows. Use when creating, improving, or reviewing project rules.