of static method

The closest instance of this class that encloses the given context.

If there is no enclosing StreamChannelHeaderTheme widget, then StreamChatThemeData.channelTheme.channelHeaderTheme is used.

Typical usage is as follows:

final theme = ChannelHeaderTheme.of(context);

Implementation

static StreamChannelHeaderThemeData of(BuildContext context) {
  final channelHeaderTheme =
      context.dependOnInheritedWidgetOfExactType<StreamChannelHeaderTheme>();
  return channelHeaderTheme?.data ??
      StreamChatTheme.of(context).channelHeaderTheme;
}