Fix GitHubFile.text decoding
MODIFY
CHANGELOG.md
CHANGELOG.md
+## v6.0.2
+ - Fixed `GitHubFile.text` to properly decode `content`.
+
## v6.0.1
- Fix https://github.com/SpinlockLabs/github.dart/issues/190
- removed deprecated items
- renamed some fields with ID at the end to be Id
- most model constructors now have named parameters for all properties
+- `GitHubFile.content` is now exactly the content returned from the JSON API
+ without newlines removed.
## v5.5.0

MODIFY
lib/src/common/model/repos_contents.dart
lib/src/common/model/repos_contents.dart
@@ -37,7 +37,7 @@ class GitHubFile {
/// File Path
String path;
- /// File Content
+ /// Base-64 encoded file content with newlines.
String content;
/// SHA
@@ -55,10 +55,10 @@ class GitHubFile {
@JsonKey(name: '_links')
Links links;
- /// Text Content
+ /// The value in [content] Base-64 decoded.
String get text {
if (_text == null) {
- _text = utf8.decode(base64Decode(content));
+ _text = utf8.decode(base64Decode(LineSplitter.split(content).join()));
}
return _text;
}

MODIFY
pubspec.yaml
pubspec.yaml
name: github
-version: 6.0.1
+version: 6.0.2
author: Kenneth Endfinger <kaendfinger@gmail.com>
description: A high-level GitHub API Client Library that uses Github's v3 API
homepage: https://github.com/SpinlockLabs/github.dart

Fix GitHubFile.text decoding