IconButton3D class

An icon button that rotates 360° around its vertical axis on each tap, with a 3-D depth slab and a subtle wobble on hover.

Usage

IconButton3D(
  icon: Icons.favorite,
  color: Colors.pink,
  rotationAxis: Axis3DRotation.y,
  onPressed: () => toggleLike(),
)
Inheritance

Constructors

IconButton3D({Key? key, required IconData icon, Color color = const Color(0xFF42A5F5), Color iconColor = Colors.white, double size = 52.0, double depth = 5.0, int rotations = 1, Axis3DRotation rotationAxis = Axis3DRotation.y, Duration spinDuration = const Duration(milliseconds: 500), VoidCallback? onPressed})
const

Properties

color Color
final
depth double
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData
final
iconColor Color
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed VoidCallback?
final
rotationAxis Axis3DRotation
Which axis the spin animation uses.
final
rotations int
How many full rotations to perform per tap.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
final
spinDuration Duration
Duration of one complete spin.
final

Methods

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