Skip to content

RPTaskNavigation

The navigation of an RPUITask, handed to an RPBottomNavigationBuilder. It exposes what the default bottom bar does — advance, go back, cancel — together with the state those actions depend on, so that a custom bar can be built without reaching into the task's internals.

Constructors

RPTaskNavigation

const RPTaskNavigation({
  1. required VoidCallback? onNext,
  2. required VoidCallback? onBack,
  3. required VoidCallback onCancel,
  4. required bool canProceed,
  5. required RPStep? currentStep,
  6. required int stepIndex,
  7. required int stepCount,
})

Properties

canProceed

bool canProceed
final

Whether the current step is ready to be left, i.e. whether onNext is non-null.

currentStep

RPStep? currentStep
final

The step currently on screen. The default bar draws nothing on an RPCompletionStep, RPVisualConsentStep or RPConsentReviewStep, since those steps carry their own buttons. A custom bar is built on every step instead, and can use this to make the same choice.

onBack

VoidCallback? onBack
final

Returns to the previous step, or null on the first step of the task, where there is nothing to go back to. Note that the default bar is stricter than this: it only offers BACK in an RPNavigableOrderedTask. A custom bar may offer it in a linear task too.

onCancel

VoidCallback onCancel
final

Cancels the task, after asking the participant to confirm in a dialog. This is what the close button of the default carousel bar does. To end the task without confirmation, call RPUITask.onCancel directly and pop the route.

onNext

VoidCallback? onNext
final

Advances to the next step, or null while the current step is not ready to be left — an unanswered question, typically. Passing it straight to a button's onPressed therefore disables the button until the step is answered.

stepCount

int stepCount
final

The number of steps in the task — for an RPNavigableOrderedTask not every step is necessarily shown, so it is an upper bound rather than an exact total.

stepIndex

int stepIndex
final

The zero-based index of currentStep.