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})
-
Constructs an instance of ForegroundTaskOptions.
const
Properties
- 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
Methods
-
copyWith(
{ForegroundTaskEventAction? eventAction, bool? autoRunOnBoot, bool? autoRunOnMyPackageReplaced, bool? allowWakeLock, bool? allowWifiLock}) → 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