FButton.icon constructor
FButton.icon({
- required VoidCallback? onPress,
- FButtonVariant variant = .outline,
- FButtonSizeVariant size = .md,
- FButtonStyleDelta style = const .context(),
- VoidCallback? onLongPress,
- VoidCallback? onDoubleTap,
- VoidCallback? onSecondaryPress,
- VoidCallback? onSecondaryLongPress,
- bool autofocus = false,
- FocusNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - ValueChanged<
bool> ? onHoverChange, - FTappableVariantChangeCallback? onVariantChange,
- bool selected = false,
- Map<
ShortcutActivator, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - FButtonIconContentBuilder builder = defaultIconContentBuilder,
- Widget? child,
- Key? key,
Creates a FButton that contains only an icon.
child is wrapped in IconThemeData.
builder exposes the resolved FButtonStyle and icon style. When child is provided, it is passed to the
builder as its child argument. The builder defaults to defaultIconContentBuilder which returns child
unchanged. At least one of child or a custom builder must be provided.
Implementation
FButton.icon({
required this.onPress,
this.variant = .outline,
this.size = .md,
this.style = const .context(),
this.onLongPress,
this.onDoubleTap,
this.onSecondaryPress,
this.onSecondaryLongPress,
this.autofocus = false,
this.focusNode,
this.onFocusChange,
this.onHoverChange,
this.onVariantChange,
this.selected = false,
this.shortcuts,
this.actions,
FButtonIconContentBuilder builder = defaultIconContentBuilder,
Widget? child,
super.key,
}) : assert(builder != defaultIconContentBuilder || child != null, 'Either builder or a child must be provided.'),
child = IconContent(builder: builder, child: child);