copyWith method

UpgraderState copyWith({
  1. Client? client,
  2. Map<String, String>? clientHeaders,
  3. String? countryCodeOverride,
  4. bool? debugDisplayAlways,
  5. bool? debugDisplayOnce,
  6. bool? debugLogging,
  7. Duration? durationUntilAlertAgain,
  8. String? languageCodeOverride,
  9. UpgraderMessages? messages,
  10. Version? minAppVersion,
  11. PackageInfo? packageInfo,
  12. UpgraderDevice? upgraderDevice,
  13. UpgraderOS? upgraderOS,
  14. UpgraderVersionInfo? versionInfo,
})

Creates a new state object by copying existing data and modifying selected fields.

Implementation

UpgraderState copyWith({
  http.Client? client,
  Map<String, String>? clientHeaders,
  String? countryCodeOverride,
  bool? debugDisplayAlways,
  bool? debugDisplayOnce,
  bool? debugLogging,
  Duration? durationUntilAlertAgain,
  String? languageCodeOverride,
  UpgraderMessages? messages,
  Version? minAppVersion,
  PackageInfo? packageInfo,
  UpgraderDevice? upgraderDevice,
  UpgraderOS? upgraderOS,
  UpgraderVersionInfo? versionInfo,
}) {
  return UpgraderState(
    client: client ?? this.client,
    clientHeaders: clientHeaders ?? this.clientHeaders,
    countryCodeOverride: countryCodeOverride ?? this.countryCodeOverride,
    debugDisplayAlways: debugDisplayAlways ?? this.debugDisplayAlways,
    debugDisplayOnce: debugDisplayOnce ?? this.debugDisplayOnce,
    debugLogging: debugLogging ?? this.debugLogging,
    durationUntilAlertAgain:
        durationUntilAlertAgain ?? this.durationUntilAlertAgain,
    languageCodeOverride: languageCodeOverride ?? this.languageCodeOverride,
    messages: messages ?? this.messages,
    minAppVersion: minAppVersion ?? this.minAppVersion,
    packageInfo: packageInfo ?? this.packageInfo,
    upgraderDevice: upgraderDevice ?? this.upgraderDevice,
    upgraderOS: upgraderOS ?? this.upgraderOS,
    versionInfo: versionInfo ?? this.versionInfo,
  );
}