FCCElevatedButton constructor

const FCCElevatedButton({
  1. Key? key,
  2. Widget? child,
  3. String? text,
  4. FCCButtonVariant variant = FCCButtonVariant.filled,
  5. double? fontSize,
  6. FontWeight? fontWeight,
  7. String? fontFamily,
  8. Color? textColor,
  9. TextStyle? textStyle,
  10. TextAlign textAlign = TextAlign.center,
  11. Widget? prefix,
  12. Widget? suffix,
  13. VoidCallback? onPressed,
  14. Future<void> onPressedAsync()?,
  15. VoidCallback? onLongPress,
  16. bool isEnabled = true,
  17. bool isLoading = false,
  18. bool use3DEffect = true,
  19. bool forceSolidGradient = false,
  20. bool enableTapEffect = true,
  21. bool isPill = false,
  22. bool rippleOnly = false,
  23. bool shimmerOnHover = false,
  24. Duration animationDuration = const Duration(milliseconds: 100),
  25. double borderRadius = 12.0,
  26. double elevation = 10.0,
  27. double? height,
  28. double? width,
  29. FCCButtonSize size = FCCButtonSize.medium,
  30. bool iconOnly = false,
  31. Gradient? gradient,
  32. List<BoxShadow>? boxShadow,
  33. Color? backgroundColor,
  34. Color? borderColor,
  35. Color? disabledColor,
  36. Color? loadingColor,
  37. String? loadingText,
  38. TextStyle? loadingTextStyle,
  39. bool showAsyncLoadingOverlay = true,
  40. Duration asyncSuccessDuration = const Duration(milliseconds: 700),
  41. Duration asyncErrorDuration = const Duration(milliseconds: 900),
  42. Widget? disabledChild,
  43. FCCHapticFeedbackMode hapticMode = FCCHapticFeedbackMode.medium,
  44. bool enableClickSound = false,
  45. bool enableHoldToConfirm = false,
  46. Duration holdDuration = const Duration(milliseconds: 800),
  47. VoidCallback? onHoldComplete,
  48. String? tooltip,
  49. String? semanticLabel,
  50. 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');