modifyFile method

void modifyFile(
  1. String path,
  2. String content
)

Implementation

void modifyFile(String path, String content) {
  var data = _pathToData[path];
  if (data is! _FileData) {
    throw FileSystemException(path, 'Not a file.');
  }

  var bytes = const Utf8Encoder().convert(content);
  _setFileContent(path, bytes);
}