Flutter & Dart Glossary
Dart Language
Variable & Type Keywords
- var — Declares a variable with inferred type. Once assigned, the type is fixed.
- final — A variable that can only be set once. The value is determined at runtime.
- const — A compile-time constant. The value must be known before the program runs.
- dynamic — Opts out of static type checking. The variable can hold any type.
- late — Defers initialization of a non-nullable variable until it is first accessed.
- typedef — Creates a named alias for a function type or other type.
Functions & Control Flow
- async / await — Marks a function as asynchronous and pauses execution until a Future completes.
- Future — Represents a value that will be available at some point in the future. The core unit of async programming in Dart.
- Stream — A sequence of asynchronous events. Use
await foror.listen()to consume values over time. - yield — Used inside a generator function (
sync*orasync*) to emit values one at a time. - Isolate — A separate thread of execution with its own memory. Dart uses isolates instead of shared-memory threads.
Object-Oriented Programming
- class — A blueprint for creating objects. Defines fields, methods, and constructors.
- mixin — A way to reuse code across multiple class hierarchies using
with. - abstract class — A class that cannot be instantiated directly. Used to define interfaces and shared behavior.
- extension — Adds new methods to an existing type without modifying its source.
- enum — A fixed set of named constant values.
- sealed class — A class that can only be extended within the same library, enabling exhaustive pattern matching.
Flutter Framework
Core Concepts
- Widget — The fundamental building block of a Flutter UI. Everything visible on screen is a widget.
- Widget Tree — The hierarchical structure of nested widgets that describes the UI.
- Element — The instantiation of a widget in the tree. Manages the lifecycle and links widgets to render objects.
- RenderObject — The object that handles layout, painting, and hit-testing. Sits behind the element tree.
- BuildContext — A handle to the location of a widget in the widget tree. Used to look up inherited data and navigate.
- Key — An identifier that helps Flutter match widgets across rebuilds. Important for lists and animations.
Widget Lifecycle
- StatelessWidget — A widget with no mutable state. Its
buildmethod is a pure function of its constructor arguments. - StatefulWidget — A widget that holds mutable state via a companion
Stateobject. - State — The mutable companion to a StatefulWidget. Persists across rebuilds.
- setState() — Tells the framework that state has changed and the widget needs to rebuild.
- initState() — Called once when the State object is first inserted into the tree.
- dispose() — Called when the State object is permanently removed. Use it to clean up controllers, subscriptions, and timers.
- didChangeDependencies() — Called when an InheritedWidget that this state depends on changes.
Widgets — Layout
- Container — A convenience widget that combines padding, margins, decoration, and sizing.
- Row — Lays out children horizontally in a line.
- Column — Lays out children vertically in a line.
- Stack — Layers children on top of each other, with positioning via
Positioned. - Expanded — Fills remaining space along the main axis inside a Row or Column.
- Flexible — Like Expanded but allows the child to be smaller than the available space.
- SizedBox — Forces a child to a specific width and/or height. Also useful as whitespace.
- Padding — Adds empty space around a child widget.
- Wrap — Lays out children in a row, wrapping to the next line when space runs out.
- ListView — A scrollable list of widgets. Use
ListView.builderfor large or dynamic lists. - GridView — A scrollable 2D grid of widgets.
- Scaffold — The basic Material Design page structure: AppBar, body, FloatingActionButton, drawers, and more.
State Management
- InheritedWidget — A widget that efficiently passes data down the tree. The foundation for Provider and other state solutions.
- Provider — A popular package that wraps InheritedWidget for simpler dependency injection and state management.
- ChangeNotifier — A class that notifies listeners when its data changes. Commonly used with Provider.
- Riverpod — A compile-safe, testable state management library. The spiritual successor to Provider.
- Bloc / Cubit — A pattern and library that separates business logic from UI using events and states.
- ValueNotifier — A simple ChangeNotifier that holds a single value and notifies when it changes.
Navigation
- Navigator — The widget that manages a stack of Route objects for screen transitions.
- MaterialPageRoute — A route that transitions using Material Design animations.
- GoRouter — A declarative routing package that uses URL-based paths, popular for web and deep linking.
- push / pop — Navigator methods to add a new route to the stack or remove the current one.
- Named Routes — Routes identified by string names, configured in
MaterialApp.routes.
Testing
- Widget Test — Tests that build a widget in a test environment and verify its behavior using
WidgetTester. - Unit Test — Tests that verify pure Dart logic without any Flutter framework involvement.
- Integration Test — Tests that run on a real device or emulator and exercise the full app.
- pump() — Triggers a frame rebuild in widget tests. Use
pumpAndSettle()to wait for all animations. - Finder — Objects like
find.text()andfind.byType()used to locate widgets in tests.
Packages & Tooling
- pub.dev — The official package repository for Dart and Flutter packages.
- pubspec.yaml — The project configuration file that declares dependencies, assets, and metadata.
- flutter pub get — Downloads and resolves all dependencies listed in pubspec.yaml.
- DevTools — A suite of debugging and profiling tools for Flutter apps (widget inspector, timeline, memory).
- Hot Reload — Injects updated source code into a running app without losing state. One of Flutter's killer features.
- Hot Restart — Rebuilds the app from scratch, resetting all state. Slower than hot reload but handles structural changes.
1 / 1