fmap 0.4.0 copy "fmap: ^0.4.0" to clipboard
fmap: ^0.4.0 copied to clipboard

Simple approach to caching or persistent blob storage. A Map-like object for accessing data stored on the filesystem.

example/main.dart

import 'dart:typed_data';
import 'package:fmap/fmap.dart';
import 'package:path/path.dart' as pathlib;
import 'dart:io';

void main() {
  // let's place the cache in the temp directory
  String dirPath = pathlib.join(Directory.systemTemp.path, "myCache");

  // creating the cache
  final fmap = Fmap(Directory(dirPath));

  // reading bytes from cache
  Uint8List? myData = fmap["myKey"];

  print(myData); // on first start it's null

  // saving two bytes
  fmap["myKey"] = [0x23, 0x21];

  // after restart diskCache["myKey"] will load the data
}
0
likes
120
pub points
0%
popularity

Publisher

verified publisherrevercode.com

Simple approach to caching or persistent blob storage. A Map-like object for accessing data stored on the filesystem.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

crypto, file_errors, meta, path

More

Packages that depend on fmap