html library

Web-based file system

It uses window.localStorage to store the files. Each file is stored as a string - the content of the file. The file path is the key of the localStorage.

It reflects the dart:io library. However, it's not the copy of that like universal_io. And unlike that package, it works! And it does not use the code of Dart team, which changes over time.

Supported classes

Unsupported methods

The support for these methods is planned for the future. The Directory.createTemp will use window.sessionStorage to store the temporary files.

Tip

If you plan to use these library only for web, consider using synchronous methods. For example, FileSystemEntity.typeSync instead of FileSystemEntity.type. The window.localStorage is synchronous, so it's faster.

However, if you plan to use these library for both web and mobile, consider using asynchronous methods. They are more efficient.

Exceptions / Errors

FileSystemException