Flutter is Google's open-source UI framework for building natively compiled, cross-platform applications from a single codebase, targeting mobile (iOS, Android), web, desktop, and embedded devices. Powered by the Dart programming language, Flutter uses a reactive widget tree where everything β from layout containers to buttons β is a widget, enabling composable and declarative UI development. Unlike frameworks that bridge to platform UI components, Flutter renders directly via its Impeller engine (the default on iOS and Android, replacing Skia), delivering pixel-perfect control and 60fps+ performance across all targets. With Dart 3, the language gained records, patterns, and sealed classes β features that fundamentally reduce boilerplate and improve type safety. The key insight: widgets are immutable and stateless by default; state changes trigger rebuilds rather than mutations, and BuildContext is your gateway to navigating ancestors (Theme, Navigator, InheritedWidget) without prop drilling.
What This Cheat Sheet Covers
This topic spans 25 focused tables and 200 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Widget Types
| Widget | Example | Description |
|---|---|---|
class MyWidget extends StatelessWidget { Widget build(context) => Text('Hi');} | β’ Immutable widget that rebuilds only when parent rebuilds β no internal state β’ ideal for static UI that depends solely on constructor parameters. | |
class Counter extends StatefulWidget { _CounterState createState() => _CounterState();} | β’ Widget that holds mutable state via a paired State object β’ calling setState() triggers rebuild. | |
class _CounterState extends State<Counter> { int count = 0; Widget build(context) => Text('$count');} | β’ Mutable companion to StatefulWidget holding data that persists across rebuilds β’ initState(), dispose(), and lifecycle methods live here. |