FCCFloatingButton constructor

const FCCFloatingButton({
  1. Key? key,
  2. required VoidCallback onPressed,
  3. required IconData icon,
  4. Color? backgroundColor,
  5. String? caption,
  6. bool draggable = true,
  7. Offset? initialPosition,
  8. dynamic onPositionChanged(
    1. Offset
    )?,
  9. String? tooltip,
  10. double elevation = 6.0,
  11. Color? shadowColor,
  12. ShapeBorder? shape,
  13. Color? iconColor,
  14. double? iconSize,
  15. double borderRadius = 16.0,
  16. bool savePosition = true,
  17. String? semanticLabel,
  18. String? semanticHint,
  19. String? semanticsValue,
  20. EdgeInsetsGeometry? padding,
  21. EdgeInsetsGeometry? margin,
  22. VoidCallback? onLongPress,
  23. VoidCallback? onDoubleTap,
  24. Size? minSize,
  25. Size? maxSize,
  26. bool animateMovement = true,
  27. String? heroTag,
  28. bool respectSafeArea = true,
  29. double topBlockedExtent = 120,
  30. bool snapToEdges = false,
  31. FCCSnapAxis snapAxis = FCCSnapAxis.horizontal,
  32. EdgeInsets edgeSnapPadding = const EdgeInsets.all(16),
  33. List<Rect>? anchorRegions,
  34. double anchorSnapRadius = 60,
  35. List<FCCFloatingActionItem>? actions,
  36. bool expandRadial = true,
  37. double radialRadius = 72,
  38. Duration expandAnimationDuration = const Duration(milliseconds: 200),
  39. ScrollController? scrollController,
  40. bool hideOnScrollDown = false,
  41. double hideScrollDelta = 8.0,
  42. Duration? idleTimeout,
  43. double idleOpacity = 0.5,
  44. double idleScale = 0.92,
  45. bool requireLongPressToDrag = false,
  46. FCCFloatingButtonVisualStyle visualStyle = FCCFloatingButtonVisualStyle.standard,
  47. bool enableHaptics = true,
  48. FCCHapticStrength hapticStrength = FCCHapticStrength.light,
  49. bool enableClickSound = false,
})

Implementation

const FCCFloatingButton({
  super.key,
  required this.onPressed,
  required this.icon,
  this.backgroundColor,
  this.caption,
  this.draggable = true,
  this.initialPosition,
  this.onPositionChanged,
  this.tooltip,
  this.elevation = 6.0,
  this.shadowColor,
  this.shape,
  this.iconColor,
  this.iconSize,
  this.borderRadius = 16.0,
  this.savePosition = true,
  this.semanticLabel,
  this.semanticHint,
  this.semanticsValue,
  this.padding,
  this.margin,
  this.onLongPress,
  this.onDoubleTap,
  this.minSize,
  this.maxSize,
  this.animateMovement = true,
  this.heroTag,

  // Safe area & snapping
  this.respectSafeArea = true,
  this.topBlockedExtent = 120,
  this.snapToEdges = false,
  this.snapAxis = FCCSnapAxis.horizontal,
  this.edgeSnapPadding = const EdgeInsets.all(16),

  // Anchors
  this.anchorRegions,
  this.anchorSnapRadius = 60,

  // Speed-dial
  this.actions,
  this.expandRadial = true,
  this.radialRadius = 72,
  this.expandAnimationDuration = const Duration(milliseconds: 200),

  // Scroll hide
  this.scrollController,
  this.hideOnScrollDown = false,
  this.hideScrollDelta = 8.0,

  // Idle fade-out
  this.idleTimeout,
  this.idleOpacity = 0.5,
  this.idleScale = 0.92,

  // Drag behavior
  this.requireLongPressToDrag = false,

  // Visual variants
  this.visualStyle = FCCFloatingButtonVisualStyle.standard,

  // Feedback
  this.enableHaptics = true,
  this.hapticStrength = FCCHapticStrength.light,
  this.enableClickSound = false,
});