setFileSystem static method

void setFileSystem(
  1. FileSystem fileSystem
)

You can set a memory file-system in your tests. For example:

final mfs = MemoryFileSystem();
setUpAll(() { LocalPersist.setFileSystem(mfs); });
tearDownAll(() { LocalPersist.resetFileSystem(); });
 ...
expect(mfs.file('myPic.jpg').readAsBytesSync(), List.filled(100, 0));

Implementation

static void setFileSystem(f.FileSystem fileSystem) {
  _fileSystem = fileSystem;
}