imageToBase64 method

Future<String> imageToBase64(
  1. String imagePath
)

Implementation

Future<String> imageToBase64(String imagePath) async {
  File file = File(imagePath);
  List<int> imageBytes = await file.readAsBytes();
  String base64Image = base64Encode(imageBytes);
  return base64Image;
}