4

I'm trying to use an ability of Floor package to subscribe to db changes getting a stream like that:

  @Query(
      'SELECT * from word INNER JOIN word_category_join ON word.id=word_category_join.word_id '
      'WHERE word_category_join.category_id=:categoryId')
  Stream<List<Word>> getWordsForCategoryAsStream(int categoryId);

And using it in a StreamBuilder in my views.

And according to the documentation, my stream should return a new snapshot every time the Word table changed, but it doesn't. What am I doing wrong?

3
  • how do you update the database? are you using floor package itself to update the db?
    – Sahandevs
    Commented Oct 3, 2019 at 10:36
  • @Sahandevs sure, using @insert/@update annotations
    – alectogeek
    Commented Oct 3, 2019 at 12:43
  • Post more code, especially the UI part with your StreamBuilder. I just went through the process and it works. With more code, we could help. Commented Apr 10, 2023 at 16:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.