hive icon indicating copy to clipboard operation
hive copied to clipboard

Filtering valueListenable based on key value, not on key name.

Open pierrecorsini opened this issue 3 years ago • 0 comments

Context This is possible to filter listenable using a key array (https://docs.hivedb.dev/#/basics/hive_in_flutter?id=valuelistenable),

ValueListenableBuilder<Box>(
  valueListenable: Hive.box('settings').listenable(keys: ['firstKey', 'secondKey']),
  builder: (context, box, widget) {
    // build widget
  },
)

Question My Box contains a list of MyObject, I would like the widget to only rebuild if the MyObject linked to that widget is modified, is that possible ? I would imagine something like

ValueListenableBuilder<Box>(
  valueListenable: Hive.box('settings').listenable(➡️{'identifier', '30115ec4-72e9-411f-aaa6-607456434178'} ⬅️), 
  builder: (context, box, widget) {
    // build widget
  },
)

pierrecorsini avatar Aug 23 '22 22:08 pierrecorsini