欢迎查阅Dart API参考文档,涵盖了官方API库。一些最基本的Dart库包括:

  • dart:core: 核心功能,例如:string,number,collection,error,date,以及 URI。
  • dart:html: 关于Web应用的DOM操作。
  • dart:io: 关于命令行应用的I/O。

除了 dart:core, 你必须在使用一个库之前导入。下面是导入 dart:htmldart:math 的例子:

import 'dart:html';
import 'dart:math';

你可以使用Pub包管理器安装更多的库,关于查找、使用、发布的信息,查看pub.dartlang.org

学习和使用Dart的主要网站是www.dartlang.org。 参考网页:

本参考API是由项目DartAPI-zh_CN汉化后的源码自动生成,首发Dart语言中文社区

在翻译的过程中,我并没有完全照翻官方原文,如果有翻译错误或容易产生歧义的地方,欢迎来Dart语言中文社区留言,或在Git@OSCIssues指出来。如果喜欢本项目,请在Git@OSC给我Star,3Q!

项目的发展离不开你的支持,如果你愿意捐助本文档,参见捐赠

Libraries

dart:async

Support for asynchronous programming, with classes such as Future and Stream.

dart:collection

Classes and utilities that supplement the collection support in dart:core.

dart:convert

Encoders and decoders for converting between different data representations, including JSON and UTF-8.

dart:core

核心基础类库,包含所有运行Dart应用必不可少的系统类, 如内置类型、集合,以及其它核心功能。

dart:developer

Interact with developer tools such as the debugger and inspector.

dart:html

HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model).

dart:indexed_db

A client-side key-value store with support for indexes.

dart:io

File, socket, HTTP, and other I/O support for server applications.

dart:isolate

Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages.

dart:js

Support for interoperating with JavaScript.

dart:js_util

Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.

dart:math

Mathematical constants and functions, plus a random number generator.

dart:math

Mathematical constants and functions, plus a random number generator.

dart:mirrors

Basic reflection in Dart, with support for introspection and dynamic invocation.

dart:svg

Scalable Vector Graphics: Two-dimensional vector graphics with support for events and animation.

dart:typed_data

Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types.

dart:web_audio

High-fidelity audio programming in the browser.

dart:web_gl

3D programming in the browser.

dart:web_sql

An API for storing data in the browser that can be queried with SQL.