A file storage tool

Features

  • Store the file, return the file ID, and read the file through the file ID;
  • Store multiple files into one file (Collection);

Getting started

dart pub add file_store

Usage

import 'package:file_store/file_store.dart';

void main(List<String> args) async {
  final store = FileStore("STORE");
  final f1 = await store.saveFileFromFilePath("./CHANGELOG.md");
  final collection = await store.createCollection();
  final f2 = await collection.addFileFromString("hello world");
  final f3 = await collection.addFileFromFilePath("./.gitignore");
  if (f1 != null) print(await store.readFileAsString(f1));
  print(await store.readFileAsString(f2));
  if (f3 != null) print(await store.readFileAsString(f3));
}

Libraries

file_store