upsert method
void
upsert({ - required String categoryId,
- required int totalCheckpoints,
- required int completedCheckpoints,
- DateTime? updatedAt,
})
Implementation
void upsert({
required String categoryId,
required int totalCheckpoints,
required int completedCheckpoints,
DateTime? updatedAt,
}) {
final normalizedTotal = totalCheckpoints < 0 ? 0 : totalCheckpoints;
_totalCheckpointsByCategoryId[categoryId] = normalizedTotal;
_entriesByCategoryId[categoryId] = CategoryProgressEntry(
totalCheckpoints: normalizedTotal,
completedCheckpoints: completedCheckpoints,
updatedAt: updatedAt ?? DateTime.now(),
);
revision.value++;
}