registrationFunction method

void registrationFunction(
  1. TutorialRepository tutorialRepository,
  2. dynamic caller, {
  3. State<StatefulWidget>? state,
})

Registers the necessary components for the tutorial.

This method is called to set up the required keys, conditions, or contexts for the tutorial steps. By default, it throws an UnimplementedError. By using it, tutorial logic can be almost entirely defined inside of this object.

Example:

switch(caller) {
     case _MyHomePageState myHomePageState: {
        tutorialRepository.registerKey(ExampleTutorialID.floatingButtonKey, myHomePageState._floatingActionButtonKey);
        tutorialRepository.registerCondition(ExampleTutorialID.counterWasIncreased, (timeout) {
          return TutorialStepWithWaiting.conditionWithTimeout(timeout, () => myHomePageState._counter > 0);
        });
        break;
      }

Parameters: tutorialRepository: The repository to register keys, conditions, and contexts. caller: The object calling the registration function. state: Optional state object, typically a State from a StatefulWidget.

Implementation

void registrationFunction(TutorialRepository tutorialRepository, dynamic caller, {State? state}) =>
    throw UnimplementedError();