setPage method
Sets the current page for the controller and initializes the necessary data structures.
Implementation
void setPage(int page) {
_currentPage = page;
_textBoxes.putIfAbsent(page, () => []);
_history.putIfAbsent(page, () => []);
_undoStack.putIfAbsent(page, () => []);
notifyListeners(); // Notify listeners to update UI or other components.
}