getLastSyncTime method

Future<DateTime?> getLastSyncTime(
  1. String collectionName
)

Get last sync time for a collection

Implementation

Future<DateTime?> getLastSyncTime(String collectionName) async {
  _ensureInitialized();

  final records = await _isar.dataRecords
      .filter()
      .collectionNameEqualTo(collectionName)
      .sortByLastSyncedAtDesc()
      .findFirst();

  return records?.lastSyncedAt;
}