visible property

bool get visible

Gets or sets whether a GraphObject is visible. The default value is true. A not visible object takes no space in the Panel that it is in. Toggling visibility may cause elements in the visual tree to re-measure and re-arrange. Making a Panel not visible causes all of its elements not to be seen or receive input events. Changing a Panel to become visible causes all of its elements to be seen and be active, unless those elements are themselves not visible.

This object does not get any mouse/touch events if it is not #visible or if it is not #pickable.

One can have a visible Shape that is not drawn by setting its Shape#fill and Shape#stroke to null or to "transparent". Similarly, one can set TextBlock#stroke to null or to "transparent". It is also possible make a GraphObjects transparent by setting GraphObject#opacity to 0. Finally, one can make a whole Layer-full of Parts invisible by setting Layer#visible to false.

Use the #isVisibleObject predicate to see if this GraphObject is visible and is inside a Panel that is #isVisibleObject, and so forth up the chain of panels until reaching the Part.

For Parts, you can call the Part#isVisible predicate to determine if not only the Part is visible but also any containing Group or Link, and whether the Layer it is in is visible.

Implementation

_i2.bool get visible => _i4.getProperty(
      this,
      'visible',
    );
set visible (bool value)

Implementation

set visible(_i2.bool value) {
  _i4.setProperty(
    this,
    'visible',
    value,
  );
}