copyWith method

NAppUpdateState copyWith({
  1. NAppUpdateStatus? status,
  2. InstalledSoftware? installed,
  3. SoftwareUpdate? update,
  4. SoftwareRelease? currentRelease,
  5. SoftwareRelease? latestRelease,
  6. SoftwareRelease? justUpdatedRelease,
  7. List<SoftwareRelease>? releases,
  8. Map<String, List<SoftwareAsset>>? assetsByReleaseId,
  9. bool clearJustUpdatedRelease = false,
  10. double? progress,
  11. bool clearProgress = false,
  12. DateTime? lastChecked,
  13. String? error,
  14. bool clearError = false,
})

Implementation

NAppUpdateState copyWith({
  NAppUpdateStatus? status,
  InstalledSoftware? installed,
  SoftwareUpdate? update,
  SoftwareRelease? currentRelease,
  SoftwareRelease? latestRelease,
  SoftwareRelease? justUpdatedRelease,
  List<SoftwareRelease>? releases,
  Map<String, List<SoftwareAsset>>? assetsByReleaseId,
  bool clearJustUpdatedRelease = false,
  double? progress,
  bool clearProgress = false,
  DateTime? lastChecked,
  String? error,
  bool clearError = false,
}) => NAppUpdateState(
  status: status ?? this.status,
  installed: installed ?? this.installed,
  update: update ?? this.update,
  currentRelease: currentRelease ?? this.currentRelease,
  latestRelease: latestRelease ?? this.latestRelease,
  justUpdatedRelease: clearJustUpdatedRelease
      ? null
      : justUpdatedRelease ?? this.justUpdatedRelease,
  releases: releases ?? this.releases,
  assetsByReleaseId: assetsByReleaseId ?? this.assetsByReleaseId,
  progress: clearProgress ? null : progress ?? this.progress,
  lastChecked: lastChecked ?? this.lastChecked,
  error: clearError ? null : error ?? this.error,
);