--- name: "building-flutter-production-apps" description: "Expert-level guidance for Flutter production applications: architecture decisions (Clean/Layered/Hexagonal/Feature-First), advanced state management (BLoC/Riverpod/GetX), performance optimization (eliminating jank, memory profiling, reducing rebuild overhead), code review with design pattern enforcement, scalability assessments, native platform integration (MethodChannel/EventChannel/FFI), complex UI challenges (custom render objects, slivers), testing strategies (unit/widget/integration/golden), CI/CD pipeline architecture, build optimization, and accessibility compliance. Triggers: 'architecture decision', 'design pattern', 'performance issue', 'code review', 'production problem', 'scaling concerns', 'best practices', 'technical debt', 'refactoring strategy'. Essential for complex enterprise apps, critical production debugging, architectural refactors, or when choosing between competing technical approaches." metadata: last_modified: "2026-04-01 14:35:00 (GMT+8)" --- # Flutter Expert Guide ## Overview Expert reference for Flutter architecture, UI implementation, native platform integration, and performance optimization across the full application lifecycle. --- # Process ## ๐Ÿš€ High-Level Workflow Architecting a scalable Flutter application involves the following development phases: ### Phase 1: Environment & Architecture Foundations #### 1.1 Core Architectural Design Choose between feature-first and layer-first directory structures. Architect Domain, Data, and Presentation layers. - **References**: `architecture.md`, `architecture-decision-matrix.md` --- ### Phase 2: Application Navigation & Interactive UI Delivery #### 2.1 Phenomenal UI Implementation & Theming Build responsive adaptive UI with accessibility (a11y) and internationalization (i18n) standards. - **References**: `layout.md`, `theming.md`, `accessibility.md`, `localization.md` #### 2.2 System UI Control & Immersion Fine-tune status bar and navigation bar aesthetics. Control full-screen immersive modes while effectively resolving manufacturer-specific layout bugs. - **Reference**: `system-ui.md` #### 2.3 Animations & Micro-Interactions Implement implicit/explicit animations and micro-interactions to improve perceived performance and UX. - **Reference**: `animation.md` --- ### Phase 3: Data Integration & Systemic Performance #### 3.1 Advanced Data Architectures Implement HTTP clients, JSON parsing strategies, and response caching. - **References**: `http-and-json.md`, `caching.md` #### 3.2 Performance & Concurrency Scaling Move heavy computation to background isolates to prevent UI jank. Optimize compiled app size via tree shaking, deferred loading, and asset compression. - **References**: `performance.md`, `concurrency.md`, `app-size.md` #### 3.3 Deep Native Platform Integrations Communicate with native OS APIs via `MethodChannel`, `EventChannel`, or `dart:ffi`. - **References**: `native-interop.md`, `platform-views.md`, `plugins.md`, `home-screen-widget.md` --- # Reference Files ## ๐Ÿ“š Documentation Library Specialized reference documents for each topic: ### Architecture Foundations - [๐Ÿ—๏ธ Architectural Foundations](./references/architecture.md) - [๐ŸŽฏ Architecture Decision Matrix](./references/architecture-decision-matrix.md) ### Visual Presentation (UI/UX) - [๐ŸŽจ Layout Foundations](./references/layout.md) - [๐ŸŽญ Theming Frameworks](./references/theming.md) - [๐Ÿ“ฑ System UI Control](./references/system-ui.md) - [โœจ Animation Fluidity](./references/animation.md) - [โ™ฟ Accessibility (a11y)](./references/accessibility.md) - [๐ŸŒ Localization (i18n)](./references/localization.md) ### Systems, Network & Data - [๐ŸŒ HTTP & JSON Parsing](./references/http-and-json.md) - [๐Ÿ—„๏ธ Advanced Caching](./references/caching.md) ### Native Devices & Platform Enhancements - [๐Ÿ”Œ Native Interop (FFI/Channels)](./references/native-interop.md) - [๐Ÿ“ฑ Platform Views](./references/platform-views.md) - [๐Ÿงฉ Plugins Authoring](./references/plugins.md) - [๐Ÿ  Home Screen Widgets](./references/home-screen-widget.md) ### Optimization & Quality Assurance - [โšก Performance Tuning](./references/performance.md) - [๐Ÿงต Concurrency & Isolates](./references/concurrency.md) - [๐Ÿ“ฆ Application Size Reduction](./references/app-size.md)