fs 1.0.2 copy "fs: ^1.0.2" to clipboard
fs: ^1.0.2 copied to clipboard

outdated

A dart:io's FileSystem available for web.

Vise File System #

This file system is for Dart & Flutter users, who wants cross-platform API

Features #

  • cross-platform, working on web!
  • open to anyone
    • you may need to fork the repo and customize it
      • unlike Vise Maps themselves, this code is licensed under 3 clauses, which give you much more freedom
  • uses the same API as dart:io

Getting started #

First install:

$ dart pub add fs

or

$ flutter pub add fs

And then a little bit complicated import:

import 'package:fs/io.dart' if (dart.library.html) 'package:fs/html.dart';

or the opposite way:

import 'package:fs/html.dart' if (dart.library.io) 'package:fs/io.dart';

Aditional information #

This package was created because I needed some cross-platform solution for our future app. I found universal_io. But there are two issues: the package does not seem to be mantained, and mainly – it does not work (on web). There are opened issues for a year without a response.

Also that package has just copied code from Dart SDK (and has used IOOverrides) which is the worst possible way to use localStorage I would say:

  1. Dart SDK changes almost everyday and after a stable release, the code must be re-copied and re-edited
  2. The code will be big because of the dart:io library size. Why to include it twice?

Well, I encourage you to fork this package, come with wider support; and meanwhile, I'll try to get some answers from the maintainers of universal_io.

0
likes
50
pub points
37%
popularity

Publisher

verified publishertomaswrobel.dev

A dart:io's FileSystem available for web.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on fs