copyWith method

PackageInfo copyWith({
  1. String? name,
  2. bool? installed,
  3. bool? incomplete,
  4. bool? preinstalled,
  5. bool? compatible,
  6. bool? hasUpdate,
  7. Optional<PackageInfoError?>? error,
  8. PackageUpdateStatus? updateStatus,
  9. Optional<int?>? finalSizeOnDisk,
  10. int? currentSizeOnDisk,
})

Implementation

PackageInfo copyWith({
  String? name,
  bool? installed,
  bool? incomplete,
  bool? preinstalled,
  bool? compatible,
  bool? hasUpdate,
  Optional<PackageInfoError?>? error,
  PackageUpdateStatus? updateStatus,
  Optional<int?>? finalSizeOnDisk,
  int? currentSizeOnDisk
}) {
  return PackageInfo(
    name: name ?? this.name,
    installed: installed ?? this.installed,
    incomplete: incomplete ?? this.incomplete,
    preinstalled: preinstalled ?? this.preinstalled,
    compatible: compatible ?? this.compatible,
    hasUpdate: hasUpdate ?? this.hasUpdate,
    error: error != null ? error.value : this.error,
    updateStatus: updateStatus ?? this.updateStatus,
    finalSizeOnDisk: finalSizeOnDisk != null ? finalSizeOnDisk.value : this.finalSizeOnDisk,
    currentSizeOnDisk: currentSizeOnDisk ?? this.currentSizeOnDisk
  );
}