Skip to content

Commit 0f25528

Browse files
committed
Fix compute with lock in isolates
1 parent ca1a63d commit 0f25528

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/lw_file_system/lib/src/api/file_system_io.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ import 'package:lw_file_system/lw_file_system.dart';
66
import 'package:path/path.dart' as p;
77
import 'package:synchronized/synchronized.dart';
88

9+
Future<void> _updateFile((String, Uint8List) e) async {
10+
final file = File(e.$1);
11+
if (!await file.exists()) {
12+
await file.create(recursive: true);
13+
}
14+
await file.writeAsBytes(e.$2);
15+
}
16+
917
class IODirectoryFileSystem extends DirectoryFileSystem {
1018
@override
1119
final LocalStorage? storage;
@@ -103,14 +111,6 @@ class IODirectoryFileSystem extends DirectoryFileSystem {
103111
});
104112
}
105113

106-
Future<void> _updateFile((String, Uint8List) e) async {
107-
final file = File(e.$1);
108-
if (!await file.exists()) {
109-
await file.create(recursive: true);
110-
}
111-
await file.writeAsBytes(e.$2);
112-
}
113-
114114
@override
115115
Future<FileSystemEntity<Uint8List>?> readAsset(
116116
String path, {

0 commit comments

Comments
 (0)