CommonButton class
Shared button widget, with more variants than NeonButton (NeonButton
stays as-is, this doesn't replace it). primary/secondary/danger are
rounded pills with a label (secondary = outline/light background instead
of a solid gradient, danger = red tone); icon is a round icon-only
button (settings/close/...).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- CommonButton
Constructors
- CommonButton({Key? key, String? label, IconData? icon, CommonButtonVariant variant = CommonButtonVariant.primary, required VoidCallback? onTap, Color? color, double? width, String? semanticLabel, bool loading = false})
-
const
Properties
- color → Color?
-
Accent color. Default: cyan (primary/secondary), red (danger).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
final
- loading → bool
-
IDEA-53: shows a spinner in place of the label/icon and blocks taps
(even though onTap is non-null) while an async action this button
triggered — a purchase, a save, a cloud sync — is still in flight.
Deliberately keeps the button's accent color/shadow (see
_enabledvs_tappablebelow): visually this is "busy", not "unavailable", so it shouldn't look the same as a genuinely disabled button.final - onTap → VoidCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
final
- variant → CommonButtonVariant
-
final
- width → double?
-
Pill width (ignored for the icon variant, which uses width as its
diameter instead, if given).
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