15 lines
462 B
Dart
15 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();
|
||
|
}
|
||
|
}
|