copyWith method

Constraints copyWith({
  1. bool? requiresNetwork,
  2. bool? requiresUnmeteredNetwork,
  3. bool? requiresCharging,
  4. bool? requiresDeviceIdle,
  5. bool? requiresBatteryNotLow,
  6. bool? requiresStorageNotLow,
  7. bool? allowWhileIdle,
  8. bool? isHeavyTask,
  9. QoS? qos,
  10. ExactAlarmIOSBehavior? exactAlarmIOSBehavior,
  11. BackoffPolicy? backoffPolicy,
  12. int? backoffDelayMs,
  13. int? maxRetries,
  14. Set<SystemConstraint>? systemConstraints,
  15. BGTaskType? bgTaskType,
  16. ForegroundServiceType? foregroundServiceType,
  17. 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,
    );