HintRegistry class Hints
Keeps at most one exclusive hint open across the whole app.
Two tooltips open at once is nearly always a bug — a stray hover leaves one
behind, then a long press opens a second on top of it. Hints opt in via
Hint.exclusive, which defaults to true.
Non-exclusive hints are never registered, so a persistent hint that is meant to stay open (a validation message pinned to a field) is not closed by an unrelated tooltip.
This is process-global on purpose: an InheritedWidget would scope it to a subtree, and the overlay it is protecting is not scoped that way.
Properties
- current → DismissibleHint?
-
The hint currently holding the floor, if any.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage ↔ TourStorage
-
Where Hint.showOnce keys are remembered.
getter/setter pair
Methods
-
addObserver(
HintObserver observer) → void -
Starts reporting hint and tour lifecycle events to
observer. -
close(
DismissibleHint hint) → void -
Releases the floor if
hintis holding it. -
closeAll(
) → void - Closes whatever is open. Used by tour startup and by tests.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyDismissed(
HintEvent event) → void -
Reports that a hint closed. Called by
Hint, not by app code. -
notifyShown(
HintEvent event) → void -
Reports that a hint opened. Called by
Hint, not by app code. -
notifyTourEnded(
String tour, TourEndReason reason) → void -
Reports that a tour ended. Called by
TourController. -
notifyTourStarted(
String tour) → void -
Reports that a tour started. Called by
TourController. -
notifyTourStep(
String tour, int index) → void -
Reports that a tour reached a step. Called by
TourController. -
open(
DismissibleHint hint) → void -
Registers
hintas the open one, closing whichever hint held the floor. -
removeAllObservers(
) → void - Drops every observer.
-
removeObserver(
HintObserver observer) → void -
Stops reporting to
observer. Unknown observers are ignored. -
resetShowOnce(
String key) → Future< void> - Forgets the "already shown" flag for a Hint.showOnce key, so that hint appears again.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → HintRegistry
-
The single registry instance.
final