AppTask class
A task that notifies the app when it is triggered.
See AppTaskExecutor on how this work on runtime.
- Inheritance
-
- Object
- Serializable
- TaskConfiguration
- AppTask
- Annotations
-
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
Constructors
-
AppTask({String? name, List<
Measure> ? measures, required String type, String title = '', String? description = '', String instructions = '', int? minutesToComplete, Duration? expire, bool notification = false}) - Create an app task that notifies the app when it is triggered.
-
AppTask.fromJson(Map<
String, dynamic> json) -
factory
Properties
- $type ↔ String?
-
The runtime class name (type) of this object.
Used for deserialization from JSON objects.
getter/setter pairinherited
- backgroundTask → BackgroundTask
-
The list of background
measuresas aBackgroundTask.no setter - description ↔ String
-
A short description (one line) of this task. Can be used in the app.
getter/setter pairinherited-setteroverride-getter
- expire ↔ Duration?
-
The duration of this app task, i.e. when it expire and is removed
from the AppTaskController's queue.
If
nullthe task never expire.getter/setter pair - fromJsonFunction → Function
-
The function which can convert a JSON string to an object of this type.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- instructions ↔ String
-
A longer instruction text explaining how a user should perform this task.
getter/setter pair
- jsonType → String
-
Return the
__typeto be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.no setterinherited -
measures
↔ List<
Measure> ? -
The data which needs to be collected/measured passively as part of this task.
getter/setter pairinherited
- minutesToComplete ↔ int?
-
How many minutes will it take for the user to perform this task?
Typically shown to the user before engaging into this task.
If
nullthe task has no completion time.getter/setter pair - name ↔ String
-
A name which uniquely identifies the task.
getter/setter pairinherited
- notification ↔ bool
-
Should a notification be send to the user on the phone?
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title ↔ String
-
A title for this task. Can be used in the app.
getter/setter pair
- type ↔ String
-
Type of task. For example a
survey.getter/setter pair
Methods
-
addMeasure(
Measure measure) → void -
Add
measureto this task.inherited -
addMeasures(
Iterable< Measure> list) → void -
Add a
listof measures to this task.inherited -
getAllExpectedDataTypes(
) → Set< String> -
Get data types of all data which may be collected, either passively as part
of task measures, or as the result of user interactions, for this task.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMeasure(
Measure measure) → void -
Remove
measurefrom this task.inherited -
toJson(
) → Map< String, dynamic> -
Return a JSON encoding of this object.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited