copyWith method

SearchMessages copyWith({
  1. ChatList? chatList()?,
  2. String? query,
  3. String? offset,
  4. int? limit,
  5. SearchMessagesFilter? filter()?,
  6. int? minDate,
  7. int? maxDate,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

SearchMessages copyWith({
  ChatList? Function()? chatList,
  String? query,
  String? offset,
  int? limit,
  SearchMessagesFilter? Function()? filter,
  int? minDate,
  int? maxDate,
}) =>
    SearchMessages(
      chatList: chatList != null ? chatList() : this.chatList,
      query: query ?? this.query,
      offset: offset ?? this.offset,
      limit: limit ?? this.limit,
      filter: filter != null ? filter() : this.filter,
      minDate: minDate ?? this.minDate,
      maxDate: maxDate ?? this.maxDate,
    );