readFileDataAsDataURLBase64 function

Future<String?> readFileDataAsDataURLBase64(
  1. File file, [
  2. String accept = ''
])

Reads file as DATA URL Base64 String.

Implementation

Future<String?> readFileDataAsDataURLBase64(File file,
    [String accept = '']) async {
  var base64 = await readFileDataAsBase64(file);
  if (base64 == null) return null;
  var mediaType = getFileMimeType(file, accept);
  return toDataURLBase64(MimeType.asString(mediaType, ''), base64);
}