toggleExpansionIfCollapsible method

void toggleExpansionIfCollapsible(
  1. MenuItemGroup group
)

Toggle the expansion of the group if it's collapsible.

Implementation

void toggleExpansionIfCollapsible(MenuItemGroup group) {
  if (group.isCollapsible) {
    group.isExpanded = !group.isExpanded;
  }
}