setFileSystem static method
void
setFileSystem(
- FileSystem fileSystem
You can set a memory file-system in your tests. For example:
final mfs = MemoryFileSystem();
setUpAll(() { LocalJsonPersist.setFileSystem(mfs); });
tearDownAll(() { LocalJsonPersist.resetFileSystem(); });
...
expect(mfs.file('myPic.jpg').readAsBytesSync(), List.filled(100, 0));
Implementation
static void setFileSystem(f.FileSystem fileSystem) {
LocalPersist.setFileSystem(fileSystem);
}