在riverpod 中是否有相当于bloc 的buildwhen?

问题描述

Bloc 的 buildwhen 允许您仅重建已更新的列表项。 (请参阅此处的文章How to prevent unnecessary renders in Flutter?

是否有等效的功能方法可以防止在 riverpod 中进行此类不需要的构建?

解决方法

使用 HooksWidget / hooks_riverpod 时可用的 select 方法效果很好。小部件仅在给选择更改的回调时重建。

This documentation 因为它是发布时的最新信息。