Skip to content

UserTaskSnapshot

A serializable snapshot of a UserTask.

Saved by the PersistenceService so the AppTaskController can restore its queue after an app restart.

Inheritance
Annotations

Constructors

UserTaskSnapshot.fromJson

UserTaskSnapshot.fromJson(
  1. Map<String, dynamic> json
)

UserTaskSnapshot.fromUserTask

UserTaskSnapshot.fromUserTask(
  1. UserTask userTask
)

UserTaskSnapshot

UserTaskSnapshot(
  1. String id,
  2. AppTask task,
  3. UserTaskState state,
  4. DateTime enqueued,
  5. DateTime triggerTime,
  6. DateTime? doneTime,
  7. bool hasNotificationBeenCreated,
  8. String? studyDeploymentId,
  9. String? deviceRoleName,
)

Properties

deviceRoleName

String? deviceRoleName
getter/setter pair

doneTime

DateTime? doneTime
getter/setter pair

enqueued

DateTime enqueued
getter/setter pair

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

hasNotificationBeenCreated

bool hasNotificationBeenCreated
getter/setter pair

id

String id
getter/setter pair

state

UserTaskState state
getter/setter pair

studyDeploymentId

String? studyDeploymentId
getter/setter pair

task

AppTask task
getter/setter pair

triggerTime

DateTime triggerTime
getter/setter pair

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.