restore method
Restore the items to the previous state.
if onlyOnce
, it would try to pop the history once to show the previous history result;
otherwise, it would clear all history and show the original items.
Implementation
void restore({bool onlyOnce = false}) {
if (onlyOnce) {
_popHistory();
} else {
_clearHistory();
}
rebuildMenu();
}