backgroundSync property

void backgroundSync=(bool enabled)

Controls the background sync (automatically looping forever if turned on). If you use soft logout, you need to manually call ensureNotSoftLoggedOut() before doing any API request after setting the background sync to false, as the soft logout is handeld automatically in the sync loop.

Implementation

set backgroundSync(bool enabled) {
  _backgroundSync = enabled;
  if (_backgroundSync) {
    runInRoot(() async => _sync());
  }
}