withFileSystem<T> function

T withFileSystem<T>(
  1. FileSystem fs,
  2. T callback()
)

Runs callback with the given value for the top-level fs field.

This is Zone-scoped, so asynchronous callbacks spawned within callback will also use the new value for fs.

Implementation

T withFileSystem<T>(FileSystem fs, T Function() callback) =>
    runZoned(callback, zoneValues: {_fsKey: fs});