copyWith method

ForegroundTaskOptions copyWith({
  1. ForegroundTaskEventAction? eventAction,
  2. bool? autoRunOnBoot,
  3. bool? autoRunOnMyPackageReplaced,
  4. bool? allowWakeLock,
  5. bool? allowWifiLock,
})

Creates a copy of the object replaced with new values.

Implementation

ForegroundTaskOptions copyWith({
  ForegroundTaskEventAction? eventAction,
  bool? autoRunOnBoot,
  bool? autoRunOnMyPackageReplaced,
  bool? allowWakeLock,
  bool? allowWifiLock,
}) =>
    ForegroundTaskOptions(
      eventAction: eventAction ?? this.eventAction,
      autoRunOnBoot: autoRunOnBoot ?? this.autoRunOnBoot,
      autoRunOnMyPackageReplaced:
          autoRunOnMyPackageReplaced ?? this.autoRunOnMyPackageReplaced,
      allowWakeLock: allowWakeLock ?? this.allowWakeLock,
      allowWifiLock: allowWifiLock ?? this.allowWifiLock,
    );