watchChanges method

Stream<void> watchChanges({
  1. 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

Implementation

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