MIconButton class

Inheritance

Constructors

MIconButton({Key? key, double? iconSize, VisualDensity? visualDensity, EdgeInsetsGeometry? padding, AlignmentGeometry? alignment, double? splashRadius, Color? color, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, Color? disabledColor, VoidCallback? onPressed, MouseCursor? mouseCursor, FocusNode? focusNode, bool autofocus = false, String? tooltip, bool? enableFeedback, BoxConstraints? constraints, ButtonStyle? style, bool? isSelected, Widget? selectedIcon, required Widget icon, Color? backgroundColor, bool clearPadding = false, double? elevation, double? size, Size? maximumSize, Size? minimumSize, bool noHighlight = false, bool noSplash = false, Color? overlayColor, Color? shadowColor, OutlinedBorder? shape, BorderSide? side, InteractiveInkFeatureFactory? splashFactory, MaterialTapTargetSize? tapTargetSize})
const
MIconButton.filled({Key? key, double? iconSize, VisualDensity? visualDensity, EdgeInsetsGeometry? padding, AlignmentGeometry? alignment, double? splashRadius, Color? color, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, Color? disabledColor, VoidCallback? onPressed, MouseCursor? mouseCursor, FocusNode? focusNode, bool autofocus = false, String? tooltip, bool? enableFeedback, BoxConstraints? constraints, ButtonStyle? style, bool? isSelected, Widget? selectedIcon, required Widget icon, Color? backgroundColor, bool clearPadding = false, double? elevation, double? size, Size? maximumSize, Size? minimumSize, bool noHighlight = false, bool noSplash = false, Color? overlayColor, Color? shadowColor, OutlinedBorder? shape, BorderSide? side, InteractiveInkFeatureFactory? splashFactory, MaterialTapTargetSize? tapTargetSize})
const
MIconButton.filledTonal({Key? key, double? iconSize, VisualDensity? visualDensity, EdgeInsetsGeometry? padding, AlignmentGeometry? alignment, double? splashRadius, Color? color, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, Color? disabledColor, VoidCallback? onPressed, MouseCursor? mouseCursor, FocusNode? focusNode, bool autofocus = false, String? tooltip, bool? enableFeedback, BoxConstraints? constraints, ButtonStyle? style, bool? isSelected, Widget? selectedIcon, required Widget icon, Color? backgroundColor, bool clearPadding = false, double? elevation, double? size, Size? maximumSize, Size? minimumSize, bool noHighlight = false, bool noSplash = false, Color? overlayColor, Color? shadowColor, OutlinedBorder? shape, BorderSide? side, InteractiveInkFeatureFactory? splashFactory, MaterialTapTargetSize? tapTargetSize})
const
MIconButton.outlined({Key? key, double? iconSize, VisualDensity? visualDensity, EdgeInsetsGeometry? padding, AlignmentGeometry? alignment, double? splashRadius, Color? color, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, Color? disabledColor, VoidCallback? onPressed, MouseCursor? mouseCursor, FocusNode? focusNode, bool autofocus = false, String? tooltip, bool? enableFeedback, BoxConstraints? constraints, ButtonStyle? style, bool? isSelected, Widget? selectedIcon, required Widget icon, Color? backgroundColor, bool clearPadding = false, double? elevation, double? size, Size? maximumSize, Size? minimumSize, bool noHighlight = false, bool noSplash = false, Color? overlayColor, Color? shadowColor, OutlinedBorder? shape, BorderSide? side, InteractiveInkFeatureFactory? splashFactory, MaterialTapTargetSize? tapTargetSize})
const

Properties

alignment AlignmentGeometry?
final
autofocus bool
final
backgroundColor Color?
背景颜色, 只在 Material 3 生效
final
clearPadding bool
是否去除边距
final
color Color?
即 foregroundColor
final
constraints BoxConstraints?
final
disabledColor Color?
final
elevation double?
final
enableFeedback bool?
final
focusColor Color?
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
highlightColor Color?
final
hoverColor Color?
final
icon Widget
final
iconSize double?
final
isSelected bool?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maximumSize Size?
最大尺寸 !!!: 注意 Material 3minimumSize 默认为 40x40. !!!: 如果设置了 maximumSize 不设置 minimumSize, 并且 maximumSize 小于 minimumSize, 则会导致约束冲突. BoxConstraints has both width and height constraints non-normalized.
final
minimumSize Size?
最小尺寸
final
mouseCursor MouseCursor?
final
noHighlight bool
只去除默认的高亮颜色, 如果设置了 highlightColoroverlayColornoHighlight 无效
final
noSplash bool
只去除默认的飞溅效果, 如果设置了 splashColorsplashFactorynoSplash 无效
final
onPressed VoidCallback?
final
overlayColor Color?
如果设置了 overlayColornoHighlight 无效
final
padding EdgeInsetsGeometry?
如果设置了 paddingclearPadding 无效
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedIcon Widget?
final
shadowColor Color?
只在 Material 3 生效
final
shape OutlinedBorder?
只在 Material 3 生效
final
side BorderSide?
只在 Material 3 生效
final
size double?
限制大小
final
splashColor Color?
final
splashFactory InteractiveInkFeatureFactory?
如果设置了 splashFactorynoSplash 无效
final
splashRadius double?
只在 Material 2 生效
final
style ButtonStyle?
final
tapTargetSize MaterialTapTargetSize?
只在 Material 3 生效
final
tooltip String?
final
visualDensity VisualDensity?
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.
override
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

Static Methods

styleFrom({Color? foregroundColor, Color? backgroundColor, Color? disabledForegroundColor, Color? disabledBackgroundColor, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? shadowColor, Color? surfaceTintColor, double? elevation, Size? minimumSize, Size? fixedSize, Size? maximumSize, double? iconSize, BorderSide? side, OutlinedBorder? shape, EdgeInsetsGeometry? padding, MouseCursor? enabledMouseCursor, MouseCursor? disabledMouseCursor, VisualDensity? visualDensity, MaterialTapTargetSize? tapTargetSize, Duration? animationDuration, bool? enableFeedback, AlignmentGeometry? alignment, InteractiveInkFeatureFactory? splashFactory, Color? overlayColor}) ButtonStyle