Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.13.0]

* Method `pause()`.
* Method `resume()`.
* Added `isPaused` getter.

## [1.12.0]

* Added new `SyncError` values:
Expand Down
14 changes: 14 additions & 0 deletions lib/src/sync_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ abstract class SyncRepository {
/// will be ignored.
Future<bool> 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,
Expand Down Expand Up @@ -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<bool> hasUnsyncedChanges();

/// Pauses synchronization.
///
/// Background synchronization will also be stopped.
Future<void> pause();

/// Resumes paused synchronization.
///
/// Unlike [enable], it does not process entities, but only unlocks synchronization.
/// Background synchronization will also be started.
Future<void> resume();
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down