ThreadHeader typedef

  1. @Deprecated("Use 'StreamThreadHeader' instead")
ThreadHeader = StreamThreadHeader

screenshot screenshot

It shows the current thread information.

class ThreadPage extends StatelessWidget {
  final Message parent;

  ThreadPage({
    Key key,
    this.parent,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: ThreadHeader(
        parent: parent,
      ),
      body: Column(
        children: <Widget>[
          Expanded(
            child: MessageListView(
              parentMessage: parent,
            ),
          ),
          MessageInput(
            parentMessage: parent,
          ),
        ],
      ),
    );
  }
}

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

Make sure to have a StreamChannel ancestor in order to provide the information about the channel. Every part of the widget uses a StreamBuilder to render the channel information as soon as it updates.

By default the widget shows a backButton that calls Navigator.pop. You can disable this button using the showBackButton property of just override the behaviour with onBackPressed.

The widget components render the ui based on the first ancestor of type StreamChatTheme and on its ChannelTheme.channelHeaderTheme property. Modify it to change the widget appearance.

Implementation

@Deprecated("Use 'StreamThreadHeader' instead")
typedef ThreadHeader = StreamThreadHeader;