flutter_offline_sync library

A comprehensive Flutter package for offline functionality with automatic sync capabilities.

This package provides:

  • Offline data storage with SQLite
  • Automatic network detection and sync
  • Conflict resolution strategies
  • Cross-platform support (iOS, Android, Web, Windows, macOS, Linux)
  • WASM compatibility
  • Background sync capabilities
  • Comprehensive error handling

Classes

ConflictResolver
Abstract class for custom conflict resolvers.
DefaultConflictResolver
Default conflict resolver that uses last-write-wins strategy.
Logger
A simple logging utility for the offline sync package.
NetworkManager
Manages network connectivity and HTTP operations.
OfflineDatabase
Manages the local database for offline storage.
OfflineSyncManager
The main manager class for offline synchronization functionality.
SyncConflict
Represents a conflict between local and remote versions of an entity.
SyncEngine
The core sync engine that handles synchronization between local and remote data.
SyncEntity
Base class for all entities that can be synced offline.
SyncStatus
Represents the current synchronization status of the offline sync manager.

Enums

ConflictResolutionStrategy
Enum representing different conflict resolution strategies.
ConflictType
Enum representing different types of conflicts.
SyncMode
Enum representing different sync modes.

Extensions

ConflictResolutionStrategyExtension on ConflictResolutionStrategy
Extension methods for ConflictResolutionStrategy enum.
ConflictTypeExtension on ConflictType
Extension methods for ConflictType enum.
SyncModeExtension on SyncMode
Extension methods for SyncMode enum.

Exceptions / Errors

AuthenticationException
Exception thrown when there's an authentication error.
AuthorizationException
Exception thrown when there's an authorization error.
EntityNotFoundException
Exception thrown when an entity is not found.
RateLimitException
Exception thrown when there's a rate limiting error.
SyncConflictException
Exception thrown when there's a conflict that cannot be resolved.
SyncDatabaseException
Exception thrown when there's a database error during sync.
SyncException
Base class for all sync-related exceptions.
SyncNetworkException
Exception thrown when there's a network error during sync.
SyncNotInitializedException
Exception thrown when the sync manager is not initialized.
SyncOperationException
Exception thrown when a sync operation fails.
TimeoutException
Exception thrown when there's a timeout error.
ValidationException
Exception thrown when there's a validation error.