FloatingActionButton constructor
- Key? key,
- Widget? child,
- String? tooltip,
- Color? foregroundColor,
- Color? backgroundColor,
- Color? focusColor,
- Color? hoverColor,
- Color? splashColor,
- Object? heroTag = const _DefaultHeroTag(),
- double? elevation,
- double? focusElevation,
- double? hoverElevation,
- double? highlightElevation,
- double? disabledElevation,
- required VoidCallback? onPressed,
- MouseCursor? mouseCursor,
- bool mini = false,
- ShapeBorder? shape,
- Clip clipBehavior = Clip.none,
- FocusNode? focusNode,
- bool autofocus = false,
- MaterialTapTargetSize? materialTapTargetSize,
- bool isExtended = false,
- bool? enableFeedback,
Creates a circular floating action button.
The elevation, highlightElevation, and disabledElevation parameters, if specified, must be non-negative.
Implementation
const FloatingActionButton({
super.key,
this.child,
this.tooltip,
this.foregroundColor,
this.backgroundColor,
this.focusColor,
this.hoverColor,
this.splashColor,
this.heroTag = const _DefaultHeroTag(),
this.elevation,
this.focusElevation,
this.hoverElevation,
this.highlightElevation,
this.disabledElevation,
required this.onPressed,
this.mouseCursor,
this.mini = false,
this.shape,
this.clipBehavior = Clip.none,
this.focusNode,
this.autofocus = false,
this.materialTapTargetSize,
this.isExtended = false,
this.enableFeedback,
}) : assert(elevation == null || elevation >= 0.0),
assert(focusElevation == null || focusElevation >= 0.0),
assert(hoverElevation == null || hoverElevation >= 0.0),
assert(highlightElevation == null || highlightElevation >= 0.0),
assert(disabledElevation == null || disabledElevation >= 0.0),
_floatingActionButtonType = mini ? _FloatingActionButtonType.small : _FloatingActionButtonType.regular,
_extendedLabel = null,
extendedIconLabelSpacing = null,
extendedPadding = null,
extendedTextStyle = null;