WidgetTransition<T> class

A widget to apply a crossfade animation between different states and/or widgets.

Inheritance

Constructors

WidgetTransition({Key? key, Duration duration = const Duration(milliseconds: 750), required T value, required Widget builder(BuildContext, T), bool equals(T, T) = _defaultEquals, bool highlightTransition(T, T) = _defaultHighlightTransition, double highlightScale = 1.2, Duration? highlightDuration, Curve curve = Curves.easeIn, Curve? disappearingCurve, Curve highlightingCurve = Curves.ease, Curve? highlightingReverseCurve, required Widget transitionBuilder(BuildContext context, Widget? previousChild, Widget child, T? previous, T current, Animation<double> animation)})
The default constructor of WidgetTransition.
const

Properties

builder Widget Function(BuildContext, T)
The builder which builds the different values during the animation.
final
curve Curve
Curve of the fading in animation.
final
disappearingCurve Curve?
Curve of the fading out animation. Defaults to curve.flipped.
final
duration Duration
The duration of the fading.
final
equals bool Function(T, T)
The overriding of the equals function. WidgetTransition only animates between two different values if equals returns false for these two.
final
hashCode int
The hash code for this object.
no setterinherited
highlightDuration Duration?
The duration of the whole highlight animation. Defaults to duration.
final
highlightingCurve Curve
Curve of the highlighting animation.
final
highlightingReverseCurve Curve?
Reverse curve of the highlighting animation. Defaults to highlightingCurve.flipped.
final
highlightScale double
The maximum scale during the highlight animation.
final
highlightTransition bool Function(T, T)
WidgetTransition only highlights the new value during the animation if highlightTransition returns true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transitionBuilder Widget Function(BuildContext context, Widget? previousChild, Widget child, T? previous, T current, Animation<double> animation)
Transition of the animation. previous and previousChild are null if no transition is currently in progress.
final
value → T
The current value.
final

Methods

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