copyWith method

FluentAutoSuggestBoxState<T> copyWith({
  1. List<FluentAutoSuggestBoxItem<T>>? items,
  2. FluentAutoSuggestBoxItem<T>? selectedItem,
  3. bool clearSelectedItem = false,
  4. String? text,
  5. bool? isLoading,
  6. Object? error,
  7. bool clearError = false,
  8. bool? isOverlayVisible,
  9. bool? isEnabled,
  10. bool? isReadOnly,
})

نسخة معدلة من الحالة

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,
  );
}