Dart has a rich set of core libraries that provide essentials for many everyday
programming tasks such as
working on collections of objects (dart:collection),
making calculations (dart:math),
and encoding/decoding data (dart:convert).
Additional APIs are available in
commonly used packages.
Multi-platform libraries
The following table lists the Dart core libraries that work on all Dart platforms.
| Library | Notes |
|---|---|
dart:coreBuilt-in types, collections, and other core functionality for every Dart program. |
|
dart:async, package:asyncSupport for asynchronous programming, with classes such as Future and Stream.package:async provides additional utilities around the Future and Stream types. |
|
dart:collection, package:collectionClasses and utilities that supplement the collection support in dart:core.package:collection provides further collection implementations and functions for working on and with collections. |
|
dart:convert, package:convertEncoders and decoders for converting between different data representations, including JSON and UTF-8. package:convert provides additional encoders and decoders. |
|
dart:developerInteraction with developer tools such as the debugger and inspector. |
Native JIT and dartdevc only |
dart:mathMathematical constants and functions, plus a random number generator. |
|
dart:typed_data, package:typed_dataLists that efficiently handle fixed sized data (for example, unsigned 8-byte integers) and SIMD numeric types. package:typed_data provides further classes and functions working on typed data. |
Native platform libraries
The following table lists the Dart core libraries that work on the Dart native platform (AOT- and JIT-compiled code).
| Library | Notes |
|---|---|
dart:ffi, package:ffiA foreign function interface that lets Dart code use native C APIs. package:ffi contains utilities incl. support for converting Dart strings and C strings. |
|
dart:io, package:ioFile, socket, HTTP, and other I/O support for non-web applications. package:io provides functionality including support for ANSI colors, file copying, and standard exit codes. |
|
dart:isolateConcurrent programming using isolates: independent workers similar to threads. |
|
dart:mirrorsBasic reflection with support for introspection and dynamic invocation. |
Experimental Native JIT only (not Flutter) |
Web platform libraries
The following table lists the Dart core libraries that work on the Dart web platform (code compiled to JavaScript).
| Library | Notes |
|---|---|
dart:htmlHTML elements and other resources for web-based applications. |
|
dart:indexed_dbClient-side key-value store with support for indexes. |
|
dart:js, dart:js_util, package:jsdart:js_util provides low-level primitives for interoperability; typically the higher-level annotations in package:js are recommended, as they help express interoperability more succinctly. For more details see JavaScript interoperability.Don’t use dart:js directly; direct use of those legacy APIs is deprecated. |
|
dart:svgScalable Vector Graphics. |
|
dart:web_audioHigh-fidelity audio programming in the browser. |
|
dart:web_gl3D programming in the browser. |