SyncAdapter<M, D> class abstract

Base class for synchronization adapters for specific data sources.

This abstract class defines the interface for managing the synchronization of data between different sources. It is generic over:

  • M: The type representing synchronization metadata.
  • D: The type representing the detailed data associated with the metadata.
Implementers

Constructors

SyncAdapter({required String getMetadataId(M metadata), required FutureOr<bool> isCurrentMetadataBeforeOther(M current, M other)})
Constructs a SyncAdapter with the required functions for metadata handling.
const

Properties

getMetadataId String Function(M metadata)
A function that retrieves the unique identifier for the given metadata.
final
hashCode int
The hash code for this object.
no setterinherited
isCurrentMetadataBeforeOther FutureOr<bool> Function(M current, M other)
Determines if the current metadata item is older than the other metadata item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetchDetail(M metadata) FutureOr<D>
Retrieves the detailed data associated with the given metadata.
fetchMetadataList() FutureOr<List<M>>
Fetches a list of metadata items available for synchronization.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(M metadata, D? detail) FutureOr<void>
Saves the provided metadata and its associated detail to the data source.
toString() String
A string representation of this object.
inherited

Operators

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