Flutter Development Guide
A practical guide for building cross-platform applications with Flutter 3 and Dart. Focuses on proven patterns, state management, and performance optimization.
Quick Reference
Widget Patterns
| Purpose |
Component |
| State management (simple) |
StateProvider + ConsumerWidget |
| State management (complex) |
NotifierProvider / Bloc |
| Async data |
FutureProvider / AsyncNotifierProvider |
| Real-time streams |
StreamProvider |
| Navigation |
GoRouter + context.go/push |
| Responsive layout |
LayoutBuilder + breakpoints |
| List display |
ListView.builder |
| Complex scrolling |
CustomScrollView + Slivers |
| Hooks |
HookWidget + useState/useEffect |
| Forms |
Form + TextFormField + validation |
Performance Patterns
| Purpose |
Solution |
| Prevent rebuilds |
const constructors |
| Selective updates |
ref.watch(provider.select(...)) |
| Isolate repaints |
RepaintBoundary |
| Lazy lists |
ListView.builder |
| Heavy computation |
compute() isolate |
| Image caching |
cached_network_image |
Core Principles
Widget Optimization
- Use
const constructors wherever possible
- Extract static widgets to separate const classes
- Use
Key for list items (ValueKey, ObjectKey)
- Prefer
ConsumerWidget over StatefulWidget for state
State Management
- Riverpod for dependency injection and simple state
- Bloc/Cubit for event-driven workflows and complex logic
- Never mutate state directly (create new instances)
- Use
select() to minimize rebuilds
Layout
- 8pt spacing increments (8, 16, 24, 32, 48)
- Responsive breakpoints: mobile (<650), tablet (650-1100), desktop (>1100)
- Support all screen sizes with flexible layouts
- Follow Material 3 / Cupertino design guidelines
Performance
- Profile with DevTools before optimizing
- Target <16ms frame time for 60fps
- Use
RepaintBoundary for complex animations
- Offload heavy work with
compute()
Checklist
Widget Best Practices
State Management
Navigation
Performance
Testing
References
| Topic |
Reference |
| Widget patterns, const optimization, responsive layout |
Widget Patterns |
| Riverpod providers, notifiers, async state |
Riverpod State Management |
| Bloc, Cubit, event-driven state |
Bloc State Management |
| GoRouter setup, routes, deep linking |
GoRouter Navigation |
| Feature-based structure, dependencies |
Project Structure |
| Profiling, const optimization, DevTools |
Performance Optimization |
| Widget tests, integration tests, mocking |
Testing Strategies |
| iOS/Android/Web specific implementations |
Platform Integration |
| Implicit/explicit animations, Hero, transitions |
Animations |
| Dio, interceptors, error handling, caching |
Networking |
| Form validation, FormField, input formatters |
Forms |
| i18n, flutter_localizations, intl |
Localization |
Flutter, Dart, Material Design, and Cupertino are trademarks of Google LLC and Apple Inc. respectively. Riverpod, Bloc, and GoRouter are open-source packages by their respective maintainers.
1---2name: flutter-dev3description: |4 Flutter cross-platform development guide covering widget patterns, Riverpod/Bloc state management, GoRouter navigation, performance optimization, and platform-specific implementations. Includes const optimization, responsive layouts, testing strategies, and DevTools profiling.5 Use when: building Flutter apps, implementing state management (Riverpod/Bloc), setting up GoRouter navigation, creating custom widgets, optimizing performance, writing widget tests, cross-platform development.6license: MIT7metadata:8 source: https://skillmd.com/skills/minimax-ai/flutter-dev9 version: "1.0.0"10 category: mobile11 sources:12 - flutter-expert by Jeff Smolinski (https://github.com/Jeffallan/claude-skills) — Flutter expert skill framework13 - Flutter Documentation14 - Riverpod Documentation15 - Bloc Library Documentation16---1718# Flutter Development Guide1920A practical guide for building cross-platform applications with Flutter 3 and Dart. Focuses on proven patterns, state management, and performance optimization.2122## Quick Reference2324### Widget Patterns2526| Purpose | Component |27|---------|-----------|28| State management (simple) | `StateProvider` + `ConsumerWidget` |29| State management (complex) | `NotifierProvider` / `Bloc` |30| Async data | `FutureProvider` / `AsyncNotifierProvider` |31| Real-time streams | `StreamProvider` |32| Navigation | `GoRouter` + `context.go/push` |33| Responsive layout | `LayoutBuilder` + breakpoints |34| List display | `ListView.builder` |35| Complex scrolling | `CustomScrollView` + Slivers |36| Hooks | `HookWidget` + `useState/useEffect` |37| Forms | `Form` + `TextFormField` + validation |3839### Performance Patterns4041| Purpose | Solution |42|---------|----------|43| Prevent rebuilds | `const` constructors |44| Selective updates | `ref.watch(provider.select(...))` |45| Isolate repaints | `RepaintBoundary` |46| Lazy lists | `ListView.builder` |47| Heavy computation | `compute()` isolate |48| Image caching | `cached_network_image` |4950## Core Principles5152### Widget Optimization53- Use `const` constructors wherever possible54- Extract static widgets to separate const classes55- Use `Key` for list items (ValueKey, ObjectKey)56- Prefer `ConsumerWidget` over `StatefulWidget` for state5758### State Management59- Riverpod for dependency injection and simple state60- Bloc/Cubit for event-driven workflows and complex logic61- Never mutate state directly (create new instances)62- Use `select()` to minimize rebuilds6364### Layout65- 8pt spacing increments (8, 16, 24, 32, 48)66- Responsive breakpoints: mobile (<650), tablet (650-1100), desktop (>1100)67- Support all screen sizes with flexible layouts68- Follow Material 3 / Cupertino design guidelines6970### Performance71- Profile with DevTools before optimizing72- Target <16ms frame time for 60fps73- Use `RepaintBoundary` for complex animations74- Offload heavy work with `compute()`7576## Checklist7778### Widget Best Practices79- [ ] `const` constructors on all static widgets80- [ ] Proper `Key` on list items81- [ ] `ConsumerWidget` for state-dependent widgets82- [ ] No widget building inside `build()` method83- [ ] Extract reusable widgets to separate files8485### State Management86- [ ] Immutable state objects87- [ ] `select()` for granular rebuilds88- [ ] Proper provider scoping89- [ ] Dispose controllers and subscriptions90- [ ] Handle loading/error states9192### Navigation93- [ ] GoRouter with typed routes94- [ ] Auth guards via redirect95- [ ] Deep linking support96- [ ] State preservation across routes9798### Performance99- [ ] Profile mode testing (`flutter run --profile`)100- [ ] <16ms frame rendering time101- [ ] No unnecessary rebuilds (DevTools check)102- [ ] Images cached and resized103- [ ] Heavy computation in isolates104105### Testing106- [ ] Widget tests for UI components107- [ ] Unit tests for business logic108- [ ] Integration tests for user flows109- [ ] Bloc tests with `blocTest()`110111## References112113| Topic | Reference |114|-------|-----------|115| Widget patterns, const optimization, responsive layout | [Widget Patterns](references/widget-patterns.md) |116| Riverpod providers, notifiers, async state | [Riverpod State Management](references/riverpod-state.md) |117| Bloc, Cubit, event-driven state | [Bloc State Management](references/bloc-state.md) |118| GoRouter setup, routes, deep linking | [GoRouter Navigation](references/gorouter-navigation.md) |119| Feature-based structure, dependencies | [Project Structure](references/project-structure.md) |120| Profiling, const optimization, DevTools | [Performance Optimization](references/performance.md) |121| Widget tests, integration tests, mocking | [Testing Strategies](references/testing.md) |122| iOS/Android/Web specific implementations | [Platform Integration](references/platform-specific.md) |123| Implicit/explicit animations, Hero, transitions | [Animations](references/animations.md) |124| Dio, interceptors, error handling, caching | [Networking](references/networking.md) |125| Form validation, FormField, input formatters | [Forms](references/forms.md) |126| i18n, flutter_localizations, intl | [Localization](references/localization.md) |127128---129130Flutter, Dart, Material Design, and Cupertino are trademarks of Google LLC and Apple Inc. respectively. Riverpod, Bloc, and GoRouter are open-source packages by their respective maintainers.