AnimateChangeIcon class

A AnimateChangeIcon is an icon button widget. When this button tapped, it change the icon from firstIcon to secondIcon with animations. The animations exist rotaion and scale.

{@tool snippet} This example shows how to create the button being able to change icons from a play button to a stop button.

AnimateChangeIcon(
  firstIcon: Icon(
    Icons.play_arrow_rounded,
    size: 50,
  ),
  secondIcon: Icon(
    Icons.stop_rounded,
    size: 50,
  ),
),

{@end-tool}

Inheritance

Constructors

AnimateChangeIcon({required Icon firstIcon, required Icon secondIcon, Duration animateDuration = const Duration(milliseconds: 300), bool initialPushed = false, AnimationController? animationController, Curve scaleAnimationCurve = Curves.linear, Curve rotateAnimationCurve = Curves.linear, double rotateBeginAngle = -pi / 2, double rotateEndAngle = 0.0, void onTap()?, Key? key})
const

Properties

animateDuration Duration
An animation's duration.
final
animationController AnimationController?
The controller for the animation of this button. This controller control the animation of scale and rotate. If controller is injected, this widget don't control an animation trigger.
final
firstIcon Icon
An icon for show first and after AnimateChangeIcon was pushed odd time. If initialPushed is true, this icon display after AnimateChangeIcon was pushed even time.
final
hashCode int
The hash code for this object.
no setterinherited
initialPushed bool
The flg for decide the state of first.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap → void Function()?
The callback function when on tap.
final
rotateAnimationCurve Curve
The animation of this button for rotate.
final
rotateBeginAngle double
A first angle of a rotate animation. A default value is -90 degree.
final
rotateEndAngle double
A final angle of a rotate animation. A default value is 0 degree.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleAnimationCurve Curve
The animation of this button for scale.
final
secondIcon Icon
An icon display after AnimateChangeIcon was pushed odd time. If initialPushed is true, this icon display after AnimateChangeIcon was pushed odd time or first.
final

Methods

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