iconTextButton static method

Widget iconTextButton({
  1. required String icon,
  2. required String text,
  3. double iconSize = iconSize,
  4. Color textColor = Colors.black,
  5. double fontSize = buttonFontSize,
  6. double? width,
  7. double? height,
  8. double? size,
  9. double space = 0.0,
  10. TextOverflow? overflow,
  11. Axis directory = Axis.horizontal,
  12. VoidCallback? onPressed,
  13. bool isInfinity = false,
  14. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
})

Implementation

static Widget iconTextButton(
    {required String icon,
    required String text,
    double iconSize = iconSize,
    Color textColor = Colors.black,
    double fontSize = buttonFontSize,
    double? width,
    double? height,
    double? size,
    double space = 0.0,
    TextOverflow? overflow,
    Axis directory = Axis.horizontal,
    VoidCallback? onPressed,
    bool isInfinity = false,
    EdgeInsetsGeometry padding = const EdgeInsets.all(8.0)}) {
  return TextButton(
    onPressed: onPressed,
    style: ButtonStyle(
        overlayColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
        elevation: ButtonStyleButton.allOrNull<double>(0),
        padding: ButtonStyleButton.allOrNull<EdgeInsetsGeometry>(padding),
        maximumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? double.infinity, size ?? height ?? double.infinity)),
        minimumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? 0, size ?? height ?? 0))),
    child: _TextButtonWithIconChild(
        isInfinity: isInfinity,
        label: Text(
          text,
          overflow: overflow,
          style: TextStyle(color: textColor, fontSize: fontSize),
        ),
        icon: ImageView.assetImage(
          icon,
          width: iconSize,
          height: iconSize,
        ),
        directory: directory,
        space: space),
  );
}