copyWith method

DropdownItem<T> copyWith({
  1. String? label,
  2. T? value,
  3. bool? disabled,
  4. bool? selected,
})

Creates a copy of the DropdownItem instance with the specified properties.

If any of the properties are not provided, the corresponding properties of the original instance will be used.

Implementation

DropdownItem<T> copyWith({
  String? label,
  T? value,
  bool? disabled,
  bool? selected,
}) {
  return DropdownItem<T>(
    id: this.id,
    label: label ?? this.label,
    value: value ?? this.value,
    disabled: disabled ?? this.disabled,
    selected: selected ?? this.selected,
  );
}