Skip to content

Instantly share code, notes, and snippets.

@rvbiljouw
Created April 20, 2020 11:50
Show Gist options
  • Save rvbiljouw/2fd254f7a386e8a6882701bef5f59453 to your computer and use it in GitHub Desktop.
Save rvbiljouw/2fd254f7a386e8a6882701bef5f59453 to your computer and use it in GitHub Desktop.
static Future<String> get _photoLibrary async {
final base = await getApplicationDocumentsDirectory();
final directory =
await Directory("${base.path}/images/").create(recursive: true);
return directory.path;
}
static Future<File> getFile(String name) async {
final path = await _photoLibrary;
return File('$path/$name');
}
static Future<File> copyFile(File src, File dest) async {
return src.copySync(dest.path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment