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.
Source: MiniMax-AI/skills → skills/flutter-dev/SKILL.md
1---
2name: flutter-dev
3description: "| 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. 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."
4category: mobile-and-platform
5source_repo: MiniMax-AI/skills
6source_path: "skills/flutter-dev/SKILL.md"
7source_url: https://github.com/MiniMax-AI/skills/blob/HEAD/skills/flutter-dev/SKILL.md
8metadata:
9 source: https://skillmd.com/skills/thedixitjain/flutter-dev
10---
11
12
13# Flutter Development Guide
14
15A practical guide for building cross-platform applications with Flutter 3 and Dart. Focuses on proven patterns, state management, and performance optimization.
16
17## Quick Reference
18
19### Widget Patterns
20
21| Purpose | Component |
22|---------|-----------|
23| State management (simple) | `StateProvider` + `ConsumerWidget` |
24| State management (complex) | `NotifierProvider` / `Bloc` |
25| Async data | `FutureProvider` / `AsyncNotifierProvider` |
26| Real-time streams | `StreamProvider` |
27| Navigation | `GoRouter` + `context.go/push` |
28| Responsive layout | `LayoutBuilder` + breakpoints |
29| List display | `ListView.builder` |
30| Complex scrolling | `CustomScrollView` + Slivers |
31| Hooks | `HookWidget` + `useState/useEffect` |
32| Forms | `Form` + `TextFormField` + validation |
33
34### Performance Patterns
35
36| Purpose | Solution |
37|---------|----------|
38| Prevent rebuilds | `const` constructors |
39| Selective updates | `ref.watch(provider.select(...))` |
40| Isolate repaints | `RepaintBoundary` |
41| Lazy lists | `ListView.builder` |
42| Heavy computation | `compute()` isolate |
43| Image caching | `cached_network_image` |
44
45## Core Principles
46
47### Widget Optimization
48- Use `const` constructors wherever possible
49- Extract static widgets to separate const classes
50- Use `Key` for list items (ValueKey, ObjectKey)
51- Prefer `ConsumerWidget` over `StatefulWidget` for state
52
53### State Management
54- Riverpod for dependency injection and simple state
55- Bloc/Cubit for event-driven workflows and complex logic
56- Never mutate state directly (create new instances)
57- Use `select()` to minimize rebuilds
58
59### Layout
60- 8pt spacing increments (8, 16, 24, 32, 48)
61- Responsive breakpoints: mobile (<650), tablet (650-1100), desktop (>1100)
62- Support all screen sizes with flexible layouts
63- Follow Material 3 / Cupertino design guidelines
64
65### Performance
66- Profile with DevTools before optimizing
67- Target <16ms frame time for 60fps
68- Use `RepaintBoundary` for complex animations
69- Offload heavy work with `compute()`
70
71## Checklist
72
73### Widget Best Practices
74- [ ] `const` constructors on all static widgets
75- [ ] Proper `Key` on list items
76- [ ] `ConsumerWidget` for state-dependent widgets
77- [ ] No widget building inside `build()` method
78- [ ] Extract reusable widgets to separate files
79
80### State Management
81- [ ] Immutable state objects
82- [ ] `select()` for granular rebuilds
83- [ ] Proper provider scoping
84- [ ] Dispose controllers and subscriptions
85- [ ] Handle loading/error states
86
87### Navigation
88- [ ] GoRouter with typed routes
89- [ ] Auth guards via redirect
90- [ ] Deep linking support
91- [ ] State preservation across routes
92
93### Performance
94- [ ] Profile mode testing (`flutter run --profile`)
95- [ ] <16ms frame rendering time
96- [ ] No unnecessary rebuilds (DevTools check)
97- [ ] Images cached and resized
98- [ ] Heavy computation in isolates
99
100### Testing
101- [ ] Widget tests for UI components
102- [ ] Unit tests for business logic
103- [ ] Integration tests for user flows
104- [ ] Bloc tests with `blocTest()`
105
106## References
107
108| Topic | Reference |
109|-------|-----------|
110| Widget patterns, const optimization, responsive layout | [Widget Patterns](references/widget-patterns.md) |
111| Riverpod providers, notifiers, async state | [Riverpod State Management](references/riverpod-state.md) |
112| Bloc, Cubit, event-driven state | [Bloc State Management](references/bloc-state.md) |
113| GoRouter setup, routes, deep linking | [GoRouter Navigation](references/gorouter-navigation.md) |
114| Feature-based structure, dependencies | [Project Structure](references/project-structure.md) |
115| Profiling, const optimization, DevTools | [Performance Optimization](references/performance.md) |
116| Widget tests, integration tests, mocking | [Testing Strategies](references/testing.md) |
117| iOS/Android/Web specific implementations | [Platform Integration](references/platform-specific.md) |
118| Implicit/explicit animations, Hero, transitions | [Animations](references/animations.md) |
119| Dio, interceptors, error handling, caching | [Networking](references/networking.md) |
120| Form validation, FormField, input formatters | [Forms](references/forms.md) |
121| i18n, flutter_localizations, intl | [Localization](references/localization.md) |
122
123---
124
125Flutter, 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.
126
127---
128
129**Source:** [`MiniMax-AI/skills`](https://github.com/MiniMax-AI/skills) → `skills/flutter-dev/SKILL.md`