UButton constructor

const UButton({
  1. String? title,
  2. Key? key,
  3. UButtonType type = UButtonType.elevated,
  4. UButtonSize size = UButtonSize.medium,
  5. VoidCallback? onTap,
  6. VoidCallback? onLongPress,
  7. Widget? child,
  8. Widget? icon,
  9. UButtonIconPosition iconPosition = UButtonIconPosition.leading,
  10. double iconGap = 8,
  11. double? iconSize,
  12. bool fullWidth = false,
  13. double? width,
  14. double? height,
  15. double? minWidth,
  16. double? maxWidth,
  17. double? minHeight,
  18. double? maxHeight,
  19. TextStyle? textStyle,
  20. Color? backgroundColor,
  21. Gradient? gradient,
  22. Color? foregroundColor,
  23. Color? disabledBackgroundColor,
  24. Color? disabledForegroundColor,
  25. double disabledOpacity = 0.45,
  26. double borderRadius = 8,
  27. double borderWidth = 1,
  28. Color? borderColor,
  29. BoxBorder? border,
  30. List<BoxShadow>? boxShadow,
  31. OutlinedBorder? shape,
  32. EdgeInsetsGeometry? padding,
  33. double elevation = 2,
  34. bool splash = true,
  35. Color? splashColor,
  36. Color? highlightColor,
  37. double? pressedScale,
  38. bool isLoading = false,
  39. Widget? loadingWidget,
  40. Color? loadingColor,
  41. double loadingSize = 20,
  42. double loadingStrokeWidth = 2,
  43. UButtonLoadingPosition loadingPosition = UButtonLoadingPosition.replace,
  44. bool enabled = true,
  45. String? tooltip,
  46. String? semanticLabel,
  47. bool autofocus = false,
  48. FocusNode? focusNode,
  49. bool hapticFeedback = false,
  50. int? counter,
  51. String? counterDescription = "",
  52. dynamic counterOnCounting(
    1. int
    )?,
  53. bool? counterResetCounterOnTap,
  54. VoidCallback? onCountdownFinish,
  55. String? heroTag,
  56. EdgeInsetsGeometry? margin,
  57. bool visible = true,
  58. double? opacity,
  59. BoxFit? fit,
  60. AlignmentGeometry fitAlignment = Alignment.center,
  61. double? scale,
  62. double? rotate,
  63. Offset? translate,
  64. bool center = false,
  65. bool safeArea = false,
  66. int? expanded,
  67. int? flexible,
  68. bool positioned = false,
  69. double? left,
  70. double? top,
  71. double? right,
  72. double? bottom,
  73. double? positionedWidth,
  74. double? positionedHeight,
})

Implementation

const UButton({
  this.title,
  super.key,
  this.type = UButtonType.elevated,
  this.size = UButtonSize.medium,
  this.onTap,
  this.onLongPress,
  this.child,
  this.icon,
  this.iconPosition = UButtonIconPosition.leading,
  this.iconGap = 8,
  this.iconSize,
  this.fullWidth = false,
  this.width,
  this.height,
  this.minWidth,
  this.maxWidth,
  this.minHeight,
  this.maxHeight,
  this.textStyle,
  this.backgroundColor,
  this.gradient,
  this.foregroundColor,
  this.disabledBackgroundColor,
  this.disabledForegroundColor,
  this.disabledOpacity = 0.45,
  this.borderRadius = 8,
  this.borderWidth = 1,
  this.borderColor,
  this.border,
  this.boxShadow,
  this.shape,
  this.padding,
  this.elevation = 2,
  this.splash = true,
  this.splashColor,
  this.highlightColor,
  this.pressedScale,
  this.isLoading = false,
  this.loadingWidget,
  this.loadingColor,
  this.loadingSize = 20,
  this.loadingStrokeWidth = 2,
  this.loadingPosition = UButtonLoadingPosition.replace,
  this.enabled = true,
  this.tooltip,
  this.semanticLabel,
  this.autofocus = false,
  this.focusNode,
  this.hapticFeedback = false,
  this.counter,
  this.counterDescription = "",
  this.counterOnCounting,
  this.counterResetCounterOnTap,
  this.onCountdownFinish,
  this.heroTag,
  this.margin,
  this.visible = true,
  this.opacity,
  this.fit,
  this.fitAlignment = Alignment.center,
  this.scale,
  this.rotate,
  this.translate,
  this.center = false,
  this.safeArea = false,
  this.expanded,
  this.flexible,
  this.positioned = false,
  this.left,
  this.top,
  this.right,
  this.bottom,
  this.positionedWidth,
  this.positionedHeight,
});