voyagehandbook/lib/util/storage.dart
2023-03-18 16:55:08 +01:00

14 lines
462 B
Dart

import 'dart:io';
import 'package:path_provider/path_provider.dart';
/// Used to ease up accessing local files
class StorageAccess {
/// Get files in `recent` folder, which contains recently opened pages
static Future<List<File>> get recent async {
var files =
Directory("${(await getApplicationDocumentsDirectory()).path}/recent");
if (!files.existsSync()) files.createSync();
return files.listSync().whereType<File>().toList();
}
}