JsonIconButtonBuilderModel class
Creates an icon button.
Icon buttons are commonly used in the AppBar.actions field, but they can be used in many other places as well.
Requires one of its ancestors to be a Material widget. This requirement no longer exists if ThemeData.useMaterial3 is set to true.
The icon argument must be specified, and is typically either an Icon or an ImageIcon.
- Inheritance
-
- Object
- JsonClass
- JsonWidgetBuilderModel
- JsonIconButtonBuilderModel
Constructors
-
JsonIconButtonBuilderModel(Map<
String, dynamic> args, {AlignmentGeometry? alignment, bool autofocus = false, Color? color, BoxConstraints? constraints, Color? disabledColor, bool? enableFeedback, Color? focusColor, FocusNode? focusNode, Color? highlightColor, Color? hoverColor, required JsonWidgetData icon, double? iconSize, bool? isSelected, MouseCursor? mouseCursor, required void onPressed()?, EdgeInsetsGeometry? padding, JsonWidgetData? selectedIcon, Color? splashColor, double? splashRadius, ButtonStyle? style, String? tooltip, VisualDensity? visualDensity}) -
const
Properties
- alignment → AlignmentGeometry?
-
Defines how the icon is positioned within the IconButton.
final
-
args
→ Map<
String, dynamic> -
finalinherited
- autofocus → bool
-
True if this widget will be selected as the initial focus when no other
node in its scope is currently focused.
final
- color → Color?
-
The color to use for the icon inside the button, if the icon is enabled.
Defaults to leaving this up to the icon widget.
final
- constraints → BoxConstraints?
-
Optional size constraints for the button.
final
- disabledColor → Color?
-
The color to use for the icon inside the button, if the icon is disabled.
Defaults to the ThemeData.disabledColor of the current Theme.
final
- enableFeedback → bool?
-
Whether detected gestures should provide acoustic and/or haptic feedback.
final
- focusColor → Color?
-
The color for the button when it has the input focus.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightColor → Color?
-
The secondary color of the button when the button is in the down (pressed)
state. The highlight color is represented as a solid color that is overlaid over the
button color (if any). If the highlight color has transparency, the button color
will show through. The highlight fades in quickly as the button is held down.
final
- hoverColor → Color?
-
The color for the button when a pointer is hovering over it.
final
- icon → JsonWidgetData
-
The icon to display inside the button.
final
- iconSize → double?
-
The size of the icon inside the button.
final
- isSelected → bool?
-
The optional selection state of the icon button.
final
- mouseCursor → MouseCursor?
-
The cursor for a mouse pointer when it enters or is hovering over the
button.
final
- onPressed → (void Function()?)
-
The callback that is called when the button is tapped or otherwise activated.
final
- padding → EdgeInsetsGeometry?
-
The padding around the button's icon. The entire padded icon will react
to input gestures.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedIcon → JsonWidgetData?
-
The icon to display inside the button when isSelected is true. This property
can be null. The original icon will be used for both selected and unselected
status if it is null.
final
- splashColor → Color?
-
The primary color of the button when the button is in the down (pressed) state.
The splash is represented as a circular overlay that appears above the
highlightColor overlay. The splash overlay has a center point that matches
the hit point of the user touch event. The splash overlay will expand to
fill the button area if the touch is held for long enough time. If the splash
color has transparency then the highlight and button color will show through.
final
- splashRadius → double?
-
The splash radius.
final
- style → ButtonStyle?
-
Customizes this button's appearance.
final
- tooltip → String?
-
Text that describes the action that will occur when the button is pressed.
final
- visualDensity → VisualDensity?
-
Defines how compact the icon button's layout will be.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Abstract function that concrete classes must implement. This must encode
the internal data model to a JSON compatible representation.
override
-
toString(
) → String -
Returns the string encoded JSON representation for this class. This will
remove all null values and empty collections from the returned string.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromDynamic(
dynamic map, {Map< String, dynamic> args = const {}, JsonWidgetRegistry? registry}) → JsonIconButtonBuilderModel -
maybeFromDynamic(
dynamic map, {Map< String, dynamic> args = const {}, JsonWidgetRegistry? registry}) → JsonIconButtonBuilderModel?