CoachStep class
A single step in a showcase coach tour.
Each step represents one highlight in the guided tour, pointing to a specific widget via a GlobalKey and displaying instructional content.
Example
CoachStep(
targetKey: myButtonKey,
title: 'Action Button',
description: [
'Tap this button to perform an action.',
'You can undo this action later.',
],
showIf: isFeatureEnabled,
)
See also:
- ShowcaseCoach for displaying the tour
- ShowcaseCoachConfig for customizing appearance
Constructors
-
CoachStep({required GlobalKey<
State< targetKey, required String title, required List<StatefulWidget> >String> description, bool shouldShow()?, bool showIf = true, VoidCallback? onNext, VoidCallback? onSkip, String? nextButtonText, String? skipButtonText, bool showSkipButton = true, Duration? autoAdvanceAfter, Widget? leading, String? imageUrl, String? imageAsset}) -
Creates a new showcase coach step.
const
Properties
- autoAdvanceAfter → Duration?
-
Optional duration after which this step will auto-advance.
final
-
description
→ List<
String> -
The description text displayed in the tooltip card.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageAsset → String?
-
Optional asset image path to display in the tooltip card.
final
- imageUrl → String?
-
Optional network image URL to display in the tooltip card.
final
- isVisible → bool
-
Checks if this step should be displayed based on its conditions.
no setter
- leading → Widget?
-
Optional leading widget (icon or image) to display in the tooltip card.
final
- nextButtonText → String?
-
Custom text for the "Next" button.
final
- onNext → VoidCallback?
-
Custom action to execute when "Next" button is pressed.
final
- onSkip → VoidCallback?
-
Custom action to execute when "Skip" button is pressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldShow → bool Function()?
-
Optional callback to determine if this step should be shown.
final
- showIf → bool
-
Simple boolean flag to control if this step should be shown.
final
- showSkipButton → bool
-
Whether to show the skip button for this step.
final
- skipButtonText → String?
-
Custom text for the "Skip" button.
final
-
targetKey
→ GlobalKey<
State< StatefulWidget> > -
The GlobalKey attached to the widget to highlight.
final
- title → String
-
The title displayed in the tooltip card.
final
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