---
id: stream_user_list_view
sidebar_position: 7
title: StreamUserListView
---

A Widget For Displaying And Selecting Users

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

![](../assets/user_list_view.png)

### Background

A list of users is required for many different purposes: showing a list of users in a Channel,
selecting users to add in a channel, etc. The `StreamUserListView` displays a list
of users.

:::note
Make sure to check the [StreamUserListController](./stream_user_list_controller.mdx) documentation for more information on how to use the controller to manipulate the `StreamUserListView`.
:::

### Basic Example

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

  final StreamChatClient client;

  @override
  State<UserListPage> createState() => _UserListPageState();
}

class _UserListPageState extends State<UserListPage> {
  late final _controller = StreamUserListController(
    client: widget.client,
    limit: 25,
    filter: Filter.and([
      Filter.notEqual('id', StreamChat.of(context).currentUser!.id),
    ]),
    sort: [
      SortOption(
        'name',
        direction: 1,
      ),
    ],
  );

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

  @override
  Widget build(BuildContext context) => Scaffold(
        body: RefreshIndicator(
          onRefresh: _controller.refresh,
          child: StreamChannelListView(
            controller: _controller,
            onChannelTap: (channel) => Navigator.push(
              context,
              MaterialPageRoute(
                builder: (_) => StreamChannel(
                  channel: channel,
                  child: const ChannelPage(),
                ),
              ),
            ),
          ),
        ),
      );
}
```

### Customize The User Items

You can use your own widget for the user items using the `itemBuilder` parameter.

```dart
StreamUsersListView(
  // ...
  itemBuilder: (context, users, index, defaultWidget) {
    return Text(user[index].name);
  },
),
```
