Dart Fundamentals
Dart is a client-optimized programming language developed by Google for building mobile, web, and server applications. It features sound null safety, async/await, and compiles to native ARM code or JavaScript, best known as the language behind the Flutter framework.
itProgramming languages | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Dart Fundamentals
Dart is the typed source language in the room. It supplies syntax, types, compilers, a runtime, libraries, and tools. Flutter is a user-interface framework built on it. Keeping those jobs separate prevents a surprising amount of future head-scratching, which is fortunate because future head-scratching has already reserved a chair.
The useful shape is short. Source goes through analysis and compilation, then becomes native or web output, then runs with the available libraries and runtime. Native development can use a virtual machine and just-in-time compilation. Production native builds can use ahead-of-time machine code. Web builds can use JavaScript or WebAssembly. One language, several destinations, and a firm reminder that a library supported on one target may not join the others.
Static types are the first railing on this bridge. Dart can infer a type from an initializer, so var name = 'Ada' is still typed rather than a small bag of runtime surprises. Use an explicit type when it explains a contract. Use final for a value assigned once at runtime. Use const when the value is known during compilation. They look like cousins. They are not twins, despite their determined family resemblance.
Null safety gives absence a seat at the table. String does not allow null. String? does. Check the nullable value, and flow analysis can treat it as non-null on the valid path. The null assertion operator can force the issue, but it throws when its confidence is misplaced. A check or a better type is usually less dramatic, which code tends to appreciate.
Future means one result arrives later. Stream means several events arrive over time. Awaiting work does not make it parallel. For CPU-heavy work, isolates run with separate memory and communicate by messages. That distinction saves you from expecting one isolate to share a convenient mutable cupboard with another.
Next, open the Intro for the full map of language features and targets. Use Slides for the compressed relationships and choices. Keep the Cheatsheet nearby when names such as records, patterns, generics, and dart pub begin queueing up. Then use the practice reference and exercise to run the feedback loop: format, analyze, test, run, inspect. The SDK does not ask for faith. It offers evidence.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://dart.dev/overview
Supports
- Dart targets native and web platforms and forms the language and runtime foundation of Flutter
- The Dart SDK supports formatting, analysis, testing, runtime execution, and compilation
- Native development uses a virtual machine with just-in-time compilation and production can use ahead-of-time compilation
- Dart web compilers produce JavaScript or WebAssembly
- The runtime manages memory, enforces runtime type checks, and manages isolates
- https://dart.dev/language
Supports
- Dart is object-oriented and objects include numbers and functions
- Dart is strongly typed and supports type inference
- Functions are first-class objects
- Dart supports generic types and sound null safety
- https://dart.dev/language/variables
Supports
- Variables hold references and can use inferred or explicit types
- Final variables can be set only once
- Const values are compile-time constants
- Late changes initialization and checking behavior
- Non-nullable variables must be initialized before use
- https://dart.dev/language/type-system
Supports
- Dart has a sound static type system
- Type inference assigns static types without requiring every annotation
- Dynamic permits operations through runtime checking while Object retains static restrictions
- Generic type information supports static checking
- https://dart.dev/null-safety/understanding-null-safety
Supports
- Nullability is expressed in Dart types
- Non-nullable types do not accept null and nullable types use a question mark
- Flow analysis can promote a nullable variable after a valid check
- A false null assertion causes a runtime failure
- https://dart.dev/language/functions
Supports
- Functions are first-class objects
- Dart supports positional and named parameters
- Required marks a named parameter as mandatory
- Functions can use block bodies or expression bodies
- https://dart.dev/language/built-in-types
Supports
- Dart has built-in support for numbers, strings, booleans, records, functions, symbols, and collections
- Every variable refers to an object
- String interpolation and raw and multiline strings are language features
- https://dart.dev/language/collections
Supports
- Dart has built-in list, set, and map collections
- Lists are ordered, sets contain unique values, and maps associate keys with values
- Collection literals support spread, conditional, and loop elements
- An untyped empty brace literal creates a map rather than a set
- https://dart.dev/language/classes
Supports
- Classes define objects with fields, methods, and constructors
- Dart supports class inheritance and implicit interfaces
- Identifiers beginning with an underscore are private to their library
- Static and abstract members express class-level and incomplete contracts
- https://dart.dev/language/mixins
Supports
- Mixins provide reusable behavior for multiple class hierarchies
- Classes apply mixins with the with clause
- https://dart.dev/language/extension-methods
Supports
- Extension methods add statically resolved functionality to existing APIs
- Extension members are selected using the static type of an expression
- https://dart.dev/language/records
Supports
- Records are anonymous immutable aggregate types
- Record types have fixed size and typed positional or named fields
- Records can return multiple values from a function
- https://dart.dev/language/patterns
Supports
- Patterns match values and can destructure values into variables
- Patterns work in declarations, assignments, switches, and control flow
- Pattern-based switches can be checked for exhaustiveness
- https://dart.dev/language/generics
Supports
- Generic classes and methods preserve type information
- Type parameters can use bounds
- Built-in collections use generic type arguments
- https://dart.dev/language/error-handling
Supports
- Dart can throw and catch exceptions
- Dart exceptions are unchecked
- Rethrow propagates the current exception
- Finally runs cleanup after success or failure paths
- https://dart.dev/language/async
Supports
- Future represents one asynchronous result and Stream represents asynchronous events
- Async and await support asynchronous functions
- Await for consumes stream events
- Async star functions can produce streams with yield
- https://dart.dev/language/concurrency
Supports
- Each isolate has an event loop and separate memory
- Awaiting permits other queued work while an asynchronous operation is pending
- Isolates communicate with messages rather than shared state
- Dart web supports asynchronous APIs but not isolates in the same way as Dart native
- https://dart.dev/language/isolates
Supports
- Worker isolates suit computations large enough to block other work
- Isolate run executes a callback in a worker and returns a future result
- Isolates can run concurrently without sharing mutable memory
- https://dart.dev/libraries
Supports
- Dart supplies core libraries for collections, asynchronous programming, conversion, math, I/O, and platform integration
- Library availability differs between multi-platform, native, and web targets
- The API reference provides exact library member documentation
- https://dart.dev/tools/dart-tool
Supports
- The dart command is the command-line interface to the SDK
- SDK commands create, format, analyze, test, run, document, and compile Dart projects
- Dart pub subcommands manage packages
- https://dart.dev/tools/pub/packages
Supports
- A package uses a pubspec for metadata and dependencies
- Packages can depend on libraries hosted on pub.dev
- Package imports use package URIs
- https://dart.dev/tools/pub/package-layout
Supports
- Public libraries belong under lib and public command-line tools under bin
- Tests conventionally belong under test and examples under example
- The pubspec sits at the package root
- https://dart.dev/tools/pub/cmd/pub-get
Supports
- Dart pub get resolves direct and transitive dependencies
- The command creates package configuration and lock information
- Pub uses compatible locked versions when possible
- https://api.dart.dev/
Supports
- The Dart API reference documents core libraries, types, members, and platform availability
- https://dart.dev/resources/language/spec
Supports
- The Dart language specification provides formal language syntax and semantics
- https://blog.chromium.org/2013/11/dart-10-stable-sdk-for-structured-web.html
Supports
- Dart 1.0 released on 2013-11-13 as a stable SDK for structured web applications
- https://dart.dev/blog/announcing-dart-2-optimized-for-client-side-development
Supports
- Dart 2 preview was announced in February 2018 with a strengthened type system and rebuilt tooling
- https://dart.dev/blog/announcing-dart-2-stable-and-the-dart-web-platform
Supports
- Dart 2 stable released in August 2018 with a rewritten web platform
- https://dart.dev/blog/announcing-dart-2-7-a-safer-more-expressive-dart
Supports
- Dart 2.7 released in December 2019 and added extension methods
- https://dart.dev/blog/announcing-dart-null-safety-beta
Supports
- Sound null safety reached beta in November 2020 and began ecosystem migration
- https://dart.dev/blog/announcing-dart-2-12
Supports
- Dart 2.12 released in March 2021 with sound null safety and stable FFI
- https://dart.dev/blog/announcing-dart-3
Supports
- Dart 3 released in May 2023 with records patterns class modifiers and sound null safety as a requirement
- https://dart.dev/blog/announcing-dart-3-4
Supports
- Dart 3.4 released in May 2024 with WebAssembly support updates
- https://dart.dev/
Supports
- Dart provides the SDK and language toolchain used by this course
- https://flutter.dev/
Supports
- Flutter is a framework built on Dart
- https://dartpad.dev/
Supports
- DartPad provides a browser environment for experimenting with Dart code
- https://code.visualstudio.com/
Supports
- Visual Studio Code provides an editor platform for language tooling
- https://developer.android.com/studio
Supports
- Android Studio provides an integrated development environment for Android projects
- https://www.jetbrains.com/idea/
Supports
- IntelliJ IDEA provides an integrated development environment
- https://codemagic.io/
Supports
- Codemagic provides continuous integration for mobile application projects
