copyWith method
- SyncBehavior? onWifi,
- SyncBehavior? onCellular,
- SyncBehavior? onMetered,
- SyncBehavior? onOffline,
- SyncBehavior? onCharging,
- int? batchSize,
- Duration? batchInterval,
- int? lowBatteryThreshold,
- SyncBehavior? lowBatteryBehavior,
- Duration? minSyncInterval,
- Duration? maxLocationAge,
- bool? preferWifi,
- bool? foregroundOnly,
Creates a copy with the given fields replaced.
Implementation
SyncPolicy copyWith({
SyncBehavior? onWifi,
SyncBehavior? onCellular,
SyncBehavior? onMetered,
SyncBehavior? onOffline,
SyncBehavior? onCharging,
int? batchSize,
Duration? batchInterval,
int? lowBatteryThreshold,
SyncBehavior? lowBatteryBehavior,
Duration? minSyncInterval,
Duration? maxLocationAge,
bool? preferWifi,
bool? foregroundOnly,
}) {
return SyncPolicy(
onWifi: onWifi ?? this.onWifi,
onCellular: onCellular ?? this.onCellular,
onMetered: onMetered ?? this.onMetered,
onOffline: onOffline ?? this.onOffline,
onCharging: onCharging ?? this.onCharging,
batchSize: batchSize ?? this.batchSize,
batchInterval: batchInterval ?? this.batchInterval,
lowBatteryThreshold: lowBatteryThreshold ?? this.lowBatteryThreshold,
lowBatteryBehavior: lowBatteryBehavior ?? this.lowBatteryBehavior,
minSyncInterval: minSyncInterval ?? this.minSyncInterval,
maxLocationAge: maxLocationAge ?? this.maxLocationAge,
preferWifi: preferWifi ?? this.preferWifi,
foregroundOnly: foregroundOnly ?? this.foregroundOnly,
);
}