AnimatedClipReveal class

A widget that does a an animated clip path reveal between a new widget and the widget previously set on the AnimatedClipReveal as a child.

Similar to the core AnimatedSwitcher, with one notable difference:

  • Previous widgets do not transition out. AnimatedClipReveal assumes that the new widget will completely obscure the previous child(ren). Once the new widget has been revealed, all previous child(ren) are removed.

If they are swapped fast enough (i.e. before duration elapses), more than one previous child can exist. The clip tranistions will be layered on top of each other.

If the "new" child is the same widget type and key as the "old" child, but with different parameters, then AnimatedSwitcher will not do a transition between them, since as far as the framework is concerned, they are the same widget and the existing widget can be updated with the new parameters. To force the transition to occur, set a Key on each child widget that you wish to be considered unique (typically a ValueKey on the widget data that distinguishes this child from the others).

When a new child widget is set, AnimatedClipReveal will use the pathBuilder, duration, curve and clipBehaviour for the tranistion. It is therefore possible to show each new child with its own transition.

See also:

Inheritance

Constructors

AnimatedClipReveal({Key? key, required Widget child, Duration duration = AnimatedClipReveal.defaultDuration, PathBuilder pathBuilder = PathBuilders.slideUp, Curve curve = Curves.linear, Clip clipBehavior = Clip.antiAlias, StackFit fit = StackFit.loose, bool revealFirstChild = false})
Creates an AnimatedClipReveal.
const

Properties

child Widget
The current child widget to display.
final
clipBehavior Clip
The clipBehavior of the ClipPathTransition applied to the new child.
final
curve Curve
The animation curve applied to the ClipPathTransition applied to the new child.
final
duration Duration
The duration of the ClipPathTransition applied to the new child.
final
fit StackFit
How to size the non-positioned child in the stack.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
pathBuilder PathBuilder
The PathBuilder of the ClipPathTransition applied to the new child.
final
revealFirstChild bool
Whether to animate the initial child widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _AnimatedClipRevealState
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

Constants

defaultDuration → const Duration