Advanced Dart

Apply current syntax, isolates, testing, backend architecture and platform integration.

How to use this path

Apply current syntax, isolates, testing, backend architecture and platform integration. Follow the chapter order on your first pass; use the topic directory when reviewing a specific question. Predict an example, run it, then change one input and explain the result.

Complete server, file and test examples belong in a local Dart project. Browser-supported language examples load the compiler only when requested.

What this section covers

Run a tested backend, explain its production gaps and choose an appropriate runtime.

Modern Dart 3.14

Learn current syntax, version boundaries, migration tooling and stable versus preview features.

  1. Dart 3.14 overviewDistinguish current stable tooling from the language features introduced across recent Dart releases.
  2. Primary and concise constructorsDeclare simple model fields in a class header while preserving clear validation boundaries.
  3. Private named parametersUse a public named argument to initialize a library-private field without manual forwarding.
  4. Dot shorthandsUse inferred enum and constructor context only when the expected type is clear.
  5. SDK migration and analysisUse the Dart 3.14 migration tool without confusing it with historical null-safety migration.
  6. Promotion, Never and lateUse guard clauses and precise return contracts instead of unnecessary casts or unchecked late initialization.

Isolates and performance

Move CPU work deliberately, exchange messages and measure before optimizing.

  1. CPU work with Isolate.runMeasure an expensive computation, isolate it deliberately and return a compact result.
  2. Ports and worker lifecyclesSend a bounded request, await a result with a deadline and close owned ports.
  3. Profiling and memoryUse meaningful measurements to choose between algorithm changes, caching and concurrency.

Dart testing and quality

Test calculations, asynchronous behavior and HTTP boundaries with deterministic examples.

  1. Unit tests and boundary casesWrite deterministic tests for a real calculation and distinguish a test from a debug assertion.
  2. Async tests and fakesAwait the operation under test and replace external dependencies with deterministic behavior.
  3. HTTP handler and integration testsTest the HTTP contract at two boundaries and keep environment-dependent checks explicit.

Dart backend development

Build a REST API with Shelf, validate requests and plan authentication, persistence and deployment.

  1. Backend architecture and framework choiceChoose a server approach and separate transport, domain behavior and persistence.
  2. Your first Shelf serverCreate a local HTTP server, return JSON and verify the endpoint with a real request.
  3. REST routes and paginationDesign predictable resource endpoints and verify successful and missing-resource behavior.
  4. Request validation and errorsValidate representation, shape and domain rules before mutating stored data.
  5. Middleware, CORS and loggingCompose request handling while keeping cross-origin browser policy separate from authorization.
  6. Authentication and authorizationVerify a trusted identity and enforce resource ownership instead of trusting client-supplied user IDs.
  7. PostgreSQL and transactionsReplace ephemeral storage with a deliberate schema, parameterized access and transaction boundaries.
  8. Realtime and background workDefine connection and job lifecycles without assuming an HTTP request owns every ongoing task.
  9. Backend deployment and operationsRun a persistent Dart service separately from static shared-hosting tutorial files.

Dart web, native and AI integration

Choose platform boundaries for JS/Wasm, native bindings and AI tooling.

  1. Web, JavaScript and WasmChoose supported interop libraries and distinguish a browser build from a Dart VM executable.
  2. Native FFI and typed dataUnderstand binding generation, byte buffers and resource ownership before calling native code.
  3. MCP, skills and AI toolingConnect development tooling deliberately and keep generated code subject to normal analysis and tests.

Find your next idea

Search lessons, code examples and projects.

Type a few words to start exploring.