FCCElevatedButton constructor
const
FCCElevatedButton({
- Key? key,
- Widget? child,
- String? text,
- FCCButtonVariant variant = FCCButtonVariant.filled,
- double? fontSize,
- FontWeight? fontWeight,
- String? fontFamily,
- Color? textColor,
- TextStyle? textStyle,
- TextAlign textAlign = TextAlign.center,
- Widget? prefix,
- Widget? suffix,
- VoidCallback? onPressed,
- Future<
void> onPressedAsync()?, - VoidCallback? onLongPress,
- bool isEnabled = true,
- bool isLoading = false,
- bool use3DEffect = true,
- bool forceSolidGradient = false,
- bool enableTapEffect = true,
- bool isPill = false,
- bool rippleOnly = false,
- bool shimmerOnHover = false,
- Duration animationDuration = const Duration(milliseconds: 100),
- double borderRadius = 12.0,
- double elevation = 10.0,
- double? height,
- double? width,
- FCCButtonSize size = FCCButtonSize.medium,
- bool iconOnly = false,
- Gradient? gradient,
- List<
BoxShadow> ? boxShadow, - Color? backgroundColor,
- Color? borderColor,
- Color? disabledColor,
- Color? loadingColor,
- String? loadingText,
- TextStyle? loadingTextStyle,
- bool showAsyncLoadingOverlay = true,
- Duration asyncSuccessDuration = const Duration(milliseconds: 700),
- Duration asyncErrorDuration = const Duration(milliseconds: 900),
- Widget? disabledChild,
- FCCHapticFeedbackMode hapticMode = FCCHapticFeedbackMode.medium,
- bool enableClickSound = false,
- bool enableHoldToConfirm = false,
- Duration holdDuration = const Duration(milliseconds: 800),
- VoidCallback? onHoldComplete,
- String? tooltip,
- String? semanticLabel,
- bool excludeSemantics = false,
Implementation
const FCCElevatedButton({
super.key,
this.child,
this.text,
this.variant = FCCButtonVariant.filled,
// Typography
this.fontSize,
this.fontWeight,
this.fontFamily,
this.textColor,
this.textStyle,
this.textAlign = TextAlign.center,
// Slots
this.prefix,
this.suffix,
// Actions
this.onPressed,
this.onPressedAsync,
this.onLongPress,
// Basic flags
this.isEnabled = true,
this.isLoading = false,
// Visual behavior
this.use3DEffect = true,
this.forceSolidGradient = false,
this.enableTapEffect = true,
this.isPill = false,
this.rippleOnly = false,
this.shimmerOnHover = false,
this.animationDuration = const Duration(milliseconds: 100),
// Sizing
this.borderRadius = 12.0,
this.elevation = 10.0,
this.height,
this.width,
this.size = FCCButtonSize.medium,
this.iconOnly = false,
// Decoration
this.gradient,
this.boxShadow,
this.backgroundColor,
this.borderColor,
this.disabledColor,
this.loadingColor,
// Async / loading UX
this.loadingText,
this.loadingTextStyle,
this.showAsyncLoadingOverlay = true,
this.asyncSuccessDuration = const Duration(milliseconds: 700),
this.asyncErrorDuration = const Duration(milliseconds: 900),
// Disabled / custom state
this.disabledChild,
// Haptics + sound
this.hapticMode = FCCHapticFeedbackMode.medium,
this.enableClickSound = false,
// Press-and-hold
this.enableHoldToConfirm = false,
this.holdDuration = const Duration(milliseconds: 800),
this.onHoldComplete,
// UX metadata
this.tooltip,
this.semanticLabel,
this.excludeSemantics = false,
}) : assert(child != null || text != null,
'Either child or text must be provided');