write method
Writes content
to a file at filePath
.
If a file is to be overwritten, a warning will be reported on element
.
Implementation
@override
void write(String filePath, String content, {Warnable? element}) {
final bytes = utf8.encode(content);
_validateMaxWriteStats(filePath, bytes.length);
// Replace '/' separators with proper separators for the platform.
var outFile = path.joinAll(filePath.split('/'));
_warnAboutOverwrite(outFile, element);
_fileElementMap[outFile] = element;
var file = _getFile(outFile);
file.writeAsBytesSync(bytes);
writtenFiles.add(outFile);
logProgress(outFile);
}