Info:
This is documentation for Stream Chat Flutter SDK v8, which is no longer actively maintained. For up-to-date documentation, see the latest version (v10).

StreamMessageSearchGridView

A Widget To Search For Messages Across Channels

Find the pub.dev documentation here

Background

The StreamMessageSearchGridView widget allows displaying a list of searched messages in a GridView.

Note:

Make sure to check the StreamMessageSearchListView documentation to know how to show results in a ListView.

Basic Example

class StreamMessageSearchPage extends StatefulWidget {
  const StreamMessageSearchPage({
    super.key,
    required this.client,
  });

  final StreamChatClient client;

  @override
  State<StreamMessageSearchPage> createState() => _StreamMessageSearchState();
}

class _StreamMessageSearchState extends State<StreamMessageSearchPage> {
  late final _controller = StreamMessageSearchListController(
    client: widget.client,
    limit: 20,
    filter: Filter.in_(
      'members',
      [StreamChat.of(context).user!.id],
    ),
    searchQuery: 'your query here',
  );

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) => Scaffold(
        body: StreamMessageSearchGridView(
          controller: _controller,
          itemBuilder: (context, values, index) {
           // return your custom widget here
          },
        ),
      );
}
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat Flutter v8: <Your Question>