watchStores method

Stream<void> watchStores({
  1. List<String> storeNames = const [],
  2. bool triggerImmediately = false,
})

Watch for changes in the specified stores

Useful to update UI only when required, for example, in a StreamBuilder. Whenever this has an event, it is likely the other statistics will have changed.

Emits an event every time a change is made to a store:

  • a statistic change, which should include every time a tile is changed
  • a metadata change

If storeNames is empty, changes will be watched in all stores.

Implementation

Stream<void> watchStores({
  List<String> storeNames = const [],
  bool triggerImmediately = false,
}) async* {
  final stream = FMTCBackendAccess.internal.watchStores(
    storeNames: storeNames,
    triggerImmediately: triggerImmediately,
  );
  yield* stream;
}