WorkManagerConstraintConfig class
A specification of the requirements that need to be met before a WorkRequest can run. By default, WorkRequests do not have any requirements and can run immediately. By adding requirements, you can make sure that work only runs in certain situations - for example, when you have an unmetered network and are charging.
Constructors
- WorkManagerConstraintConfig({NetworkType networkType, bool requiresBatteryNotLow, bool requiresCharging, bool requiresDeviceIdle, bool requiresStorageNotLow })
Properties
- networkType → NetworkType
-
An enumeration of various network types that can be used as Constraints for work.
final
- requiresBatteryNotLow → bool
-
true if the work should only execute when the battery isn't low
final
- requiresCharging → bool
-
true if the work should only execute while the device is charging
final
- requiresDeviceIdle → bool
-
true if the work should only execute while the device is idle
final
- requiresStorageNotLow → bool
-
true if the work should only execute when the storage isn't low
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited