elevatedIcon method

Widget elevatedIcon({
  1. Key? key,
})

Apply styles and build as ElevatedButton

Equivalent to

ElevatedButton.icon()

Example usage:

build(context) {
  return (
    NikuButton(Text("Applied Style"))
      .px(40)
      .py(20)
      .bg(Colors.blue)
      .elevatedIcon() // Colelct all style and build
  )
}

Implementation

Widget elevatedIcon({Key? key}) => Container(
      margin: EdgeInsets.only(
        top: this._mt,
        left: this._ml,
        bottom: this._mb,
        right: this._mr,
      ),
      child: ElevatedButton.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,
        ),
      ),
    );