configurationIsCorrect method

bool configurationIsCorrect()

Implementation

bool configurationIsCorrect() {
  bool isSubmenuContainer = submenu != null;
  bool enabled = isSubmenuContainer || onPressed != null || intent != null || shortcutActivator != null;
  bool isActionActivator = enabled && !isSubmenuContainer;

  if (isActionActivator)
    assert(atMostOneIsTrue3(onPressed != null, shortcutActivator != null, intent != null));

  assert(!(isSubmenuContainer && isActionActivator));

  if (this.enabled != null) {
    assert(!(isSubmenuContainer && !this.enabled!));
    assert(!(!enabled && this.enabled!));
  }

  return true;
}