# StreamMessageSearchGridView

A Widget To Search For Messages Across Channels

Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamMessageSearchGridView-class.html)

### Background

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

<admonition type="note">

Make sure to check the [StreamMessageSearchListView](/chat/docs/sdk/flutter/v4/stream_chat_flutter/stream_message_search_list_view/) documentation to know how to show results in a `ListView`.

</admonition>

### Basic Example

```dart
class StreamMessageSearchPage extends StatefulWidget {
  const StreamMessageSearchPage({
    Key? key,
    required this.client,
  }) : super(key: key);`

  final StreamChatClient client;

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

class _StreamMessageSearchState extends State<StreamMessageSearchPage> {
  late final _controller = StreamMessageSearchListController(
    client: widget.client,
    limit: 20,
    filters: 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,
        ),
      );
}
```

---

This page was last updated at 2025-08-15T14:15:49.046Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/flutter/v4/stream_chat_flutter/stream_message_search_grid_view/](https://getstream.io/chat/docs/sdk/flutter/v4/stream_chat_flutter/stream_message_search_grid_view/).