Mobile Flutter Skill
Core Principles
- const widgets everywhere:
constconstructor = compile-time constant = O(1) rebuild check. - Riverpod 2 with codegen:
@riverpodannotation — generated code is the contract; never manual provider wiring. - GoRouter 14+ for navigation: Declarative routing, type-safe
@TypedGoRoute,StatefulShellRoutefor tab state. - AsyncValue pattern: Typed loading/error/data states — never manual
isLoading/hasErrorbools. - Extension types for domain safety:
extension type UserId(String _) implements String {}— zero-cost, compile-time safe. - WASM for web:
flutter build web --wasmis the production default;dart:js_interopreplacesdart:html. - Impeller is the default: No SkSL pre-warming needed; consistent 60/120fps on iOS (Metal) and Android (Vulkan).
References
references/state-management.md— Riverpod 2 codegen, BLoC 9.x, Provider comparison, Signalsreferences/navigation.md— GoRouter 14+, StatefulShellRoute, type-safe routes, deep linking, auth guardsreferences/platform-channels.md— Pigeon (recommended), MethodChannel, EventChannel, dart:ffireferences/performance.md— Widget rebuild optimization, ListView.builder, isolates, Impeller profilingreferences/flutter-profiling.md— DevTools frame timeline, memory leak detection, RepaintBoundary, Impeller vs Skia, platform channel overhead
Source: rnavarych/alpha-engineer — distributed by TomeVault.