flutter - 无法将类型为 'String' 的值分配给 flutter Getx 中类型为

我试图在 Getx Controller 中将图像转换为 base64 文本,但它显示错误消息“无法将‘String’类型的值分配给‘RxString’类型的变量”。

最佳答案

final RxString rxstring = 'Hello'.obs;

rxstring.value = 'Hi'; // <-- this can change the value of the Rx variable and also trigger its listeners

关于flutter - 无法将类型为 'String' 的值分配给 flutter Getx 中类型为 'RxString' 的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69969845/

相关文章:

javascript - 带有 Material-UI 的 SSR 上的@emotion/cache

awk - 使用 grep 或 awk 查找 txt 和 csv 文件之间的匹配行

python - AttributeError : module 'cv2.cv2' has no

python - 遍历列表并从头开始重新启动

intellij-idea - 如何将项目从 IDEA 连接到 Gitlab

perl - 从包含日期的文件中排序并提取一定数量的行

javascript - 如何使用 "onclick"方法获取数据属性?

python - 算法题: Finding the cheapest flight

haskell - 如何使用 `zipTree` 实现 `foldTree` ?

javascript - 如何在 react-native 中结合使用 Drawer Navigat