PrismOverlayStack class
A guided onboarding tour that dims the screen and spotlights widgets.
Pass one GlobalKey per step, in order. Each step dims everything except the anchored widget's bounds and shows a tooltip card next to it — above on compact windows, beside on wide ones. Users advance by tapping the card's button or anywhere on the dimmed area; a skip button is always available.
final key = GlobalKey();
// …attach key to the widget you spotlight…
PrismOverlayStack(
steps: [
PrismOverlayStep(
anchorKey: key,
title: 'Search everything',
message: 'Press ⌘K or tap here to search.',
),
],
onDone: markOnboardingSeen,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PrismOverlayStack
Constructors
-
PrismOverlayStack({Key? key, required List<
PrismOverlayStep> steps, required VoidCallback onDone, VoidCallback? onSkip, String skipLabel = 'Skip tour', double darkening = 0.6}) -
Creates a spotlight tour. Steps are shown in order; an empty list
renders nothing.
const
Properties
- darkening → double
-
How dark the dimming layer is, 0..1.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDone → VoidCallback
-
Called after the last step is completed.
final
- onSkip → VoidCallback?
-
Called when the user skips the tour.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipLabel → String
-
Label for the skip button.
final
-
steps
→ List<
PrismOverlayStep> -
Steps of the tour, in visiting order.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PrismOverlayStack> -
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.
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