updateFiles method
更新 Wasm 模块读写的文件。
例如,在运行时调用 select pinyin_dict('/path/to/new_pinyin.txt') 更新了 Simple 的拼音文件:
loader.updateFiles((it) {
return it..remove('/path/to/old_pinyin.txt')..addAll({ "/path/to/new_pinyin.txt": 拼音文件字节内容 });
})
Implementation
void updateFiles(
Map<String, Uint8List> Function(Map<String, Uint8List> files) apply,
) {
_files = apply(_files);
_callbacks.updateFiles(_files);
}