of static method

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

If there is no enclosing StreamChannelPreviewTheme widget, then StreamChatThemeData.channelPreviewTheme is used.

Typical usage is as follows:

final theme = ChannelPreviewTheme.of(context);

Implementation

static StreamChannelPreviewThemeData of(BuildContext context) {
  final channelPreviewTheme =
      context.dependOnInheritedWidgetOfExactType<StreamChannelPreviewTheme>();
  return channelPreviewTheme?.data ??
      StreamChatTheme.of(context).channelPreviewTheme;
}