toggleAll method

void toggleAll()

Escolhe todas as músicas à vista; com todas já escolhidas, limpa.

Implementation

void toggleAll() {
  final shown = {for (final line in visible) line.hash};
  final selected = state.selection.selected;
  final next = selected.length == shown.length && shown.isNotEmpty
      ? <String>{}
      : shown;
  _emit(state.copyWith(selection: state.selection.copyWith(selected: next)));
}