getBase64FromFile method

Future<String?> getBase64FromFile(
  1. File file
)

this function is used to convert any file to base 64 string

Implementation

Future<String?> getBase64FromFile(File file) async {
  Uint8List imageBytes = await file.readAsBytes();
  debugPrint(base64Encode(imageBytes));
  String base64String = base64Encode(imageBytes);
  return base64String;
}