LDClick class
Names its child subtree for click tracking, so taps inside it report a stable id instead of whatever the widget tree happens to look like.
This is the Flutter equivalent of the React Native <LDClick> wrapper and the
Swift .ldClick(_:) modifier. It is a passive marker: it emits nothing on its
own and renders child unchanged, so wrapping a button cannot double-count a
tap. Automatic click capture reads the marker while resolving the tapped
widget and uses id for event.id / the replay clickSelector.
LDClick(
id: 'checkout.pay',
child: ElevatedButton(onPressed: _pay, child: const Text('Pay')),
)
Reach for this when a widget has no Key or Semantics.identifier, or when
the automatic name is too generic to group on. To name every instance of a
custom widget type at once — a design-system button, say — register a
LDClickTargetResolver instead of tagging each call site.
properties are attached to the click span for taps on this subtree, at
lower precedence than the reserved event.* fields.
Requires the widget tree to be wrapped in SessionReplayCapture, which hosts
the click detector. Without it the marker is inert.
- Inheritance
Constructors
Properties
- child → Widget
-
The subtree this marker names.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Stable identifier reported as
event.idfor taps inside child.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
properties
→ Map<
String, Object?> ? -
Additional attributes attached to the
clickspan for taps inside child.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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.
inherited
-
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