Last active
February 18, 2017 12:58
-
-
Save nidev/07485eaef9bf79730a36d6eb2efd65a0 to your computer and use it in GitHub Desktop.
Provide platform-dependent newline character. This function is not available in Platform class in dart:io package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is also included in https://github.com/nidev/smallservlet | |
import "dart:io"; | |
class PlatformUtil { | |
static final _NEWLINE_CRLF = "\r\n"; | |
static final _NEWLINE_LF = "\n"; | |
static String get newLine { | |
if (Platform.isWindows) { | |
// using \r\n | |
return _NEWLINE_CRLF; | |
} | |
else { | |
// using \n | |
return _NEWLINE_LF; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment