fmap 0.1.1+2 copy "fmap: ^0.1.1+2" to clipboard
fmap: ^0.1.1+2 copied to clipboard

outdated

A `Map` implementation that stores its entries in files. Can be used as a cache or persistent key-value storage.

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
0
pub points
0%
popularity

Publisher

verified publisherrevercode.com

A `Map` implementation that stores its entries in files. Can be used as a cache or persistent key-value storage.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, file_errors, meta, path

More

Packages that depend on fmap