目录

Contents

常用 Web 库和 package

目录

Contents

The Dart SDK contains dart:html and other libraries that provide low-level web APIs. You can supplement or replace these APIs using web packages.

SDK libraries

The Dart SDK contains dart:html and other libraries that provide low-level web APIs.

Low-level web tutorials
An overview of DOM, CSS, and HTML concepts, with information on how to include a Dart script in an HTML page and how to add and remove elements from a web page. These tutorials feature interactive examples in DartPad.
The dart:html section of the library tour
An example-driven tour of using the dart:html library. Topics include manipulating the DOM programmatically, making HTTP requests, and using WebSockets.
dart:html API reference
Complete reference documentation for the dart:html library.

Web packages

Many packages support web development with Dart. In particular, the Flutter framework has web support, in addition to mobile, desktop, and embedded device support.

Here are a few packages that are web-specific:

Library Package Notes
JavaScript interop js Support for calling JavaScript libraries from Dart code. More info: JavaScript interoperability
Material Design mdc_web Bindings for Material Components for the web.
Mustache templates mustache_template Support for the Mustache templating language.
React react Bindings for the ReactJS library.

To find more libraries that support writing web apps, search pub.dev for web packages.