hidden method

ElementBuilder hidden([
  1. bool h = true
])

Hides the element from display.

Example:

Div().hidden()  // hidden = true
Div().hidden(false)  // explicitly visible

Implementation

ElementBuilder hidden([bool h = true]) {
  if (h) {
    attr('hidden', BooleanAttribute(true));
  } else {
    // Remove attribute if explicitly set to false
    _attrs.remove('hidden');
  }
  return this;
}