SurveyUserTask class
A UserTask that shows a survey or cognitive test from an RPAppTask.
Created by SurveyUserTaskFactory and put on the
AppTaskController.userTaskQueue when the RPAppTask is triggered.
The app shows the widget (a SurveyPage) to the user.
Key points:
- Call onStart when the user starts the task. This resumes background sampling of the task's measures.
- On submit, adds an RPTaskResultData measurement with status SurveyStatus.submitted, pauses background sampling and marks the task done.
- On cancel, also adds the partial result (status SurveyStatus.canceled), pauses background sampling and marks the task canceled.
- Inheritance
-
- Object
- UserTask
- SurveyUserTask
Constructors
-
SurveyUserTask(AppTaskExecutor<
AppTask> executor)
Properties
-
appTaskExecutor
→ AppTaskExecutor<
AppTask> -
The
AppTaskExecutorthat created this user task.no setterinherited - availableForUser → bool
-
Is this task available to be done by the user?
no setterinherited
- backgroundTaskExecutor ↔ BackgroundTaskExecutor
-
The task executor which is used to collect the sensor measures of this user
task in the background once started.
getter/setter pairinherited
- description → String
-
no setterinherited
- doneTime ↔ DateTime?
-
The time this task was marked as done in the
onDonemethod.getter/setter pairinherited - enqueued ↔ DateTime
-
The time this task was added to the queue.
getter/setter pairinherited
- expiresIn → Duration?
-
Returns a Duration until this task expires and is removed from the queue.
The returned Duration will be negative if
thishas expired. Returnsnullif this task never expires.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasNotificationBeenCreated ↔ bool
-
Has a notification been created via a
NotificationManagerin the phone's notification system?getter/setter pairinherited - hasWidget → bool
-
Does this user task has a user interface (
Widget) to show to the user?no setteroverride - id ↔ String
-
getter/setter pairinherited
- instructions → String
-
no setterinherited
- name → String
-
no setterinherited
- notification → bool
-
Should a notification be send for this task?
no setterinherited
- result ↔ Data?
-
The result of this task, once done.
getter/setter pairinherited
- rpAppTask → RPAppTask
-
The RPAppTask from which this user task originates from.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ UserTaskState
-
The state of this task.
getter/setter pairinherited
-
stateEvents
→ Stream<
UserTaskState> -
A stream of state changes of this user task.
no setterinherited
- studyDeploymentId → String?
-
no setterinherited
- task → AppTask
-
The
AppTaskfrom which this user task originates from.no setterinherited - title → String
-
no setterinherited
- triggerTime ↔ DateTime
-
The time this task should trigger (typically becoming visible to the user).
getter/setter pairinherited
- type → String
-
no setterinherited
- widget → Widget?
-
The widget to be shown to the user as part of this task, if any.
Note that the user interface may not be available before the onStart
method has been called.
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCancel(
{bool dequeue = false}) → void -
Callback from the app if this task is canceled.
inherited
-
onDone(
{bool dequeue = false, Data? result}) → void -
Callback from the app when this task is done.
inherited
-
onExpired(
{bool dequeue = true}) → void -
Callback from the app if this task expires.
inherited
-
onNotification(
) → void -
Callback from the OS when this task is clicked by the user in the
OS notification system.
inherited
-
onStart(
) → void -
Callback from the app when this task is to be started.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited