MyIconButton constructor
const
MyIconButton({
- Key? key,
- double iconSize = 24.0,
- VisualDensity? visualDensity,
- EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
- AlignmentGeometry alignment = Alignment.center,
- required Widget icon,
- required Widget text,
- PositionButton positionButton = PositionButton.top,
- Color? color,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- Color? disabledColor,
- required VoidCallback? onPressed,
- FocusNode? focusNode,
- bool autofocus = false,
- String? tooltip,
- bool enableFeedback = true,
- BoxConstraints? constraints,
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.
The iconSize, padding, autofocus, and alignment arguments must not
be null (though they each have default values).
The icon argument must be specified, and is typically either an Icon
or an ImageIcon.
Implementation
const MyIconButton({
super.key,
this.iconSize = 24.0,
this.visualDensity,
this.padding = const EdgeInsets.all(8.0),
this.alignment = Alignment.center,
required this.icon,
required this.text,
this.positionButton = PositionButton.top,
this.color,
this.focusColor,
this.hoverColor,
this.highlightColor,
this.splashColor,
this.disabledColor,
required this.onPressed,
this.focusNode,
this.autofocus = false,
this.tooltip,
this.enableFeedback = true,
this.constraints,
});