Commonly used packages
This page lists some of the most popular and useful packages that Dart developers have published. To find more packages—and search core libraries as well—use the pub.dev site.
Commonly used packages fall into three groups:
General-purpose packages
#Use these packages for a wide range of projects.
Package | Description | Commonly used APIs |
---|---|---|
archive | Encodes and decodes various archive and compression formats. | Archive, ArchiveFile, TarEncoder, TarDecoder, ZipEncoder, ZipDecoder |
characters | Manipulates strings for user-perceived characters (Unicode grapheme clusters). | String.characters, Characters, CharacterRange |
cronet_http | Provides access to the Android Cronet HTTP client using the same interface as package:http . |
|
cupertino_http | Provides access to Apple's Foundation URL Loading System using the same interface as package:http . |
|
http | Provides set of high-level functions and classes to simplify consuming HTTP resources. | delete(), get(), post(), read() |
intl | Internationalization and localization facilities, with support for plurals and genders, date and number formatting and parsing, and bidirectional text. | Bidi, DateFormat, MicroMoney, TextDirection |
json_serializable | Generates JSON manipulation code. To learn more, consult JSON Support. | @JsonSerializable |
logging | Adds message logging to your application. | LoggerHandler, Level, LogRecord |
mockito | Mocks objects in tests. Helps when you write tests for dependency injection. Use with the test package. | Answering, Expectation, Verification |
path | Manipulates different types of paths. To learn more, consult Unboxing Packages: path. | absolute(), basename(), extension(), join(), normalize(), relative(), split() |
quiver | Simplifies using core Dart libraries. Some of the libraries where Quiver provides additional support include async, cache, collection, core, iterables, patterns, and testing. | CountdownTimer (quiver.async); MapCache (quiver.cache); MultiMap, TreeSet (quiver.collection); EnumerateIterable (quiver.iterables); center(), compareIgnoreCase(), isWhiteSpace() (quiver.strings) |
shelf | Provides web server middleware for Dart. Shelf makes it easy to create and compose web servers, and parts of web servers. | Cascade, Pipeline, Request, Response, Server |
stack_trace | Parses, inspects, and manipulates stack traces that Dart produces. Also transforms stack traces into a more readable format than the native StackTrace implementation. To learn more, consult Unboxing Packages: stack_trace. | Trace.current(), Trace.format(), Trace.from() |
test | Standardizes writing and running tests in Dart. | expect(), group(), test() |
yaml | Parses YAML markup. | loadYaml(), loadYamlStream() |
Packages that expand on Dart core libraries
#Each of the following packages builds upon a core library, adding functionality and filling in missing features:
Package | Description | Commonly used APIs |
---|---|---|
async | Expands on dart:async, adding utility classes to work with asynchronous computations. To learn more, consult Unboxing Packages: async part 1, part 2, and part 3. | AsyncMemoizer, CancelableOperation, FutureGroup, LazyStream, Result, StreamCompleter, StreamGroup, StreamSplitter |
collection | Expands on dart:collection, adding utility functions and classes to make working with collections easier. To learn more, consult Unboxing Packages: collection. | Equality, CanonicalizedMap, MapKeySet, MapValueSet, PriorityQueue, QueueList |
convert | Expands on dart:convert, adding encoders and decoders for converting between different data representations. One of the data representations is percent encoding, also known as URL encoding. | HexDecoder, PercentDecoder |
io | Contains two libraries, ansi and io, to simplify working with files, standard streams, and processes. Use the ansi library to customize terminal output. The io library has APIs for dealing with processes, stdin, and file duplication. | copyPath(), isExecutable(), ExitCode, ProcessManager, sharedStdIn |
Specialized packages
#To find specialized packages such as packages for Flutter and web development, consult the following sections.
Flutter packages
#To learn more about Flutter packages, consult Using packages in the Flutter documentation or search the pub.dev site for Flutter packages.
Web packages
#To learn more about web packages, consult Web libraries and packages or search the pub.dev site for web packages.
Command-line and server packages
#除非另有说明,文档之所提及适用于 Dart 3.5.3 版本,本页面最后更新时间: 2024-05-06。 查看文档源码 或者 报告页面问题。