Get value from Box Event to make my query in hive
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
Why I can't find an example about watch listener?
I have this method :
```
Stream> watchVocabsFromdb() => hiveService.vocabularyBox
.watch()
.map((event) => hiveService.vocabularyBox.values
.where((element) => element.remember == true)
.toList());
```
I want every time my box is changed I get new value so I wrote above code, But I always receive empty value In the event that in this method return values :
```
List getRememberVocabsFromdb() =>
hiveService.vocabularyBox.values
.where((element) => element.remember == true)
.toList();
```
How can I get value from Box Event to make my query?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the watchVocabsFromdb and getRememberVocabsFromdb methods shown in the issue, then inspect how Box.watch events relate to reads from vocabularyBox.values. A complete resolution should explain the empty filtered result and establish the expected values emitted whenever the box changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100