lesnitsky / flutter_localstorage

📦 LocalStorage for Flutter
MIT License
298 stars 65 forks source link

Support for non-json data? #35

Closed TannerYoung closed 4 years ago

TannerYoung commented 4 years ago

Is there any reason not to support just raw binary data?

I'd appreciate the flexibility of just being able to write/read a raw binary array (List) to disk, and it would hardly even clutter the api (either an optional parameter on the setItem similiar to toEncodable or another function?).

Seems like this is intentionally out of scope, but there doesn't even seem to be a way to extend the library / re-use excellent components of it.

This is also the only file writing library that appears to work for ios, android, and web, which is why I want to use it.

lesnitsky commented 4 years ago

The idea behind this package is compatibility with web API (assuming web dev coming to flutter eco will search from familiar localstorage impl). Web LocalStorage can store only strings, but you can use base 64 to store binary data (base64 is a string representation of binary data)