CircleButton class

Circular button, similar to IconButton, but with the following differences:

  • The icon will be displayed inside the button.

  • A clickAreaMargin can be set, defining a rectangle around the circle, and all that rectangle is clickable, so that it's easier to click the button.

  • The backgroundColor: The background color of the button.

  • The tapColor is shown when the button is tapped-down.

  • The hoverColor is shown when the mouse is over the button.

  • elevation: The elevation of the button.

  • The onTap is the callback called when the button is tapped. If it's null, the tapColor will still be applied. This allows the button to be used inside of other widgets that detect gestures.

  • size: The size of the button.

  • iconPadding: The padding around the icon inside the button.

  • border: The border of the button.

  • cursor: The mouse cursor to be shown when hovering over the button.

  • clickAreaMargin: The margin around the circle that is also clickable.

  • colorOfClickableArea is the color of the clickable area, which is only shown when debugShowClickableArea is set to true, for debugging purposes. Otherwise, it's transparent.

  • builder: An optional custom builder function to modify the button's child widget. This can be used to animate the button when the button is tapped, or when the mouse is over it.

Inheritance
Available extensions

Constructors

CircleButton({Key? key, required Widget icon, EdgeInsetsGeometry? clickAreaMargin = const Pad(all: 3.0, left: 3.5), Color? tapColor = Colors.white24, Color? hoverColor, Border? border, VoidCallback? onTap, Color backgroundColor = Colors.transparent, double size = defaultSize, EdgeInsetsGeometry? iconPadding, double? elevation, MouseCursor? cursor = SystemMouseCursors.click, CircleButtonBuilder? builder, bool debugShowClickableArea = false})
Circular button, similar to IconButton, but with the following differences:
const

Properties

backgroundColor Color
final
border Border?
final
builder CircleButtonBuilder?
The builder can be used to animate the button when the button is tapped, or when the mouse is over it.
final
clickAreaMargin EdgeInsetsGeometry?
final
colorOfClickableArea Color
final
cursor MouseCursor?
final
elevation double?
final
hashCode int
The hash code for this object.
no setterinherited
hoverColor Color?
final
icon Widget
final
iconPadding EdgeInsetsGeometry?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap VoidCallback?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
final
tapColor Color?
final

Methods

addMaterialWidget() Material

Available on Widget, provided by the GenericExtensions extension

addTooltipWidget(String toolTip) Tooltip

Available on Widget, provided by the GenericExtensions extension

animate({Key? key, List<Effect>? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) Animate

Available on Widget, provided by the AnimateWidgetExtensions extension

Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
borderRadius([BorderRadiusGeometry? borderRadius]) Widget

Available on Widget, provided by the GenericExtensions extension

boxDecoration([BoxDecoration? boxDecoration]) Widget

Available on Widget, provided by the GenericExtensions extension

colorFilter([ColorFilter? colorFilter]) Widget

Available on Widget, provided by the GenericExtensions extension

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

Constants

defaultSize → const double
minVisualTapDuration → const Duration