copyWith method
نسخة معدلة من الحالة
Implementation
FluentAutoSuggestBoxState<T> copyWith({
List<FluentAutoSuggestBoxItem<T>>? items,
FluentAutoSuggestBoxItem<T>? selectedItem,
bool clearSelectedItem = false,
String? text,
bool? isLoading,
Object? error,
bool clearError = false,
bool? isOverlayVisible,
bool? isEnabled,
bool? isReadOnly,
}) {
return FluentAutoSuggestBoxState<T>(
items: items ?? this.items,
selectedItem: clearSelectedItem ? null : (selectedItem ?? this.selectedItem),
text: text ?? this.text,
isLoading: isLoading ?? this.isLoading,
error: clearError ? null : (error ?? this.error),
isOverlayVisible: isOverlayVisible ?? this.isOverlayVisible,
isEnabled: isEnabled ?? this.isEnabled,
isReadOnly: isReadOnly ?? this.isReadOnly,
);
}