MihrButtonBase class abstract
Abstract base for all Mihr button widgets.
Provides a shared rendering stack, style resolution, and state management. Concrete subclasses supply visual defaults via defaultStyleOf and theme overrides via themeStyleOf.
Rendering stack
Tooltip? > Semantics > _InputPadding > ConstrainedBox >
MihrButtonContainer(bg, shape, shadows) > InkWell(states) >
Padding(H) > Center > MihrButtonData >
IconTheme + DefaultTextStyle > _ButtonContent
Style resolution
widget.style / styleBuilder > themeStyleOf > defaultStyleOf
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MihrButtonBase
- Implementers
Constructors
-
MihrButtonBase({required VoidCallback? onPressed, required Widget child, Key? key, VoidCallback? onLongPress, ValueChanged<
bool> ? onHover, ValueChanged<bool> ? onFocusChange, ButtonStyle? style, ButtonStyle styleBuilder(ButtonStyle resolved)?, FocusNode? focusNode, bool autofocus = false, WidgetStatesController? statesController, Widget? leadingIcon, Widget? trailingIcon, String? tooltip}) -
Creates a Mihr button with the given callbacks and content.
const
Properties
- autofocus → bool
-
Whether the button should be focused on first build.
final
- child → Widget
-
The button label, typically a Text widget.
final
- focusNode → FocusNode?
-
Controls keyboard focus.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leadingIcon → Widget?
-
Icon placed before the label.
final
-
onFocusChange
→ ValueChanged<
bool> ? -
Called when the focus state changes.
final
-
onHover
→ ValueChanged<
bool> ? -
Called when the hover state changes.
final
- onLongPress → VoidCallback?
-
Called when the button is long-pressed.
final
- onPressed → VoidCallback?
-
Called when the button is tapped. Pass
nullto disable.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statesController → WidgetStatesController?
-
Tracks interactive states (hover, focus, pressed, disabled).
final
- style → ButtonStyle?
-
Overrides the resolved ButtonStyle for this button instance.
final
- styleBuilder → ButtonStyle Function(ButtonStyle resolved)?
-
Receives the fully merged default+theme style and returns a
modified copy.
final
- tooltip → String?
-
Optional tooltip displayed on long-press or hover.
final
- trailingIcon → Widget?
-
Icon placed after the label.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MihrButtonBase> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
defaultStyleOf(
BuildContext context) → ButtonStyle - Builds the default ButtonStyle for this button type and size.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shadowsOf(
BuildContext context) → MihrButtonShadows - Returns the shadow configuration for this button variant.
-
themeStyleOf(
BuildContext context) → ButtonStyle? - Retrieves the theme-level ButtonStyle override, if registered.
-
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