Dart Advanced Lesson 113 of 115 5 min read
Dart Glossary: Programming Terms Explained in Simple Words
A simple A to Z Dart glossary: async, class, closure, const, Future, generics, mixin, null safety, record, Stream, widget and more, each linked to a lesson.
On this page
New words are the hardest part of learning to program. This glossary explains the terms you will meet in Dart and Flutter in one or two simple sentences each, with a link to the lesson that teaches it properly.
A to E
- Abstract class
- A class you cannot create directly. It describes what subclasses must have. Abstract classes
- Analyzer
- The tool that checks your code for errors while you type. Run it yourself with
dart analyze. Formatting and linting - Anonymous function
- A function without a name, often passed to another function:
(x) => x * 2. Anonymous functions and closures - AOT (ahead-of-time) compilation
- Turning Dart into machine code before the program runs. Used for fast release apps and
dart compile exe. What is Dart? - Argument / parameter
- A parameter is the name in the function definition (
int a). An argument is the value you pass (add(2, 3)). Function parameters - async / await
- Keywords for waiting for slow work (network, files) without freezing the program. async and await
- Class
- A blueprint for objects: it groups data (fields) and behavior (methods). Classes and objects
- Closure
- A function that remembers the variables around it, even after that code has finished. Closures
- Collection
- A value that holds many values:
List,Set,Map,Queue. Collections overview - Compile-time constant (
const) - A value fixed when the program is compiled, such as
const pi = 3.14. final and const - Constructor
- The special function that creates an object:
Person('Asha', 21). Constructors - dynamic
- A type that turns off type checking. Avoid it unless you really need it. Data types
- Enum
- A fixed set of named values, such as
enum Size { small, medium, large }. Enums - Event loop
- The engine that runs your async code one task at a time. Event loop
- Exception
- An error that happens while the program runs. Catch it with
try/catch. Exceptions - Extension method
- Adds a new method to an existing type, even one you did not write, such as
String. Extension methods
F to L
- Factory constructor
- A constructor that can return an existing object or a subclass instead of always making a new one. Factory constructors
- final
- A variable that can be set only once. final and const
- Future
- A value that will be ready later, like the result of a download. Futures
- Generics
- Type placeholders such as
List<T>that let one class or function work safely with many types. Generics - Getter / setter
- Methods that look like fields:
circle.areainstead ofcircle.area(). Getters and setters - Higher-order function
- A function that takes or returns another function, such as
mapandwhere. Higher-order functions - Hot reload
- Updating a running app with your code changes in under a second, without losing its state. Mostly used in Flutter. Hot reload
- Immutable
- A value that cannot change after it is created. Immutability and copyWith
- Inheritance
- A class taking the fields and methods of another class with
extends. Inheritance - Interface
- A list of methods a class promises to have, used with
implements. Interfaces - Isolate
- Dart’s way to run code in parallel, each with its own memory. Isolates
- Iterable
- Anything you can loop over with
for-in.ListandSetare iterables. Iterables - JIT (just-in-time) compilation
- Compiling code while it runs. Used during development, and what makes hot reload possible.
- JSON
- A text format for data, used by almost every web API. JSON in Dart
- late
- Says “this non-nullable variable will be set before it is used”. late variables
- Library
- A Dart file (or group of files) that you can import. Creating libraries
M to R
- Map
- A collection of key-value pairs, like a dictionary:
{'apple': 3}. Maps - Method
- A function that belongs to a class. Classes and objects
- Mixin
- A bundle of methods you can add to many classes with
with. Mixins - Null safety
- Dart’s guarantee that a variable cannot be
nullunless its type ends in?. Null safety - Object
- One thing made from a class. Also the type that every non-null value belongs to. Classes and objects
- Package
- Shared code you add from pub.dev with
dart pub add. Pub packages - Pattern
- A shape that a value can be matched against and taken apart, used in
switchand destructuring. Patterns - Polymorphism
- One piece of code working with objects of different classes through a shared type. Polymorphism
- pubspec.yaml
- The file that names your project and lists its packages. Pub packages
- Record
- A small group of values without a class:
(name: 'Asha', age: 21). Records - Recursion
- A function that calls itself to solve a smaller version of the problem. Recursion
S to Z
- Scope
- The part of the code where a variable exists, usually the nearest
{ }. Functions - Sealed class
- A class whose subclasses are all known, so
switchcan check that you handled every case. Sealed classes - Set
- A collection with no duplicates. Sets
- Sound type system
- Dart guarantees that a variable always holds a value of its declared type.
- Spread operator (
...) - Puts the items of one collection inside another:
[...a, ...b]. Spread and collection if - Static member
- A field or method that belongs to the class itself, not to each object. Static members
- Stream
- A sequence of values that arrive over time, like clicks or chat messages. Streams
- String interpolation
- Putting values inside text with
$nameor${a + b}. Strings - Type inference
- Dart working out a type for you:
var n = 3;makesnanint. Variables - Typedef
- A short name for a type, often a function type. Typedef
- Widget
- In Flutter, a piece of the user interface, such as
TextorButton. Flutter widgets
Missing a word? Tell us on the contact page and we will add it. For quick syntax, keep the Dart cheat sheet open.