# UsersBloc

A Widget Dedicated To The Management Of A Users List With Pagination.

### Background

Most widgets in the Core SDK are focused on fetching a particular type of object from Stream Chat - channels,
messages, users, etc. The BLoC widgets bundle up the base functions used to fetch data as well as the current
data fetched by the respective functions. Furthermore, the Core widgets use this BLoC to fetch new or
existing data and build UI based on it.

All Core and UI widgets which focus on fetching a list of objects need to have their respective functions
above them in the widget tree. The UserListCore and UserListView require the UserListCore
above them in the widget hierarchy without which they will fail.

### Understanding The Widget

`UsersBloc` can be accessed at anytime by using the static `.of` method
using Flutter's `BuildContext`.

```dart
var _userBloc_ = UsersBloc.of(context);
```

The `UsersBloc` widget encapsulates common functionality related to user lists and also supplies them down the widget tree.

Here is a basic implementation of `UsersBloc`:

```dart
UsersBloc(
    child: // Further Widget Tree
),
```

---

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

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