addOrSwitchTab static method
Switches to the tab named title, or opens it. U.addOrSwitchTab("Users", const UsersPage())
Implementation
static void addOrSwitchTab(String title, Widget page) {
final int existingIndex = tabs.indexWhere((UTabData tab) => tab.title == title);
if (existingIndex != -1) {
tabController?.animateTo(existingIndex);
} else {
addTab(title, page);
tabController?.animateTo(tabs.length - 1);
}
}