int getTabIndex(String tabName) { final index = tabs.indexWhere((tab) => tab.name == tabName); return index >= 0 ? index : 0; }