MessageSearchListView class

It shows the list of searched messages.

class MessageSearchPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: MessageSearchListView(
        messageQuery: _channelQuery,
        filters: {
          'members': {
            r'$in': [user.id]
          }
        },
        limit: 20,
      ),
    );
  }
}

Make sure to have a MessageSearchBloc ancestor in order to provide the information about the messages. The widget uses a ListView.separated to render the list of messages.

The widget components render the ui based on the first ancestor of type StreamChatTheme. Modify it to change the widget appearance.

Inheritance

Constructors

MessageSearchListView({Key? key, required Filter filters, String? messageQuery, List<SortOption>? sortOptions, int limit = 30, Filter? messageFilters, IndexedWidgetBuilder? separatorBuilder, MessageSearchItemBuilder? itemBuilder, MessageSearchItemTapCallback? onItemTap, bool showResultCount = true, bool pullToRefresh = true, bool showErrorTile = false, WidgetBuilder? emptyBuilder, ErrorBuilder? errorBuilder, WidgetBuilder? loadingBuilder, Widget childBuilder(List<GetMessageResponse>)?, MessageSearchListController? messageSearchListController})
Instantiate a new MessageSearchListView
const

Properties

childBuilder → (Widget Function(List<GetMessageResponse>)?)
The builder that is used when the search messages are fetched
final
emptyBuilder WidgetBuilder?
The builder used when the channel list is empty.
final
errorBuilder ErrorBuilder?
The builder that will be used in case of error
final
filters Filter
The query filters to use. You can query on any of the custom fields you've defined on the Channel. You can also filter other built-in channel fields.
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder MessageSearchItemBuilder?
Builder used to create a custom item preview
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
limit int
The amount of messages requested per API call.
final
loadingBuilder WidgetBuilder?
The builder that will be used in case of loading
final
messageFilters Filter?
The message query filters to use. You can query on any of the custom fields you've defined on the Channel. You can also filter other built-in channel fields.
final
messageQuery String?
Message String to search on
final
messageSearchListController MessageSearchListController?
A MessageSearchListController allows reloading and pagination. Use MessageSearchListController.loadData and MessageSearchListController.paginateData respectively for reloading and pagination.
final
onItemTap MessageSearchItemTapCallback?
Function called when tapping on a MessageSearchItem
final
pullToRefresh bool
Set it to false to disable the pull-to-refresh widget
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
separatorBuilder IndexedWidgetBuilder?
Builder used to create a custom item separator
final
showErrorTile bool
Show error tile on top
final
showResultCount bool
Set it to false to hide total results text
final
sortOptions List<SortOption>?
The sorting used for the channels matching the filters. Sorting is based on field and direction, multiple sorting options can be provided. You can sort based on last_updated, last_message_at, updated_at, created_at or member_count. Direction can be ascending or descending.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _MessageSearchListViewState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited