MagentoSyncService class

Universal synchronization service for Magento data Provides offline-first sync capabilities with conflict resolution

Inheritance

Constructors

MagentoSyncService.new({required NetworkService networkService, Duration defaultSyncInterval = const Duration(minutes: 30), int maxRetryAttempts = 3, bool enableAutoSync = true})

Properties

currentStatus MagentoSyncStatus
no setter
defaultSyncInterval Duration
final
enableAutoSync bool
final
errorStream Stream<String>
Stream of sync errors
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
maxRetryAttempts int
final
networkService NetworkService
final
resultStream Stream<MagentoSyncResult>
Stream of sync results
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusStream Stream<MagentoSyncStatus>
Stream of sync status changes
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addToPendingSync(String dataType, List<Map<String, dynamic>> items) Future<void>
Add items to pending sync queue
cancelScheduledSync(String dataType) → void
Cancel scheduled sync for a data type
clearPendingSync(String dataType) Future<void>
Clear pending sync items for a data type
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getAllSyncStats() Future<Map<String, MagentoSyncStats>>
Get overall sync statistics
getPendingSyncItems(String dataType) Future<List<Map<String, dynamic>>>
Get pending sync items for a data type
getSyncStats(String dataType) Future<MagentoSyncStats>
Get sync statistics for a data type
initialize() Future<void>
Initialize the sync service
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
scheduleSync({required String dataType, Duration? interval, bool immediate = false}) Future<void>
Schedule automatic sync for a data type
syncAllPending() Future<Map<String, MagentoSyncResult>>
Force sync all pending data
syncData<T>({required String dataType, required List<T> items, required T fromJson(Map<String, dynamic>), required Map<String, dynamic> toJson(T), MagentoSyncStrategy syncStrategy = MagentoSyncStrategy.incremental, String? apiEndpoint, Future<T> conflictResolver(MagentoSyncConflict)?, Map<String, dynamic>? filters}) Future<MagentoSyncResult<T>>
Sync data with the cloud
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited