diff --git a/packages/flutter_tools/lib/src/base/error_handling_io.dart b/packages/flutter_tools/lib/src/base/error_handling_io.dart index a1e5283bfc244..d25b646a085f7 100644 --- a/packages/flutter_tools/lib/src/base/error_handling_io.dart +++ b/packages/flutter_tools/lib/src/base/error_handling_io.dart @@ -114,6 +114,11 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem { } } + @override + Directory get systemTempDirectory { + return directory(delegate.systemTempDirectory); + } + @override File file(dynamic path) => ErrorHandlingFile( platform: _platform, diff --git a/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart b/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart index ef2752b60477d..f78500b3dc8e9 100644 --- a/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart +++ b/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart @@ -866,6 +866,17 @@ void main() { }); }); + testWithoutContext('ErrorHandlingFileSystem.systemTempDirectory wraps systemTempDirectory of delegate', () { + final MemoryFileSystem delegate = MemoryFileSystem.test(); + final FileSystem fs = ErrorHandlingFileSystem( + delegate: delegate, + platform: const LocalPlatform(), + ); + + expect(fs.systemTempDirectory, isA()); + expect(fs.systemTempDirectory.path, delegate.systemTempDirectory.path); + }); + group('ProcessManager on windows throws tool exit', () { const int kDeviceFull = 112; const int kUserMappedSectionOpened = 1224;