StreamChannelListHeader constructor

const StreamChannelListHeader({
  1. Key? key,
  2. StreamChatClient? client,
  3. ChannelListHeaderTitleBuilder? titleBuilder,
  4. dynamic onUserAvatarTap(
    1. User
    )?,
  5. VoidCallback? onNewChatButtonTap,
  6. bool showConnectionStateTile = false,
  7. VoidCallback? preNavigationCallback,
  8. Widget? subtitle,
  9. bool? centerTitle,
  10. Widget? leading,
  11. List<Widget>? actions,
  12. Color? backgroundColor,
  13. double elevation = 1,
})

Shows the current StreamChatClient status.

class MyApp extends StatelessWidget {
  final StreamChatClient client;

  MyApp(this.client);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: StreamChat(
        client: client,
        child: Scaffold(
            appBar: ChannelListHeader(),
          ),
        ),
    );
  }
}

Usually you would use this widget as an AppBar inside a Scaffold. However, you can also use it as a normal widget.

Uses the inherited StreamChatClient, by default, to fetch information about the status of the client. You can also pass your own StreamChatClient if you don't have it in the widget tree.

Renders the UI based on the first ancestor of type StreamChatTheme and the StreamChannelListHeaderThemeData property. Modify it to change the widget's appearance.

Implementation

const StreamChannelListHeader({
  super.key,
  this.client,
  this.titleBuilder,
  this.onUserAvatarTap,
  this.onNewChatButtonTap,
  this.showConnectionStateTile = false,
  this.preNavigationCallback,
  this.subtitle,
  this.centerTitle,
  this.leading,
  this.actions,
  this.backgroundColor,
  this.elevation = 1,
});