How to use notifyUpdates()
and markTablesUpdated()
and what is the difference between them?
#1384
-
I searched the whole internet and can't seem to find an answer on how to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
final db = Provider.of<AppDatabase>(context, listen: false);
db.markTablesUpdated({db.stopwatches});
If we obverse a delete on table |
Beta Was this translation helpful? Give feedback.
markTablesUpdated
marks a table as updated (duh :D). This means that all active streams which might depend on that table will be getting updated. It takes a set ofTableInfo
objects.TableInfo
is the base class for generated moor tables. You can obtain them using the database class:notifyUpdates
is more precise: Instead of just describing the tables that changed, it can describe what kind of update has happened (insert, update or delete). This is used for stream updates in complex scenarios. For instance, considera
andb
b
after a delete ona