TaskConfig class

Configuration object provided to scheduleTask

Constructors

TaskConfig({required String taskId, required int delay, bool periodic = false, TaskType type = TaskType.DEFAULT, bool? stopOnTerminate, bool? startOnBoot, bool? enableHeadless, bool? forceAlarmManager, NetworkType? requiredNetworkType, bool? requiresBatteryNotLow, bool? requiresStorageNotLow, bool? requiresCharging, bool? requiresDeviceIdle, bool requiresNetworkConnectivity = false})
Create an instance of TaskConfig for scheduleTask.

Properties

delay int
Number of milliseconds when this task will fire.
getter/setter pair
enableHeadless bool?
Android only: Set true to enable the Headless mechanism, for handling fetch events after app termination.
getter/setter pairinherited
forceAlarmManager bool?
Android only: Set true to force Task to use Android AlarmManager mechanism rather than JobScheduler. Defaults to false. Will result in more precise scheduling of tasks at the cost of higher battery usage.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
periodic bool
Controls whether this task should execute repeatedly. Defaults to false.
getter/setter pair
requiredNetworkType NetworkType?
Android only Set detailed description of the kind of network your job requires.
getter/setter pairinherited
requiresBatteryNotLow bool?
Android only Specify that to run this job, the device's battery level must not be low.
getter/setter pairinherited
requiresCharging bool?
Android only Specify that to run this job, the device must be charging (or be a non-battery-powered device connected to permanent power, such as Android TV devices). This defaults to false.
getter/setter pairinherited
requiresDeviceIdle bool?
Android only When set true, ensure that this job will not run if the device is in active use.
getter/setter pairinherited
requiresNetworkConnectivity bool
iOS only Set true when this task requires network connectivity.
getter/setter pair
requiresStorageNotLow bool?
Android only Specify that to run this job, the device's available storage must not be low.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startOnBoot bool?
Android only: Set true to initiate background-fetch events when the device is rebooted. Defaults to false.
getter/setter pairinherited
stopOnTerminate bool?
Android only: Set false to continue background-fetch events after user terminates the app. Default to true.
getter/setter pairinherited
taskId String
Unique taskId. This taskId will be provided to the BackgroundFetch callback function for use with BackgroundFetch.finish.
getter/setter pair
type TaskType
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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