copyWith method

AssistMessageSuggestion copyWith({
  1. String? data,
  2. bool? selected,
  3. WidgetBuilder? builder,
})

Creates a copy of this suggestion with the given fields replaced by the new values.

Implementation

AssistMessageSuggestion copyWith({
  String? data,
  bool? selected,
  WidgetBuilder? builder,
}) {
  if (this.builder != null) {
    return AssistMessageSuggestion.builder(
      builder: builder ?? this.builder,
      data: data ?? this.data,
      selected: selected ?? this.selected,
    );
  } else {
    return AssistMessageSuggestion(
      data: data ?? this.data,
      selected: selected ?? this.selected,
    );
  }
}