Deprecate the Platform constructor

Bug:https://github.com/dart-lang/sdk/issues/52138
Change-Id: I9137ffe7caa1a1e9441d48b030342a528d99e8f6
CoreLibraryReviewExempt: deprecation, aske on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303086
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Brian Quinlan 2023-05-18 21:08:24 +00:00 committed by Commit Queue
parent 51c4aee90e
commit ee0b9ea0f8
2 changed files with 5 additions and 0 deletions

View file

@ -15,6 +15,7 @@
- **Breaking change** [#51486][]:
- Added `sameSite` to the `Cookie` class.
- Added class `SameSite`.
- Added a deprecation warning when `Platform` is instantiated.
- Added `Platform.lineTerminator` which exposes the character or characters
that the operating system uses to separate lines of text, e.g.,
`"\r\n"` on Windows.

View file

@ -252,4 +252,8 @@ final class Platform {
/// `"\r\n"`
@pragma("vm:platform-const")
static String get lineTerminator => isWindows ? '\r\n' : '\n';
@Deprecated("Do not instantiate this class, it will become abstract in a "
"future Dart version")
Platform();
}