Everything in Flutter is a widget: structure (Scaffold), layout (Row, Column, Stack), painting (Container, DecoratedBox), and Material/Cupertino controls. StatelessWidget for UI from constructor fields. StatefulWidget when the widget must change over time. Prefer ListView.builder over a Column of hundreds of children.
This Flutter cheat sheet is written for people searching for a fast, accurate reference: students, junior developers, and teams shipping production software. Pin it, copy the snippets, and come back when syntax slips.
Quick reference
- Text / Icon: Display. Wrap text that should wrap with
Flexiblein a Row. - Row / Column: Main axis +
mainAxisAlignment.Expandedtakes leftover space. - Stack: Overlap children.
Positionedfor absolute corners. - Container: Convenience for padding, margin, color, constraints. Not the only layout tool.
- ListView:
ListView.builderfor long lists.separatorBuilderfor dividers. - Material:
ElevatedButton,TextField,AppBar,SnackBarinsideMaterialApp. - Keys:
ValueKey(id)on list items so State is preserved correctly. - const: Mark widgets
constwhen all args are const — fewer rebuilds.
Copy-paste examples
Column layout and a builder list
Unbounded height: a ListView inside a Column needs Expanded. Builders pass index.
Widget profile(String title, List<String> lines) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
Expanded(
child: ListView.builder(
itemCount: lines.length,
itemBuilder: (context, i) => ListTile(title: Text(lines[i])),
),
),
],
);
}Common mistakes
- Column + ListView without Expanded — “Vertical viewport was given unbounded height.”
- Using
Containerfor every spacing instead ofSizedBox/Padding. - Creating a new
TextEditingControllerinbuildevery frame (leaks and lost cursor). - Ignoring
constconstructors in hot paths of a large list.
FAQ
- Widget vs RenderObject? You write widgets. Flutter inflates an element tree and render objects for layout/paint. Debug with Flutter Inspector, not by subclassing render objects on day one.
- Material or Cupertino? Material is the default look. Cupertino mimics iOS. Many apps use Material on both platforms; some switch with
Theme/ platform checks.
- Can I use HTML widgets? No. Flutter is not the DOM. On Flutter web it still paints to a canvas/HTML combination — you write Dart widgets, not
<div>.
Related Flutter cheat sheets
Build with this stack
When a cheat sheet is not enough — you need a production app, a student FYP, or a custom dashboard — ArpaNeuro builds mobile app development and also sells ready-made source code. Request a quote and tell us the stack.
Browse software development services or the source code marketplace if you want a working codebase instead of starting from a blank file.