copyWith method
Constraints
copyWith({
- bool? requiresNetwork,
- bool? requiresUnmeteredNetwork,
- bool? requiresCharging,
- bool? requiresDeviceIdle,
- bool? requiresBatteryNotLow,
- bool? requiresStorageNotLow,
- bool? allowWhileIdle,
- bool? isHeavyTask,
- QoS? qos,
- ExactAlarmIOSBehavior? exactAlarmIOSBehavior,
- BackoffPolicy? backoffPolicy,
- int? backoffDelayMs,
- int? maxRetries,
- Set<
SystemConstraint> ? systemConstraints, - BGTaskType? bgTaskType,
- ForegroundServiceType? foregroundServiceType,
- ForegroundNotificationConfig? foregroundNotificationConfig,
Create a copy with updated values.
Implementation
Constraints copyWith({
bool? requiresNetwork,
bool? requiresUnmeteredNetwork,
bool? requiresCharging,
bool? requiresDeviceIdle,
bool? requiresBatteryNotLow,
bool? requiresStorageNotLow,
bool? allowWhileIdle,
bool? isHeavyTask,
QoS? qos,
ExactAlarmIOSBehavior? exactAlarmIOSBehavior,
BackoffPolicy? backoffPolicy,
int? backoffDelayMs,
int? maxRetries,
Set<SystemConstraint>? systemConstraints,
BGTaskType? bgTaskType,
ForegroundServiceType? foregroundServiceType,
ForegroundNotificationConfig? foregroundNotificationConfig,
}) =>
Constraints(
requiresNetwork: requiresNetwork ?? this.requiresNetwork,
requiresUnmeteredNetwork:
requiresUnmeteredNetwork ?? this.requiresUnmeteredNetwork,
requiresCharging: requiresCharging ?? this.requiresCharging,
requiresDeviceIdle: requiresDeviceIdle ?? this.requiresDeviceIdle,
requiresBatteryNotLow:
requiresBatteryNotLow ?? this.requiresBatteryNotLow,
requiresStorageNotLow:
requiresStorageNotLow ?? this.requiresStorageNotLow,
allowWhileIdle: allowWhileIdle ?? this.allowWhileIdle,
isHeavyTask: isHeavyTask ?? this.isHeavyTask,
qos: qos ?? this.qos,
exactAlarmIOSBehavior:
exactAlarmIOSBehavior ?? this.exactAlarmIOSBehavior,
backoffPolicy: backoffPolicy ?? this.backoffPolicy,
backoffDelayMs: backoffDelayMs ?? this.backoffDelayMs,
maxRetries: maxRetries ?? this.maxRetries,
systemConstraints: systemConstraints ?? this.systemConstraints,
bgTaskType: bgTaskType ?? this.bgTaskType,
foregroundServiceType:
foregroundServiceType ?? this.foregroundServiceType,
foregroundNotificationConfig:
foregroundNotificationConfig ?? this.foregroundNotificationConfig,
);