| commit | 2aa4b6ef30fe4c09cdfdd52f79169c03ce3f402f | [log] [tgz] |
|---|---|---|
| author | Lasse R.H. Nielsen <lrn@google.com> | Mon Apr 07 13:56:24 2025 +0200 |
| committer | Lasse R.H. Nielsen <lrn@google.com> | Wed Jan 21 14:16:18 2026 +0100 |
| tree | d0d3cdecd438db17b1e0cfb070af53e0ef5f03f8 | |
| parent | 3e55c1ce7be48b469da5be043b5931fe6405f74a [diff] |
New API with per-platform properties. The `Platform.current` object exposes one (or potentially more) of a `NativePlatform` (based on `dart:io`) or `BrowserPlatform` (based on JS `window.navigator` or anything else relevant). Each has its own API, and the current platform determines whether a value of these types is available or not. On unsupported platforms, a value is just `null`. Provides a `testing.dart` library which exposes `FakeNativePlatform` and `FakeBrowserPlatform`, which are customizable classes that can be used for testing. It's possible to run code with such a fake value as the *current* platform (`Platform.current` is temporarily updated to a value which exposes the, fx, `FakeNativePlatform` as its `Platform.nativePlatform`). Still retains the legacy and deprecated API that makes native properties directly available on `Platform`. Code should migrate to the new API by doing: * `const LocalPlatform()` → `Platform.current.nativePlatform!` * `new FakePlatform()` → `new FakeNativePlatform()` It's currently not possible to have more than one non-`null` platform-value. Platforms are detected by the presence of the `dart:io` and `dart:js_interop` libraries, and no current platform has both. When such a platform exists, the code will need to be adapted to to produce *both* (possible using conditional imports or conditional parts and augmentations).
This repository is home to various Dart packages under the dart.dev publisher.
| Package | Description | Issues | Version |
|---|---|---|---|
| args | Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options. | ||
| async | Utility functions and classes related to the ‘dart:async’ library. | ||
| characters | String replacement with operations that are Unicode/grapheme cluster aware. | ||
| collection | Collections and utilities functions and classes related to collections. | ||
| convert | Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types. | ||
| crypto | Implementations of SHA, MD5, and HMAC cryptographic functions. | ||
| fixnum | Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes. | ||
| lints | Official Dart lint rules. Defines the ‘core’ and ‘recommended’ set of lints suggested by the Dart team. | ||
| logging | Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger. | ||
| os_detect | Platform independent OS detection. | ||
| path | A string-based path manipulation library. | ||
| platform | A pluggable, mockable platform information abstraction for Dart. | ||
| typed_data | Utility functions and classes related to the dart:typed_data library. |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
For additional information about contributing, see our contributing page.