核心库
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 community contributed packages.
The following table lists all of the Dart core libraries. Each library works on at least one platform.
| Library | Supported platforms |
|---|---|
dart:asyncSupport for asynchronous programming, with classes such as Future and Stream. |
All |
dart:collectionClasses and utilities that supplement the collection support in dart:core. |
All |
dart:convertEncoders and decoders for converting between different data representations, including JSON and UTF-8. |
All |
dart:coreBuilt-in types, collections, and other core functionality for every Dart program. |
All |
dart:developerInteraction with developer tools such as the debugger and inspector. |
JIT Web (experimental, dartdevc only) |
dart:htmlHTML elements and other resources for web-based applications. |
Web |
dart:indexed_dbClient-side key-value store with support for indexes. |
Web |
dart:ioFile, socket, HTTP, and other I/O support for non-web applications. |
JIT AOT |
dart:isolateConcurrent programming using isolates: independent workers similar to threads. |
JIT AOT |
dart:jsDon’t use. Instead, use the js package, as described in JavaScript interoperability. |
Web |
dart:js_utilDon’t use. Instead, use the js package, as described in JavaScript interoperability. |
Web |
dart:mathMathematical constants and functions, plus a random number generator. |
All |
dart:mirrorsBasic reflection with support for introspection and dynamic invocation. |
JIT (experimental, not Flutter) |
dart:typed_dataLists that efficiently handle fixed sized data (for example, unsigned 8-byte integers) and SIMD numeric types. |
All |
dart:web_audioHigh-fidelity audio programming in the browser. |
Web |
dart:web_gl3D programming in the browser. |
Web |
dart:web_sqlAPI for storing data in the browser that can be queried with SQL. |
Web (obsolete) |
