TxExpansionPanelController class

启用对单个 TxExpansionPanel 的 expanded/collapsed 状态的控制。

以编程方式展开或折叠 TxExpansionPanel 可能很有用,例如,根据系统事件重新配置现有展开图块。 为此,请使用有状态小组件拥有的 TxExpansionPanelController 创建 TxExpansionPanel,或 使用 TxExpansionPanelController.of 查找磁贴自动创建的 TxExpansionPanelController

控制器的 expandcollapse 方法会导致 TxExpansionPanel 重新生成,因此不能从生成 方法调用它们。

Constructors

TxExpansionPanelController.new()
创建要与 TxExpansionPanel.controller 一起使用的控制器。

Properties

hashCode int
The hash code for this object.
no setterinherited
isExpanded bool
使用此控制器构建的 TxExpansionPanel 是否处于展开状态。
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collapse() → void
折叠使用此控制器生成的 TxExpansionPanel
expand() → void
展开使用此控制器构建的 TxExpansionPanel;
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

maybeOf(BuildContext context) TxExpansionPanelController?
从此类的最接近的实例中查找 TxExpansionPanel,该实例包含给定上下文并返回其 TxExpansionPanelController
of(BuildContext context) TxExpansionPanelController
查找包含给定上下文的最接近的 TxExpansionPanel 实例的 TxExpansionPanelController