ExpansionWidget class

A widget with a customizable title that can expands or collapses the widget to reveal or hide the content.

Inheritance

Constructors

ExpansionWidget({Key? key, required Widget titleBuilder(double animationValue, double easeInValue, bool isExpanded, dynamic toggleFunction({bool animated})), bool onExpansionWillChange(bool)?, void onExpansionChanged(bool)?, required Widget content, bool initiallyExpanded = false, bool maintainState = false, Alignment expandedAlignment = Alignment.center, void onSaveState(BuildContext context, bool isExpanded)?, bool? onRestoreState(BuildContext)?, Duration duration = const Duration(milliseconds: 200)})
Creates a widget with a customizable title that can expands or collapses the widget to reveal or hide the content.
const
ExpansionWidget.autoSaveState({Key? key, required Widget titleBuilder(double animationValue, double easeInValue, bool isExpanded, dynamic toggleFunction({bool animated})), bool onExpansionWillChange(bool)?, void onExpansionChanged(bool)?, required Widget content, bool initiallyExpanded = false, Alignment expandedAlignment = Alignment.center, Duration duration = const Duration(milliseconds: 200)})
const

Properties

content Widget
The widget that are displayed when the expansionWidget expands.
final
duration Duration
The length of time of animation
final
expandedAlignment Alignment
Specifies the alignment of content, which are arranged in a column when the expansionWidget is expanded.
final
hashCode int
The hash code for this object.
no setterinherited
initiallyExpanded bool
Specifies if the expansionWidget is initially expanded (true) or collapsed (false, the default).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maintainState bool
Specifies whether the state of the content is maintained when the expansionWidget expands and collapses.
final
onExpansionChanged → (void Function(bool)?)
Called when the widget expands or collapses.
final
onExpansionWillChange → (bool Function(bool)?)
Called when the widget will change expanded state.
final
onRestoreState → (bool? Function(BuildContext)?)
function to restore expansion state. Return null if there is no state to store; in this case, initiallyExpanded will be used
final
onSaveState → (void Function(BuildContext context, bool isExpanded)?)
Function to save expansion state Called when expansion state changed
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
titleBuilder Widget Function(double animationValue, double easeInValue, bool isExpanded, dynamic toggleFunction({bool animated}))
The builder of title.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() ExpansionWidgetState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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