copyWith method

ChatMessageSuggestion 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

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