DSSButton class

A customizable button widget that uses the Septeo design system.

This widget wraps an ElevatedButton and provides the following features:

  • Multiple button sizes (DSSButtonSize).
  • Multiple style variants (DSSButtonStyle).
  • Optional icons that can appear before and/or after the label.
  • Disabled state handling.
  • Focus/hover styling with custom color resolution.

The button automatically configures visual density, padding, text style, and colors (including background, foreground, and border) based on its current state (hover, focus, disabled) and the style configuration.

Inheritance

Constructors

DSSButton.new({Key? key, required String label, VoidCallback? onPressed, DSSButtonSize size = DSSButtonSize.medium, DSSButtonStyle styleType = DSSButtonStyle.primaryMain, bool disabled = false, Icon? beforeIcon, Icon? afterIcon, Size? fixedSize})
Creates a custom Septeo-styled ElevatedButton.
const

Properties

afterIcon Icon?
An optional icon that appears after the label.
final
beforeIcon Icon?
An optional icon that appears before the label.
final
disabled bool
Whether the button should be disabled.
final
fixedSize Size?
An optional fixed Size that overrides the button's default fixedSize in the style. This can be used when you want the button to have a specific dimension regardless of its label or size.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String
The text label to display inside the button.
final
onPressed VoidCallback?
The callback to be called when the button is pressed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size DSSButtonSize
The size of the button, which affects its overall dimensions, padding, and text style. Defaults to DSSButtonSize.medium.
final
styleType DSSButtonStyle
The style type of the button, which determines how the button is colored in its various states (hover, focus, disabled, etc.). Defaults to DSSButtonStyle.primaryMain.
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