base64 static method

Future<String?> base64({
  1. File? file,
  2. Uint8List? bytes,
})

Implementation

static Future<String?> base64({
  File? file,
  Uint8List? bytes,
}) async {
  if (bytes == null && file == null) return null;

  if (file != null) {
    bytes = await file.readAsBytes();
  }

  return base64Encode(bytes!);
}