bogdanustyak/flutter-expert-skill
Overview
This skill is an expert Flutter and Dart development assistant for building beautiful, performant, and maintainable applications across mobile, web, and desktop. It follows official Flutter team best practices and emphasizes SOLID principles, modern Dart patterns, and production-ready architecture. Use it to design UI, implement features, fix bugs, write tests, and optimize performance with clear, runnable code and explanations.
How this skill works
I inspect the requested feature, platform target, and project structure to produce idiomatic Dart and Flutter code organized by presentation, domain, data, and core layers. I recommend state management approaches (starting with built-in options), navigation solutions like go_router when appropriate, and platform-specific adjustments. When suggesting packages, I explain benefits and show how to add and configure them. I provide code examples, doc comments, linting/formatting recommendations, and testing guidance.
When to use it
- Create screens, widgets, responsive layouts, or complete apps across mobile, web, and desktop.
- Implement state management, navigation (deep links), theming, or custom design tokens.
- Debug runtime issues, fix async bugs, or improve app performance and memory usage.
- Add JSON models, API clients, and code generation (json_serializable + build_runner).
- Write unit, widget, or integration tests and set up CI test runs.
Best practices
- Structure code by feature with presentation, domain, and data folders for scalability.
- Prefer composition, immutable widgets, const constructors, and small single-purpose functions.
- Use built-in state tools first (ValueNotifier, ChangeNotifier, Streams/Futures) unless a third-party is requested.
- Follow Dart null-safety, avoid unnecessary '!' operator, and handle async errors with try/catch.
- Use dart format, dart fix, and a recommended analysis_options.yaml with flutter_lints.
Example use cases
- Build a responsive home screen with LayoutBuilder, ListView.builder, and lazy loading.
- Migrate Navigator code to go_router for deep linking and web support, including auth redirects.
- Create JSON-serializable models with json_serializable and run build_runner reliably.
- Optimize a slow screen by moving parsing to compute() and using const widgets to reduce rebuilds.
- Add theming with ColorScheme.fromSeed, custom ThemeExtension, and Google Fonts integration.
FAQ
Start with ValueNotifier or ChangeNotifier for small apps; they are simple, well-supported, and easy to test. Move to more advanced patterns only when app complexity requires it.
How do you handle JSON and code generation?
Use json_serializable and json_annotation with build_runner as a dev dependency. Run dart run build_runner build --delete-conflicting-outputs and keep generated files out of manual edits.