readFileAsBase64 method
Reads the file and returns its content encoded as a Base64 string.
Returns null when the file does not exist.
Implementation
Future<String?> readFileAsBase64({String? fileName, String? path}) async {
final Uint8List? bytes = await readFileAsBytes(
fileName: fileName,
path: path,
);
return bytes == null ? null : base64Encode(bytes);
}