Skip to main content
Dart provides a rich set of core libraries that offer essential functionality for common programming tasks. These libraries are automatically available to all Dart programs and provide the foundation for building robust applications.

Library Categories

Dart’s core libraries can be grouped into several categories:

Essential Libraries

dart:core - Automatically imported into every Dart program. Provides built-in types, collections, and other fundamental functionality. dart:async - Support for asynchronous programming with classes such as Future and Stream.

Platform-Specific Libraries

dart:io - File, socket, HTTP, and other I/O support for non-web applications (servers, CLI apps, Flutter). dart:html - HTML elements and other resources for web-based applications.

Specialized Libraries

dart:ffi - Foreign Function Interface for interoperability with the C programming language. dart:isolate - Concurrent programming using isolates: independent workers similar to threads.

Platform Availability

Not all libraries are available on all platforms:
  • dart:io, dart:ffi, and dart:isolate are only available on Dart Native (VM, AOT, and Flutter)
  • dart:html is only available on web platforms
  • dart:core and dart:async are available on all platforms

Import Syntax

Most core libraries need to be explicitly imported, except for dart:core which is automatically imported:
// dart:core is automatically imported
// No import needed for String, int, List, etc.

// Other libraries must be imported
import 'dart:async';
import 'dart:io';
import 'dart:ffi';

Common Use Cases

Asynchronous Operations

Use dart:async for Futures, Streams, and async/await patterns

File I/O

Use dart:io for reading/writing files and directories

Native Interop

Use dart:ffi for calling C libraries and native code

Parallel Execution

Use dart:isolate for CPU-intensive tasks in separate isolates

Next Steps

Explore each library in detail:

Build docs developers (and LLMs) love