FTappable class
An area that responds to touch.
It is typically used to create other high-level widgets, i.e., FButton. Unless you are creating a custom widget, you should use those high-level widgets instead.
Why do tappables inside OverlayPortals sometimes not respond to taps?
Wrap the overlay content in FTappableGroup.isolate.
This is probably caused by the OverlayPortal being wrapped in an FTappableGroup. Since an OverlayPortal reparents inherited widgets, the FTappables are registered with the ancestor FTappableGroup which does not hit test across rendering layers.
FPortal-based widgets handle this automatically.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FTappable
Constructors
-
FTappable({FTappableStyleDelta style, FFocusedOutlineStyleDelta? focusedOutlineStyle, String? semanticsLabel, bool excludeSemantics, bool autofocus, FocusNode? focusNode, ValueChanged<
bool> ? onFocusChange, ValueChanged<bool> ? onHoverChange, FTappableVariantChangeCallback? onVariantChange, bool selected, HitTestBehavior behavior, VoidCallback? onPress, VoidCallback? onLongPress, VoidCallback? onDoubleTap, VoidCallback? onSecondaryPress, VoidCallback? onSecondaryLongPress, Map<ShortcutActivator, Intent> ? shortcuts, Map<Type, Action< ? actions, ValueWidgetBuilder<Intent> >Set< builder, Widget? child, Key? key})FTappableVariant> > -
Creates an FTappable.
constfactory
-
FTappable.static({FTappableStyleDelta style = const .context(), FFocusedOutlineStyleDelta? focusedOutlineStyle, String? semanticsLabel, bool excludeSemantics = false, bool autofocus = false, FocusNode? focusNode, ValueChanged<
bool> ? onFocusChange, ValueChanged<bool> ? onHoverChange, FTappableVariantChangeCallback? onVariantChange, bool selected = false, HitTestBehavior behavior = .translucent, VoidCallback? onPress, VoidCallback? onLongPress, VoidCallback? onDoubleTap, VoidCallback? onSecondaryPress, VoidCallback? onSecondaryLongPress, Map<Type, Action< ? actions, ValueWidgetBuilder<Intent> >Set< builder = defaultBuilder, Widget? child, Map<FTappableVariant> >ShortcutActivator, Intent> ? shortcuts, Key? key}) -
Creates a FTappable without animation.
const
Properties
-
actions
→ Map<
Type, Action< ?Intent> > -
The actions. Defaults to calling onPress when ActivateIntent is invoked and onPress is not null.
final
- autofocus → bool
-
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
- behavior → HitTestBehavior
-
The tappable's hit test behavior. Defaults to HitTestBehavior.translucent.
final
-
builder
→ ValueWidgetBuilder<
Set< FTappableVariant> > -
The builder used to create a child with the current variants.
final
- child → Widget?
-
An optional child.
final
- excludeSemantics → bool
-
Whether to replace all child semantics with this node. Defaults to false.
final
- focusedOutlineStyle → FFocusedOutlineStyleDelta?
-
The style used when the tappable is focused. This tappable will not be outlined if null.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDoubleTap → VoidCallback?
-
A callback for when the widget is double tapped.
final
-
onFocusChange
→ ValueChanged<
bool> ? -
Handler called when the focus changes.
final
-
onHoverChange
→ ValueChanged<
bool> ? -
Handler called when the hover changes.
final
- onLongPress → VoidCallback?
-
A callback for when the widget is long pressed.
final
- onPress → VoidCallback?
-
A callback for when the widget is pressed.
final
- onSecondaryLongPress → VoidCallback?
-
A callback for when the widget is pressed with a secondary button (usually right-click on desktop).
final
- onSecondaryPress → VoidCallback?
-
A callback for when the widget is pressed with a secondary button (usually right-click on desktop).
final
- onVariantChange → FTappableVariantChangeCallback?
-
Handler called when there are any changes to a tappable's FTappableVariants.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool
-
True if this tappable is currently selected. Defaults to false.
final
- semanticsLabel → String?
-
The semantic label used by accessibility frameworks.
final
-
shortcuts
→ Map<
ShortcutActivator, Intent> -
The shortcuts. Defaults to calling ActivateIntent if onPress is not null.
final
- style → FTappableStyleDelta
-
The style.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FTappable> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultBuilder(
BuildContext _, Set< FTappableVariant> _, Widget? child) → Widget - The default builder that returns the child as-is.