textButtonIcon method
Apply styles and build as TextButton
Equivalent to
TextButton.icon()
Example usage:
build(context) {
return (
NikuButton(Text("Applied Style"))
.px(40)
.py(20)
.bg(Colors.blue)
.textButtonIcon() // Colelct all style and build
)
}
Implementation
Widget textButtonIcon({Key? key}) => Container(
margin: EdgeInsets.only(
top: this._mt,
left: this._ml,
bottom: this._mb,
right: this._mr,
),
child: TextButton.icon(
icon: this.child,
label: _label ?? Text("Icon Button"),
onPressed: this._onPressed,
onLongPress: this._onLongPressed,
focusNode: this._focusNode,
autofocus: this._autofocus,
clipBehavior: this._clipBehavior,
style: ButtonStyle(
padding: MaterialStateProperty.resolveWith<EdgeInsetsGeometry>(
(_) => EdgeInsets.only(
top: this._pt,
left: this._pl,
bottom: this._pb,
right: this._pr,
),
),
backgroundColor:
_composeMaterialState<Color>(this._backgroundColor),
foregroundColor:
_composeMaterialState<Color>(this._foregroundColor),
overlayColor: _composeMaterialState<Color>(this._overlayColor),
shadowColor: _composeMaterialState<Color>(this._shadowColor),
elevation: _composeMaterialState<double>(this._elevation),
minimumSize: _composeMaterialState<Size>(this._minimumSize),
side: _composeMaterialState<BorderSide>(this._side),
shape: _composeMaterialState<OutlinedBorder>(this._shape),
mouseCursor: _composeMaterialState<MouseCursor>(this._mouseCursor),
visualDensity: this._visualDensity,
tapTargetSize: this._tapTargetSize,
animationDuration: this._animationDuration,
enableFeedback: this._enableFeedback,
alignment: this._alignment,
),
),
);