gpt4 book ai didi

android - 我怎样才能在 flutter 中获得 android drawables

转载 作者:IT王子 更新时间:2023-10-29 06:41:31 24 4
gpt4 key购买 nike

Flutters 平台 channel 支持 null、int、double、string、list 和 map 等类型。但是如何才能获得特定于平台的类型,例如可绘制对象?

最佳答案

您可以将Drawables 转换为Bitmap,然后将Bitmap 转换为base64 字符串并通过平台发送 channel 并使用 Flutter 中的 Image.memory 构造函数将图像转换回来。我不确定通过平台 channel 对字符串大小的限制,但只要您的图像不是很大,它应该可以工作。

以下是我引用的答案:https://stackoverflow.com/a/9224180/8338783https://stackoverflow.com/a/46146008/8338783

关于android - 我怎样才能在 flutter 中获得 android drawables,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51368075/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com