How to send Flutter Quill json with an image in post api

问题描述 投票:0回答:0

我正在尝试在 post api 请求中发送带有图像的 flutter quill json 的 json。我的 json 看起来像这样,其中包含文本和图像

[{"insert":"\n\n\nFlutter quill\n\n"},{"insert":{"image":"/data/user/0/com.appsnado.thechampionshiproutine/cache/image_picker2859034745323535916.webp"}},{"insert":"\n"}]

我从下面的代码中获取 json

var json;
QuillController quillController = QuillController.basic();
setState(() {
  json = jsonEncode(quillController.document.toDelta().toJson());
});

所以在这里你可以看到图像路径是我的设备,通常当我们在 post api 中发送图像时我们使用

path
库,但我们如何在这里使用它?

我希望我的问题现在清楚了,请帮助如何去做。

flutter image post quill
© www.soinside.com 2019 - 2024. All rights reserved.