Collapse constructor

Collapse(
  1. Element element, {
  2. bool? toggle,
  3. String? parent,
})

Construct a collapse component and wire it to element. *

    • If toggle is true, Toggles the collapsible element on invocation. Default: true.
  • parent determines if selector then all collapsible elements under the specified parent
  • will be closed when this collapsible item is shown.
  • (similar to traditional accordion behavior -
  • this dependent on the accordion-group class)

Implementation

Collapse(Element element, {bool? toggle, String? parent}) :
this._toggle  = _data(toggle, element, 'toggle', true),
super(element, _name) {
  if (parent == null)
    parent = element.attributes["data-parent"];
  if (parent != null)
    _$parent = $(parent);

  if (_toggle)
    this.toggle();
}