CNButtonConfig class

Configuration for CNButton with default values.

Constructors

CNButtonConfig({EdgeInsets? padding, double? borderRadius, double? minHeight, double? imagePadding, CNImagePlacement imagePlacement = CNImagePlacement.leading, CNButtonStyle style = CNButtonStyle.glass, double? width, bool shrinkWrap = false, String? glassEffectUnionId, String? glassEffectId, bool glassEffectInteractive = true, int? maxLines = 1, double? customIconSize, bool interaction = true, String? labelFontFamily, double? labelFontSize, Color? labelColor, Color? labelColorLight, Color? labelColorDark, FontWeight? labelFontWeight, bool animateSizeChanges = false, Duration sizeAnimationDuration = const Duration(milliseconds: 200), Curve sizeAnimationCurve = Curves.easeOut})
Creates a configuration for CNButton.
const

Properties

animateSizeChanges → bool
Whether a change of the button's size eases to the new size instead of jumping, for example when a shrink-wrapped button gets a wider label.
final
borderRadius → double?
Border radius for button corners. If null, uses capsule shape (always round).
final
customIconSize → double?
Size for custom icons (when using customIcon).
final
glassEffectId → String?
Optional ID for glass effect morphing transitions.
final
glassEffectInteractive → bool
Whether to make the glass effect interactive.
final
glassEffectUnionId → String?
Optional ID for glass effect union.
final
hashCode → int
The hash code for this object.
no setterinherited
imagePadding → double?
Padding between image and text (spacing in HStack).
final
imagePlacement → CNImagePlacement
Image placement relative to text when both are present.
final
interaction → bool
Whether the button responds to user interaction.
final
labelColor → Color?
Optional explicit color for the button label.
final
labelColorDark → Color?
The label colour while the button has a dark appearance: on glass that is dark (over dark content), or in dark mode for the other styles.
final
labelColorLight → Color?
The label colour while the button has a light appearance: on glass that is light (over light content), or in light mode for the other styles.
final
labelFontFamily → String?
Optional custom font family for the button label.
final
labelFontSize → double?
Optional font size (in points) for the button label.
final
labelFontWeight → FontWeight?
Optional weight for the button label.
final
maxLines → int?
Maximum number of lines for button text.
final
minHeight → double?
Minimum height for the button.
final
padding → EdgeInsets?
Padding around the button's content.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrap → bool
If true, sizes the control to its intrinsic width.
final
sizeAnimationCurve → Curve
The curve of a size change with animateSizeChanges. Defaults to Curves.easeOut.
final
sizeAnimationDuration → Duration
How long a size change takes with animateSizeChanges. Defaults to 200 ms.
final
style → CNButtonStyle
Visual style to apply.
final
width → double?
Fixed width used in icon/round mode.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited