AnimatedExpand class
A customizable widget that expands and collapses with animation.
It supports both vertical and horizontal expansion, custom headers, and external controllers for programmatic control.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AnimatedExpand
Constructors
- AnimatedExpand({Key? key, required Widget expandedHeader, Widget? collapsedHeader, Widget? content, ExpandController? controller, ExpandState initialState = ExpandState.collapsed, Axis axis = Axis.vertical, double spacing = 0.0, Curve curve = Curves.fastOutSlowIn, Duration duration = Durations.medium1, Duration reverseDuration = Duration.zero, MainAxisSize mainAxisSize = MainAxisSize.min, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, Clip clipBehavior = Clip.hardEdge, bool reversed = false, void onEnd()?, AlignmentGeometry animationAlignment = Alignment.center})
-
Creates an AnimatedExpand widget.
const
Properties
- animationAlignment → AlignmentGeometry
-
Defines how the expanding content is aligned within its available space.
final
- axis → Axis
-
The axis along which the widget expands. Default is Axis.vertical.
final
- clipBehavior → Clip
-
The clipping behavior applied to the expanding content.
final
- collapsedHeader → Widget?
-
The widget displayed when the expand state is collapsed.
final
- content → Widget?
-
The content that expands and collapses.
final
- controller → ExpandController?
-
The controller used to manage the expand/collapse state.
final
- crossAxisAlignment → CrossAxisAlignment
-
Defines how the child widgets are positioned along the cross axis.
final
- curve → Curve
-
The animation curve used for expansion and collapse.
final
- duration → Duration
-
The duration of the expansion animation.
final
- expandedHeader → Widget
-
The widget displayed when the expand state is expanded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialState → ExpandState
-
The initial state of the widget.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainAxisAlignment → MainAxisAlignment
-
Defines how the child widgets are positioned along the main axis.
final
- mainAxisSize → MainAxisSize
-
Determines how much space the main axis should take.
final
- onEnd → void Function()?
-
A callback triggered when the animation completes.
final
- reversed → bool
-
If
true, places the content before the header.final - reverseDuration → Duration
-
The duration of the collapse animation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
The spacing between the header and the expandable content.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AnimatedExpand> -
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, int wrapWidth = 65}) → 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