UiButton.text constructor

UiButton.text({
  1. Key? key,
  2. String? label,
  3. Widget? icon,
  4. required VoidCallback? onPressed,
  5. Color? foregroundColor,
  6. EdgeInsetsGeometry? padding,
  7. TextStyle? labelStyle,
  8. bool expand = false,
  9. String? tooltip,
})

Implementation

factory UiButton.text({
  Key? key,
  String? label,
  Widget? icon,
  required VoidCallback? onPressed,
  Color? foregroundColor,
  EdgeInsetsGeometry? padding,
  TextStyle? labelStyle,
  bool expand = false,
  String? tooltip,
}) {
  return UiButton._internal(
    key: key,
    label: label,
    icon: icon,
    onPressed: onPressed,
    expand: expand,
    tooltip: tooltip,
    type: _UiButtonType.text,
    style: TextButton.styleFrom(
      backgroundColor: Colors.transparent,
      foregroundColor: foregroundColor ?? primary,
      padding:
          padding ?? const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
      textStyle: labelStyle ??
          const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
      tapTargetSize: MaterialTapTargetSize.shrinkWrap,
    ),
  );
}