Future getImage(ImageSource imageSource) async {
    var image = await ImagePicker.pickImage(source: imageSource);

    setState(() {
      _image = image;
    });
  }

最佳答案

您可以将图像转换为字节数组并将其保存为 blob。

var image = await ImagePicker.pickImage(source: imageSource);
List<int> bytes = await image.readAsBytes();
//save to SQLite as a blob

关于flutter - 如何使用image_picker依赖项在flutter中将图像上传到sqlite数据库,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55257234/

10-11 05:28