toggleSelected method

void toggleSelected(
  1. String hash
)

Escolhe ou desescolhe a música hash.

Implementation

void toggleSelected(String hash) {
  final selected = state.selection.selected;
  _emit(
    state.copyWith(
      selection: state.selection.copyWith(
        selected: selected.contains(hash)
            ? ({...selected}..remove(hash))
            : {...selected, hash},
      ),
    ),
  );
}