GuideController class
A comprehensive onboarding system for Flutter applications that guides users through new features using overlays and tooltips.
This system allows you to highlight specific widgets in your existing UI and provide contextual information about features without requiring major code changes.
Example usage:
final controller = GuideController();
final steps = [
GuideStep(
targetKey: _buttonKey,
title: 'New Feature',
description: 'This button has new functionality.',
),
];
controller.startGuide(steps);
Controls the onboarding flow, managing steps, navigation, and overlay display.
The controller handles the state of the onboarding process and provides methods to navigate between steps, skip the onboarding, or finish it.
Usage:
final controller = GuideController();
controller.addListener(() {
// React to onboarding state changes
if (!controller.isActive) {
print('Guide completed');
}
});
- Inheritance
-
- Object
- ChangeNotifier
- GuideController
Constructors
Properties
- currentStep → int
-
Returns the current step index (0-based).
no setter
- currentStepData → GuideStep?
-
Returns the current step data, or null if no steps are available.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isActive → bool
-
Returns true if onboarding is currently active and displaying.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
steps
↔ List<
GuideStep> -
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
finishGuide(
) → void - Completes the onboarding process normally.
-
nextStep(
) → void - Advances to the next onboarding step.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
previousStep(
) → void - Goes back to the previous onboarding step.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
skipGuide(
) → void - Immediately skips the entire onboarding process.
-
startGuide(
List< GuideStep> steps) → void - Starts the onboarding process with the provided steps.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited