closeLeft method
Close all tabs to the left of the one with id
. Locked tabs are not closed.
Implementation
@action
void closeLeft(String id) {
final index = tabs.indexWhere((t) => t.id == id);
if (index == 0) return;
tabs.removeWhere((t) => !t.locked && tabs.indexOf(t) < index);
selectedTab = tabs.indexWhere((t) => t.id == id);
}