TutorialRepository class

A repository class for managing tutorial-related data and functions.

This class stores and provides access to various components needed for tutorials, including widget keys, conditions, contexts, and tutorial containers.

Constructors

TutorialRepository(GlobalKey<NavigatorState> globalNavigatorKey, {List<Tutorial>? tutorialContainers, Map<TutorialID, GlobalKey<State<StatefulWidget>>>? keyMap, Map<TutorialID, Future<bool> Function(Duration)>? conditionMap, Map<TutorialID, BuildContext>? contextMap})
Creates a TutorialRepository with the given globalNavigatorKey and optional parameters.

Properties

The global navigator key used for navigation in the app.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addTutorialContainers(List<Tutorial> containers) → void
Adds tutorial containers dynamically even after the TutorialRepository was created
callRegistrationFunction({required Type tutorialType, required dynamic caller, State<StatefulWidget>? state}) → void
Calls the registration function for a specific tutorial type.
containsID(TutorialID? tutorialID) bool
Checks if a given TutorialID exists in any of the internal maps.
get(TutorialID tutorialID) → dynamic
Retrieves the value associated with a TutorialID from any of the internal maps.
getCondition(TutorialID conditionID) Future<bool> Function(Duration)?
Retrieves a condition function for a specific TutorialID.
getConditionMap() Map<TutorialID, bool Function()>
Returns a copy of the internal condition map.
getContext(TutorialID contextID) BuildContext?
Retrieves a BuildContext for a specific TutorialID.
getContextMap() Map<TutorialID, BuildContext>
Returns a copy of the internal context map.
getKey(TutorialID widgetID) GlobalKey<State<StatefulWidget>>?
Retrieves a GlobalKey for a specific TutorialID.
getKeyMap() Map<TutorialID, GlobalKey<State<StatefulWidget>>>
Returns a copy of the internal key map.
getTutorials() List<Tutorial>
Returns a copy of the registered tutorials
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerCondition(TutorialID conditionID, Future<bool> condition(Duration timeout)) → void
Registers a condition function for a specific TutorialID.
registerConditions(Map<TutorialID, Future<bool> Function(Duration timeout)> conditions) → void
Registers multiple condition functions at once.
registerContext(TutorialID contextID, BuildContext? buildContext) → void
Registers a BuildContext for a specific TutorialID.
registerContexts(Map<TutorialID, BuildContext> contexts) → void
Registers multiple BuildContexts at once.
registerKey(TutorialID widgetID, GlobalKey<State<StatefulWidget>>? key) → void
Registers a GlobalKey for a specific TutorialID.
registerKeys(Map<TutorialID, GlobalKey<State<StatefulWidget>>> keys) → void
Registers multiple GlobalKeys at once.
removeCondition(TutorialID conditionID) → void
Removes a condition function for a specific TutorialID.
removeContext(TutorialID contextID) → void
Removes a BuildContext for a specific TutorialID.
removeKey(TutorialID widgetID) → void
Removes a GlobalKey for a specific TutorialID.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited