diff --git a/CHANGELOG.md b/CHANGELOG.md index be80a68..d21afd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.13.0] + +* Method `pause()`. +* Method `resume()`. +* Added `isPaused` getter. + ## [1.12.0] * Added new `SyncError` values: diff --git a/lib/src/sync_repository.dart b/lib/src/sync_repository.dart index ab7d0ce..9ae157f 100644 --- a/lib/src/sync_repository.dart +++ b/lib/src/sync_repository.dart @@ -12,6 +12,9 @@ abstract class SyncRepository { /// will be ignored. Future get isEnabled; + /// `true` if synchronization is paused. + bool get isPaused; + /// Turn on synchronization. /// /// All existing entities will be processed (if there is a lot of them, @@ -103,4 +106,15 @@ abstract class SyncRepository { /// and does **not** consider the download status of data or files from the remote. /// It only evaluates the local state against the last known synchronization. Future hasUnsyncedChanges(); + + /// Pauses synchronization. + /// + /// Background synchronization will also be stopped. + Future pause(); + + /// Resumes paused synchronization. + /// + /// Unlike [enable], it does not process entities, but only unlocks synchronization. + /// Background synchronization will also be started. + Future resume(); } diff --git a/pubspec.yaml b/pubspec.yaml index f303f31..eaaec28 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: in_sync_interface description: An interface for synchronization functional. Used by in_sync. -version: 1.12.0 +version: 1.13.0 homepage: https://github.com/innim/ repository: https://github.com/Innim/in_sync_interface issue_tracker: https://github.com/Innim/in_sync_interface/issues