使用 obx 来实现 RxList 的 Getx

huangapple go评论78阅读模式
英文:

Getx using obx for RxList

问题

所以我在Getx控制器中有一个列表,然后在ListView中有多个组件,我使用不同的列表包装每个组件,然后将ListView的父级包装在Obx中,但它给我一个警告,而且没有使用.refresh()添加的列表不更新状态。

我只想用Obx包装小部件然后更新,但它抛出错误。

英文:

so i have a list in Getx controller then i have a multiple component in a listview and i put every component with different list and i wrap the listview parent with obx but it give me this warning and not updating the state without the list added with .refresh()

i just want to wrap the widget with obx then update but it throws error

使用 obx 来实现 RxList 的 Getx

使用 obx 来实现 RxList 的 Getx

答案1

得分: 0

只需在RxList的列表名称后添加.toList(),与其他值使用.value不同。

英文:

I just found the answer, for RxList we just need to add .toList() after the list name list.toList() different with other value using .value

huangapple
  • 本文由 发表于 2023年1月6日 14:10:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75027540.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定