contains method

bool contains(
  1. VoyagerPage page
)

check if this stack contains the given page (match by VoyagerPage.path and VoyagerPage.id)

Implementation

bool contains(VoyagerPage page) {
  for (final item in _items) {
    if (item is VoyagerStack && item.contains(page)) {
      return true;
    } else if (item is VoyagerPage &&
        page.id == item.id &&
        page.path == item.path) {
      return true;
    }
  }
  return false;
}