SpotlightTarget class
Represents a widget to be highlighted by the spotlight effect.
The spotlight creates a transparent hole around the target widget, allowing it to stand out against a dimmed background.
Constructors
-
SpotlightTarget.fromKey(GlobalKey<
State< key, {EdgeInsets padding = const EdgeInsets.all(8), double borderRadius = 16, BorderRadius? customBorderRadius, Path? customPath, double? maxHeight, double? customWidth, bool allowTouchThrough = true})StatefulWidget> > -
Creates a spotlight target from a GlobalKey.
const
Properties
- allowTouchThrough → bool
-
When false, touches inside this target hole will be absorbed by the overlay.
final
- borderRadius → double
-
Border radius for the spotlight hole (ignored if customBorderRadius is set).
final
- customBorderRadius → BorderRadius?
-
Custom border radius for more control (overrides borderRadius).
final
- customPath → Path?
-
Custom path shape for the spotlight hole.
final
- customWidth → double?
-
Custom width for the spotlight hole.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
key
→ GlobalKey<
State< StatefulWidget> > -
The key of the widget to highlight.
final
- maxHeight → double?
-
Maximum height constraint for the spotlight hole.
final
- padding → EdgeInsets
-
Padding around the target widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited