CClick class

A customizable widget that wraps its child with hover and tap functionality.

The CClick widget provides an easy way to add interactive behaviors to any widget, including hover effects, tap, double tap, and long press actions. It also allows customization of the mouse cursor when hovering over the widget.

Example usage:

CClick(
  onTap: () => print('Tapped!'),
  onHover: (isHovering) => print('Hover state: $isHovering'),
  child: Container(
    width: 100,
    height: 100,
    color: Colors.blue,
    child: Center(child: Text('Click me')),
  ),
)
Inheritance
Available extensions

Constructors

CClick({Key? key, required Widget child, dynamic onHover(bool)?, dynamic onTap()?, dynamic onDoubleTap()?, dynamic onLongPress()?, MouseCursor cursor = SystemMouseCursors.click})
Creates a CClick widget.
const

Properties

child Widget
The widget below this widget in the tree.
final
cMargZero Widget

Available on Widget, provided by the CustomWidgetMargin extension

Adds zero margin to the widget.
no setter
cPadZero Widget

Available on Widget, provided by the CustomWidgetPadding extension

Removes all padding from the widget.
no setter
cToCenter Widget

Available on Widget, provided by the CustomWidgetPosition extension

Center the widget within its parent.
no setter
cToSliver Widget

Available on Widget, provided by the CustomWidgetSliverBox extension

Converts the widget into a SliverToBoxAdapter.
no setter
cursor MouseCursor
The mouse cursor to be used when hovering over the widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDoubleTap → dynamic Function()?
Called when the widget is double tapped.
final
onHover → dynamic Function(bool)?
Called when a pointer enters or exits the widget's bounds.
final
onLongPress → dynamic Function()?
Called when the widget is long-pressed.
final
onTap → dynamic Function()?
Called when the widget is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
cAbsorb(bool absorb) Widget

Available on Widget, provided by the CustomWidgetVisibility extension

Disable clicks on the widget.
cAlignment(AlignmentGeometry align) Widget

Available on Widget, provided by the CustomWidgetPosition extension

Align the widget within its parent using a specified alignment.
cAspectRatio(double ratio) Widget

Available on Widget, provided by the CustomWidget extension

Create a widget with a specific aspect ratio.
cBanner({bool disable = false, required BannerLocation location, required String message, required Color color, double crop = 0}) Widget

Available on Widget, provided by the CustomWidgetBanner extension

Wraps the widget with a banner if not disabled.
cClipAll(double radius) Widget

Available on Widget, provided by the CustomWidgetClipRRect extension

Clip the widget with a uniform radius on all corners.
cClipHorizontal({double l = 0.0, double r = 0.0}) Widget

Available on Widget, provided by the CustomWidgetClipRRect extension

Clip the widget with different horizontal radii for left and right corners.
cClipOnly({double tl = 0.0, double tr = 0.0, double bl = 0.0, double br = 0.0}) Widget

Available on Widget, provided by the CustomWidgetClipRRect extension

Clip the widget with different radii for each corner.
cClipVertical({double t = 0.0, double b = 0.0}) Widget

Available on Widget, provided by the CustomWidgetClipRRect extension

Clip the widget with different vertical radii for top and bottom corners.
cExpanded(int flex) Widget

Available on Widget, provided by the CustomWidgetPosition extension

Make the widget expand to fill available space with a specified flex factor.
cHero(Object tag) Widget

Available on Widget, provided by the CustomWidget extension

Create a widget for hero animations.
cMargAll(double margin) Widget

Available on Widget, provided by the CustomWidgetMargin extension

Adds margin to all sides of the widget.
cMargOnly({double l = 0.0, double t = 0.0, double r = 0.0, double b = 0.0}) Widget

Available on Widget, provided by the CustomWidgetMargin extension

Adds margin to specific sides of the widget.
cMargSymmetric({double h = 0.0, double v = 0.0}) Widget

Available on Widget, provided by the CustomWidgetMargin extension

Adds symmetric margin to the widget.
cOpacity(double opacity) Widget

Available on Widget, provided by the CustomWidgetVisibility extension

Set the opacity of the widget.
cPadAll(double padding) Widget

Available on Widget, provided by the CustomWidgetPadding extension

Adds uniform padding to all sides of the widget.
cPadOnly({double l = 0.0, double t = 0.0, double r = 0.0, double b = 0.0}) Widget

Available on Widget, provided by the CustomWidgetPadding extension

Adds padding to specific sides of the widget (left, top, right, bottom).
cPadSymmetric({double h = 0.0, double v = 0.0}) Widget

Available on Widget, provided by the CustomWidgetPadding extension

Adds horizontal and vertical padding to the widget.
cPosition({double? t, double? b, double? l, double? r}) Widget

Available on Widget, provided by the CustomWidgetPosition extension

Position the widget at specific offsets from the top, bottom, left, or right within its parent.
cPreferSize(double h) PreferredSizeWidget

Available on Widget, provided by the CustomWidget extension

Create a widget with a preferred size.
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
cShadow({BoxShape shape = BoxShape.rectangle, Clip clipBehavior = Clip.none, BorderRadius? borderRadius, double elevation = 0.0, Color color = Colors.transparent}) Widget

Available on Widget, provided by the CustomWidgetVisibility extension

Add a shadow effect to the widget.
cSizedBox(double? h, double? w) Widget

Available on Widget, provided by the CustomWidget extension

Create a widget with a fixed size.
cVisible(bool visible) Widget

Available on Widget, provided by the CustomWidgetVisibility extension

Set the visibility of the widget.
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