CNButtonTheme class

Unified color and material theme for glass buttons.

When tint is provided, it takes priority over labelColor and iconColor.

Example:

CNButtonTheme(
  tint: Colors.blue,
  backgroundColor: Colors.blue.withOpacity(0.2),
  glassMaterial: CNButtonGlassMaterial.regular,
)

Constructors

CNButtonTheme({Color? tint, Color? labelColor, Color? iconColor, Color? backgroundColor, CNButtonGlassMaterial glassMaterial = CNButtonGlassMaterial.regular, TextStyle? labelStyle})
Creates a button theme.
const

Properties

backgroundColor → Color?
Glass background tint color.
final
glassMaterial → CNButtonGlassMaterial
Glass material for the button effect on iOS 26+ / macOS 26+.
final
hashCode → int
The hash code for this object.
no setterinherited
iconColor → Color?
Icon color. Used when tint is null.
final
labelColor → Color?
Text label color. Used when tint is null.
final
labelStyle → TextStyle?
Optional text style for the button label.
final
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stringify → bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
tint → Color?
Tint applied to both label and icon. Takes priority over labelColor and iconColor.
final

Methods

copyWith({Color? tint, Color? labelColor, Color? iconColor, Color? backgroundColor, CNButtonGlassMaterial? glassMaterial, TextStyle? labelStyle}) → CNButtonTheme
Creates a copy of this theme with the given fields replaced.
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