abortSync method

Future<void> abortSync()

Blackholes any ongoing sync call. Currently ongoing sync processing is still going to be finished, new data is ignored.

Implementation

Future<void> abortSync() async {
  _aborted = true;
  backgroundSync = false;
  _currentSyncId = -1;
  try {
    await _currentTransaction;
  } catch (_) {
    // No-OP
  }
  _currentSync = null;
  // reset _aborted for being able to restart the sync.
  _aborted = false;
}