updateSections method

void updateSections(
  1. UniqueKey key
)

adds or removes a section key from the list of open sections and notifies sections to open or close accordingly

Implementation

void updateSections(UniqueKey key) {
  openSections.contains(key)
      ? openSections.remove(key)
      : openSections.add(key);

  while (openSections.length > maxOpenSections) {
    openSections.removeAt(0);
  }

  controllerIsOpen.sink.add('update list');
}