changeExerciseIndex method
Implementation
void changeExerciseIndex(int newIndex) {
if (_plan == null || _state == null) return;
if (newIndex < 0 || newIndex >= _plan!.exercises.length) return;
if (_state!.exerciseIndex == newIndex) return;
final now = DateTime.now();
_state = _state!.copyWith(
exerciseIndex: newIndex,
setIndex: 0,
updatedAt: now,
);
_persist();
notifyListeners();
}