Removes a page from this book, if it is inserted.
Source
bool remove(Page page) {
log("removing $page");
int idx = _pages.indexOf(page);
if (idx == -1) return false;
page._display = null;
if (_active == page) page.onEvent(PageEvent.offScreen, this);
_pages.removeAt(idx);
page.onEvent(PageEvent.removed, this);
page.book = null;
if (_active == page) {
if (_pages.isEmpty) {
_active = null;
return true;
}
// last element wraps around, else move right.
_active = _pages[idx % _pages.length];
_active.onEvent(PageEvent.onScreen, this);
}
return true;
}