setMenuProperties method

void setMenuProperties(
  1. MenuProperties menuProperties
)

Implementation

void setMenuProperties(MenuProperties menuProperties) {
  int index = menus.indexWhere((element) => element.id == menuProperties.id);
  if (index != -1) {
    if (!menus[index].isSameMenu(menuProperties)) {
      menus[index] = menuProperties;
      update();
    }
  } else {
    menus.add(menuProperties);
    update();
  }
}