touchSlot method

void touchSlot(
  1. String id
)

Bumps slot id's lastPlayedAtMs to now — call when a play session in that slot starts, so listSlots surfaces it first next time. Throws ArgumentError if id doesn't exist.

Implementation

void touchSlot(String id) {
  _validateExists(id);
  final index = _indexOf(id);
  _slotList[index] = _slotList[index].copyWith(
    lastPlayedAtMs: nowMsClamped(),
  );
  _scheduleSave();
}