InspectorButton class abstract

An abstract base class for creating Material or Cupertino-styled inspector buttons.

Subclasses are responsible for implementing the design-specific rendering logic in the build method and providing design-specific colors via foregroundColor and backgroundColor.

Inheritance

Constructors

InspectorButton({Key? key, required VoidCallback onPressed, required String semanticLabel, required IconData icon, GlobalKey<State<StatefulWidget>>? buttonKey, required InspectorButtonVariant variant, bool? toggledOn})
Creates an inspector button.
const
InspectorButton.filled({Key? key, required VoidCallback onPressed, required String semanticLabel, required IconData icon, GlobalKey<State<StatefulWidget>>? buttonKey})
Creates an inspector button with the InspectorButtonVariant.filled style.
const
InspectorButton.iconOnly({Key? key, required VoidCallback onPressed, required String semanticLabel, required IconData icon})
Creates an inspector button with the InspectorButtonVariant.iconOnly style.
const
InspectorButton.toggle({Key? key, required VoidCallback onPressed, required String semanticLabel, required IconData icon, bool toggledOn = true})
Creates an inspector button with the InspectorButtonVariant.toggle style.
const

Properties

buttonKey GlobalKey<State<StatefulWidget>>?
An optional key to identify the button widget.
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData
The icon to display within the button.
final
iconSizeForVariant double
Gets the appropriate icon size based on the button's variant.
no setter
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed VoidCallback
The callback that is called when the button is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String
The semantic label for the button, used for accessibility.
final
toggledOn bool?
For InspectorButtonVariant.toggle buttons, this determines if the button is currently in the "on" (true) or "off" (false) state.
final
variant InspectorButtonVariant
The visual and behavioral variant of the button.
final

Methods

backgroundColor(BuildContext context) Color
Provides the appropriate background color for the button.
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
foregroundColor(BuildContext context) Color
Provides the appropriate foreground color for the button's icon.
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

Constants

buttonIconSize → const double
The standard size for the icon when it's not the only element (e.g., in filled or toggle buttons).
buttonSize → const double
The standard height and width for the button.