From f311a6dce58079f2eba60bab090eece93eabe373 Mon Sep 17 00:00:00 2001 From: "s.t.o.k.a.t.o" Date: Thu, 4 Dec 2025 15:00:14 +0300 Subject: [PATCH 1/3] Methods `pause()` and `resume()` and `isPaused` getter added. --- CHANGELOG.md | 6 ++++++ lib/src/sync_repository.dart | 17 +++++++++++++++++ pubspec.yaml | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be80a68..804a31b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.12.1] + +* 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..13290c4 100644 --- a/lib/src/sync_repository.dart +++ b/lib/src/sync_repository.dart @@ -12,6 +12,12 @@ abstract class SyncRepository { /// will be ignored. Future get isEnabled; + /// `true` if synchronization is paused. + /// + /// If synchronization is off, all sync calls and entities changes + /// will be ignored. + bool get isPaused; + /// Turn on synchronization. /// /// All existing entities will be processed (if there is a lot of them, @@ -103,4 +109,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(); + + /// Removes synchronization from pause. + /// + /// 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..f920fe1 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.12.1 homepage: https://github.com/innim/ repository: https://github.com/Innim/in_sync_interface issue_tracker: https://github.com/Innim/in_sync_interface/issues From f2b8f144dcbcf4f35e82da5cce6faa8a0ab38b5a Mon Sep 17 00:00:00 2001 From: "s.t.o.k.a.t.o" Date: Thu, 4 Dec 2025 15:44:00 +0300 Subject: [PATCH 2/3] Fix version --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804a31b..d21afd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## [1.12.1] +## [1.13.0] * Method `pause()`. * Method `resume()`. diff --git a/pubspec.yaml b/pubspec.yaml index f920fe1..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.1 +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 From 74f2f19e732fd710b0550f6604b4a42275337839 Mon Sep 17 00:00:00 2001 From: "s.t.o.k.a.t.o" Date: Thu, 4 Dec 2025 15:49:48 +0300 Subject: [PATCH 3/3] Fix documentation --- lib/src/sync_repository.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/src/sync_repository.dart b/lib/src/sync_repository.dart index 13290c4..9ae157f 100644 --- a/lib/src/sync_repository.dart +++ b/lib/src/sync_repository.dart @@ -13,9 +13,6 @@ abstract class SyncRepository { Future get isEnabled; /// `true` if synchronization is paused. - /// - /// If synchronization is off, all sync calls and entities changes - /// will be ignored. bool get isPaused; /// Turn on synchronization. @@ -115,7 +112,7 @@ abstract class SyncRepository { /// Background synchronization will also be stopped. Future pause(); - /// Removes synchronization from pause. + /// Resumes paused synchronization. /// /// Unlike [enable], it does not process entities, but only unlocks synchronization. /// Background synchronization will also be started.