Steven's Knowledge

Flutter

Engineering guide for Flutter — best practices, pitfalls, advanced usage, performance, and state management

Flutter

Engineering knowledge for building production-grade Flutter applications. Skips Dart and Widget basics in favor of what actually determines project quality.

Topics

check-circle

Best Practices

Project structure, Widget organization, Keys, assets, theming

box

Architecture & DI

Clean architecture, layering, dependency rule, get_it / Riverpod DI, modularization

alert-triangle

Pitfalls

BuildContext misuse, setState timing, memory leaks, platform quirks

zap

Advanced Usage

Custom RenderObject, Slivers, platform channels, isolates, FFI

activity

Performance

Rendering pipeline, rebuild scope, image cache, profile-mode debugging

film

Animations & Motion

Implicit vs explicit, AnimationController, Hero, staggered, physics, performance

layers

State Management

Provider / Riverpod / Bloc selection and architectural patterns

navigation

Navigation & Routing

go_router, typed routes, guards, deep linking, nested navigation, transitions

cloud

Networking & API

Dio interceptors, token refresh, serialization, error modeling, FCM push

clipboard-list

Forms & Validation

Form/FormField, sync & async validation, focus, server errors, testing

bug

Debugging

DevTools, Inspector, layout debugging, MethodChannel, crash reporting

test-tube

Testing

Unit, widget, golden, integration tests, mock strategies, test architecture

shield

Security

Secure storage, SSL pinning, code obfuscation, authentication, data protection

accessibility

Accessibility

Semantics tree, screen readers, focus management, dynamic type, WCAG compliance

rocket

CI/CD

Build automation, code signing, Fastlane, flavors, release pipeline

database

Offline-First

Local databases, sync engines, conflict resolution, optimistic updates

globe

Internationalization

ARB files, dynamic locale switching, RTL support, number/date formatting

monitor

Web & Desktop

Responsive layout, input adaptation, rendering backends, window management

package

Plugin Development

Federated plugins, platform channels, Pigeon, testing, publishing

Engineering Layers

Flutter App
├── Presentation        Widget tree / Theme / Routing
│   ├── Page            Page-level Widgets, orchestrate business flow
│   ├── Component       Reusable UI components, no business dependencies
│   └── Layout          Scaffolding, responsive layout
├── State               State management (Provider / Riverpod / Bloc)
│   ├── ViewModel       Page-level state
│   ├── Repository      Data access abstraction
│   └── Service         Business domain logic
├── Data                Data sources
│   ├── Remote          API / GraphQL / WebSocket
│   ├── Local           SQLite / Hive / SharedPreferences
│   └── Cache           Memory cache, disk cache
└── Platform            Platform-specific
    ├── MethodChannel   Native method calls
    ├── EventChannel    Native event streams
    └── FFI             Direct C/C++ calls
StageFocusKey Outcome
Post-basicsWidget composition, StatelessWidget vs StatefulWidgetReadable, reusable pages
IntermediateState management, routing, dependency injectionDecoupled UI and business logic
PerformanceRebuild scope, image memory, list lazy loadingStable 60 fps, profile-mode debugging
Deep diveRenderObject, Slivers, custom paintingBreak free from built-in Widget limits
PlatformMethodChannel, FFI, plugin authoringDeep native integration
ProductionTesting, security, accessibility, i18n, CI/CDShip-ready, store-compliant apps
Multi-platformWeb rendering, desktop adaptation, responsive layoutOne codebase across mobile, web, desktop

Why focus on practice over syntax

Official Flutter docs already cover Widget basics thoroughly. What truly determines project quality is rebuild scope control, state management selection, correct Key usage, platform difference handling, and performance profiling. These lessons are scattered across the docs — this section consolidates the hard-won knowledge that usually comes only from shipping and debugging real apps.

On this page