enable abstract method

Future<void> enable(
  1. int userId, {
  2. bool waitForSync = false,
})

Turn on synchronization.

All existing entities will be processed (if there is a lot of them, this can take a while).

After that, synchronization will be started. If waitForSync is true, the method will wait until the synchronization is completed before returning. It can take a long time, so it is not recommended.

If sync already on - method will check last modified entities, to create actions if its didn't create because of close of the app.

After that sync attempt will be performed and sync in background will be scheduled.

userId defines which user enable sync. If previously sync was enable for different user, than all data will be cleared before start sync.

Implementation

Future<void> enable(int userId, {bool waitForSync = false});