read static method
Read the file.
folder
is the folder to read the file from.
fileName
is the name of the file.
decrypter
is an additional function to decrypt the data.
Implementation
static Future<String?> read({
required Folder folder,
required String fileName,
String Function(String ciphertext)? decrypter,
}) async {
File file = await _initFile(
folder: folder,
fileName: fileName,
);
if (file.existsSync()) {
return decrypt(file.readAsStringSync(), decrypter);
}
return null;
}