editGist method
Edits a Gist.
API docs: https://developer.github.com/v3/gists/#edit-a-gist
Implementation
Future<Gist> editGist(
String id, {
String? description,
Map<String, String>? files,
}) {
final map = <String, dynamic>{};
if (description != null) {
map['description'] = description;
}
if (files != null) {
final f = <String, dynamic>{};
for (final key in files.keys) {
f[key] = files[key] == null ? null : {'content': files[key]};
}
map['files'] = f;
}
return github.postJSON(
'/gists/$id',
statusCode: 200,
body: GitHubJson.encode(map),
convert: (dynamic i) => Gist.fromJson(i),
);
}