From ee0b9ea0f8efa910fad93944187ad15bfef24d0d Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 18 May 2023 21:08:24 +0000 Subject: [PATCH] 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 Reviewed-by: Lasse Nielsen Commit-Queue: Brian Quinlan Reviewed-by: Siva Annamalai --- CHANGELOG.md | 1 + sdk/lib/io/platform.dart | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33baa957ddb..40951feccfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/sdk/lib/io/platform.dart b/sdk/lib/io/platform.dart index a5165403b13..f11dee05613 100644 --- a/sdk/lib/io/platform.dart +++ b/sdk/lib/io/platform.dart @@ -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(); }