From 41df5f997ffb8e177a06e1be2b539227dbc860ac Mon Sep 17 00:00:00 2001 From: Kingtak Justin Wong Date: Fri, 29 Dec 2023 08:47:49 -1000 Subject: [PATCH] Add in line terminator from Dart --- CHANGELOG.md | 4 ++++ lib/src/platform.dart | 11 +++++++++++ pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a65d174..2137c1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.2.3 + +* Include lineTerminator from Dart 3.1.0 on platform + # 2.2.2 * Improve dependency constraints. diff --git a/lib/src/platform.dart b/lib/src/platform.dart index fa6483d..b4739e4 100644 --- a/lib/src/platform.dart +++ b/lib/src/platform.dart @@ -211,4 +211,15 @@ class Platform { /// possibly followed by whitespace and other version and /// build details. static String get version => ''; + + /// The current operating system's default line terminator. + /// + /// The default character sequence that the operating system + /// uses to separate or terminate text lines. + /// + /// The line terminator is currently the single line-feed character, + /// U+000A or `"\n"`, on all supported operating systems except Windows, + /// which uses the carriage-return + line-feed sequence, U+000D U+000A or + /// `"\r\n"` + static String get lineTerminator => isWindows ? '\r\n' : '\n'; } diff --git a/pubspec.yaml b/pubspec.yaml index c0c7863..07e50cb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: universal_io -version: 2.2.2 +version: 2.2.3 description: Cross-platform 'dart:io' that adds browser support for HttpClient and some other "dart:io" APIs. homepage: https://github.com/dart-io-packages/universal_io