UButton constructor
const
UButton({
- String? title,
- Key? key,
- UButtonType type = UButtonType.elevated,
- UButtonSize size = UButtonSize.medium,
- VoidCallback? onTap,
- VoidCallback? onLongPress,
- Widget? child,
- Widget? icon,
- UButtonIconPosition iconPosition = UButtonIconPosition.leading,
- double iconGap = 8,
- double? iconSize,
- bool fullWidth = false,
- double? width,
- double? height,
- double? minWidth,
- double? maxWidth,
- double? minHeight,
- double? maxHeight,
- TextStyle? textStyle,
- Color? backgroundColor,
- Gradient? gradient,
- Color? foregroundColor,
- Color? disabledBackgroundColor,
- Color? disabledForegroundColor,
- double disabledOpacity = 0.45,
- double borderRadius = 8,
- double borderWidth = 1,
- Color? borderColor,
- BoxBorder? border,
- List<
BoxShadow> ? boxShadow, - OutlinedBorder? shape,
- EdgeInsetsGeometry? padding,
- double elevation = 2,
- bool splash = true,
- Color? splashColor,
- Color? highlightColor,
- double? pressedScale,
- bool isLoading = false,
- Widget? loadingWidget,
- Color? loadingColor,
- double loadingSize = 20,
- double loadingStrokeWidth = 2,
- UButtonLoadingPosition loadingPosition = UButtonLoadingPosition.replace,
- bool enabled = true,
- String? tooltip,
- String? semanticLabel,
- bool autofocus = false,
- FocusNode? focusNode,
- bool hapticFeedback = false,
- int? counter,
- String? counterDescription = "",
- dynamic counterOnCounting()?,
- bool? counterResetCounterOnTap,
- VoidCallback? onCountdownFinish,
- String? heroTag,
- EdgeInsetsGeometry? margin,
- bool visible = true,
- double? opacity,
- BoxFit? fit,
- AlignmentGeometry fitAlignment = Alignment.center,
- double? scale,
- double? rotate,
- Offset? translate,
- bool center = false,
- bool safeArea = false,
- int? expanded,
- int? flexible,
- bool positioned = false,
- double? left,
- double? top,
- double? right,
- double? bottom,
- double? positionedWidth,
- 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,
});