ForegroundTaskOptions class

Data class with foreground task options.

Constructors

ForegroundTaskOptions({required ForegroundTaskEventAction eventAction, bool autoRunOnBoot = false, bool autoRunOnMyPackageReplaced = false, bool allowWakeLock = true, bool allowWifiLock = false, bool allowAutoRestart = true, bool? stopWithTask})
Constructs an instance of ForegroundTaskOptions.
const

Properties

allowAutoRestart → bool
Allows an application to automatically restart when the app is killed by the system.
final
allowWakeLock → bool
Whether to keep the CPU turned on. The default is true.
final
allowWifiLock → bool
Allows an application to keep the Wi-Fi radio awake. The default is false.
final
autoRunOnBoot → bool
Whether to automatically run foreground task on boot. The default is false.
final
autoRunOnMyPackageReplaced → bool
Whether to automatically run foreground task when the app is updated to a new version. The default is false.
final
eventAction → ForegroundTaskEventAction
The action of onRepeatEvent in TaskHandler.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stopWithTask → bool?
Allows an application to automatically stop when the app task is removed by the system. If set, overrides the service android:stopWithTask behavior.
final

Methods

copyWith({ForegroundTaskEventAction? eventAction, bool? autoRunOnBoot, bool? autoRunOnMyPackageReplaced, bool? allowWakeLock, bool? allowWifiLock, bool? allowAutoRestart, Object? stopWithTask = _unset}) → ForegroundTaskOptions
Creates a copy of the object replaced with new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Returns the data fields of ForegroundTaskOptions in JSON format.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited