fileHeader method
What screen readers announce for a file's header.
Implementation
String fileHeader(FileDiff file) {
final additions = file.additions;
final deletions = file.deletions;
return [
status(file.kind) ?? 'Modified',
if (file.isRenameOrCopy)
'${file.oldPath} to ${file.newPath}'
else
file.path,
if (file.isBinary)
'binary'
else ...[
additions == 1 ? '1 addition' : '$additions additions',
deletions == 1 ? '1 deletion' : '$deletions deletions',
],
].join(', ');
}