copyWith method

PreferenceDetailState copyWith({
  1. String? value,
  2. bool? enabled,
  3. bool? isSaving,
  4. PreferenceDetailError? error,
  5. bool clearError = false,
})

Implementation

PreferenceDetailState copyWith({
  String? value,
  bool? enabled,
  bool? isSaving,
  PreferenceDetailError? error,
  bool clearError = false,
}) {
  return PreferenceDetailState(
    mode: mode,
    value: value ?? this.value,
    enabled: enabled ?? this.enabled,
    isSaving: isSaving ?? this.isSaving,
    error: clearError ? null : error ?? this.error,
  );
}