closeRight method

  1. @action
void closeRight(
  1. String id
)

Close all tabs to the right of the one with id. Locked tabs are not closed.

Implementation

@action
void closeRight(String id) {
  final index = tabs.indexWhere((t) => t.id == id);
  if (index == tabs.length - 1) return;
  tabs.removeWhere((t) => !t.locked && tabs.indexOf(t) > index);
  selectedTab = index;
}