LumenButton class

Neon button with three variants: LumenButtonVariant.solid, LumenButtonVariant.outline and LumenButtonVariant.ghost. For primary CTA with full gradient, prefer LumenButtonVariant.solid (or the historical shortcut LumenCta).

Set tone to give the button a semantic color. A solid button with a tone fills with that color instead of the accent gradient, so a destructive confirmation reads as one:

LumenButton.danger(label: 'Delete', icon: Icons.delete_outline, onPressed: onDelete);
LumenButton.outline(label: 'Retry', tone: LumenStatusTone.warning, onPressed: onRetry);
Inheritance

Constructors

LumenButton({required String label, required VoidCallback? onPressed, Key? key, LumenButtonVariant variant = LumenButtonVariant.solid, IconData? icon, bool busy = false, Color? accentColor, LumenStatusTone? tone, double borderRadius = 14, bool expand = false})
Creates a neon button on the informed variant.
const
LumenButton.danger({required String label, required VoidCallback? onPressed, Key? key, IconData? icon, bool busy = false, Color? accentColor, double borderRadius = 14, bool expand = false})
Shortcut for a solid button with LumenStatusTone.danger.
const
LumenButton.ghost({required String label, required VoidCallback? onPressed, Key? key, IconData? icon, bool busy = false, Color? accentColor, LumenStatusTone? tone, double borderRadius = 14, bool expand = false})
Shortcut for LumenButtonVariant.ghost.
const
LumenButton.outline({required String label, required VoidCallback? onPressed, Key? key, IconData? icon, bool busy = false, Color? accentColor, LumenStatusTone? tone, double borderRadius = 14, bool expand = false})
Shortcut for LumenButtonVariant.outline.
const

Properties

accentColor → Color?
Accent override for the outline, ghost content, or solid shadow.
final
borderRadius → double
Radius of button corners in logical pixels.
final
busy → bool
Whether to show a progress indicator and disable the button.
final
expand → bool
If true, it occupies the entire available width.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
Optional icon displayed before label.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String
Text displayed on the button.
final
onPressed → VoidCallback?
Callback executed when touching the button. When null, the button is visually disabled.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tone → LumenStatusTone?
Semantic color of the button, resolved from the active palette.
final
variant → LumenButtonVariant
Visual variant applied to the button.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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