RPUITask class
This class is the primary entry point for the presentation of the Research Package framework UI. It presents the steps of an RPOrderedTask (either navigable or just linear) and then provides the RPTaskResult object.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RPUITask
Constructors
- RPUITask({Key? key, required RPOrderedTask task, Image? carouselBarImage, double? carouselBarHorizontalPadding, double? carouselBarVerticalPadding, Color? carouselBarBackgroundColor, RPCarouselBarBuilder? carouselBarBuilder, String? nextButtonText, ButtonStyle? nextButtonStyle, void onSubmit(RPTaskResult)?, void onCancel(RPTaskResult? result)?})
-
const
Properties
-
Builds a replacement for the default bottom navigation of the task.
When
nullthe default row is shown — a BACK button in a navigable task and a NEXT button, configured through nextButtonText and nextButtonStyle. Those two are ignored when a builder is supplied, since the builder owns the whole row. Returnconst SizedBox.shrink()to remove the row entirely. The default row hides itself on the steps which carry their own buttons (RPCompletionStep, RPVisualConsentStep and RPConsentReviewStep); the builder is called on every step instead, with RPTaskNavigation.currentStep telling it which one is on screen.final - carouselBarBackgroundColor → Color?
-
final
- carouselBarBuilder → RPCarouselBarBuilder?
-
Builds a replacement for the default carousel bar at the top of the task.
When
nullthe default bar is shown — logo, "x of y" progress and a close button — configured through carouselBarImage, carouselBarHorizontalPadding, carouselBarVerticalPadding and carouselBarBackgroundColor. Those four are ignored when a builder is supplied, since the builder owns the whole bar. Returnconst SizedBox.shrink()to remove the bar entirely. Note that the default bar holds the only built-in way to cancel a task, so a replacement should provide its own affordance — eitherblocTask.sendStatus(RPStepStatus.Canceled)to cancel directly, or RPUITaskState.showCancelConfirmationDialog to confirm first.final - carouselBarHorizontalPadding → double?
-
final
- carouselBarImage → Image?
-
final
- carouselBarVerticalPadding → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- nextButtonStyle → ButtonStyle?
-
Style for the button that advances to the next step.
Properties set here win. Anything left null falls back to the default —
a
CarpColors.primarybackground — and then to the ambient ElevatedButtonThemeData, so overriding onlyshapekeeps the default colour. Pass abackgroundColorto change the colour too. The label is drawn white unless aforegroundColoris given here.final - nextButtonText → String?
-
Text for the button that advances to the next step.
May be a localization key or a literal — anything the localizations do
not recognise is shown as-is.
When
nullthe localized'NEXT'key is used, falling back to"NEXT". Applies to every step; a step's own RPStep.nextButtonText wins over it.final - onCancel → void Function(RPTaskResult? result)?
-
The callback function which has to return an RPTaskResult object.
This function is called when the participant cancels a survey. The result parameter is optional so if you don't want to do grab the result as part of the callback function you can do so, like the following:
final
- onSubmit → void Function(RPTaskResult)?
-
The callback function which has to return an RPTaskResult object.
This function is called when the participant has finished the last step.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- task → RPOrderedTask
-
The task to present. It can be either an RPOrderedTask or an RPNavigableOrderedTask.
The RPUITask presents its steps after each other and creates an RPTaskResult
object with the same identifier as the task's identifier.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → RPUITaskState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited