由于图像选择器插件提供了图像的filePath,因此您可以使用dart:io中的File类加载图像,并使用dart:convert中的base64将其转换为base64字符串。
这是您可以执行的操作:
import 'dart:io';import 'dart:convert';File imageFile = new File(imageFilePath);List<int> imageBytes = imageFile.readAsBytesSync();String base64Image = base64.enpre(imageBytes);
希望这对您有所帮助!



