我在 Flutter 中使用ObjectBox数据库。
现在我想观察特定实体的数据并在该实体更新时更改列表。
我看到文档DataObserver & Rx并尝试按如下方式实现它。
Stream<Query<InvoiceList>> watchedQuery = deliveryListBox!.query(InvoiceList_.dispatch.equals(true)).watch();
sub1 = watchedQuery.listen((Query<InvoiceList> query) {
// This gets triggered any there are changes to the queried entity types.
// You can call any query method here, for example:
getDataFromLocal("");
});
我想在调度发生变化时更新列表,但这段代码没有发生任何事情。
任何人都可以帮助实现这一目标吗?