FCCFloatingButton constructor
const
FCCFloatingButton({
- Key? key,
- required VoidCallback onPressed,
- required IconData icon,
- Color? backgroundColor,
- String? caption,
- bool draggable = true,
- Offset? initialPosition,
- dynamic onPositionChanged()?,
- String? tooltip,
- double elevation = 6.0,
- Color? shadowColor,
- ShapeBorder? shape,
- Color? iconColor,
- double? iconSize,
- double borderRadius = 16.0,
- bool savePosition = true,
- String? semanticLabel,
- String? semanticHint,
- String? semanticsValue,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- VoidCallback? onLongPress,
- VoidCallback? onDoubleTap,
- Size? minSize,
- Size? maxSize,
- bool animateMovement = true,
- String? heroTag,
- bool respectSafeArea = true,
- double topBlockedExtent = 120,
- bool snapToEdges = false,
- FCCSnapAxis snapAxis = FCCSnapAxis.horizontal,
- EdgeInsets edgeSnapPadding = const EdgeInsets.all(16),
- List<
Rect> ? anchorRegions, - double anchorSnapRadius = 60,
- List<
FCCFloatingActionItem> ? actions, - bool expandRadial = true,
- double radialRadius = 72,
- Duration expandAnimationDuration = const Duration(milliseconds: 200),
- ScrollController? scrollController,
- bool hideOnScrollDown = false,
- double hideScrollDelta = 8.0,
- Duration? idleTimeout,
- double idleOpacity = 0.5,
- double idleScale = 0.92,
- bool requireLongPressToDrag = false,
- FCCFloatingButtonVisualStyle visualStyle = FCCFloatingButtonVisualStyle.standard,
- bool enableHaptics = true,
- FCCHapticStrength hapticStrength = FCCHapticStrength.light,
- 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,
});