ChatThemeData class

Fully resolved visual values used by chatx widgets.

Obtain it with ChatThemeData.of. Unlike ChatTheme, every value is non-null, which makes it convenient inside your own builders:

bubbleBuilder: (context, details, child) {
  final theme = ChatThemeData.of(context);
  return DecoratedBox(
    decoration: BoxDecoration(color: theme.incomingBubbleColor),
    child: child,
  );
},
Annotations

Constructors

ChatThemeData({required Color backgroundColor, required Color outgoingBubbleColor, required Color incomingBubbleColor, required TextStyle outgoingTextStyle, required TextStyle incomingTextStyle, required TextStyle linkStyle, required TextStyle codeTextStyle, required TextStyle timestampTextStyle, required TextStyle userNameTextStyle, required TextStyle dateSeparatorTextStyle, required Color dateSeparatorColor, required Color unreadSeparatorColor, required TextStyle systemMessageTextStyle, required double bubbleRadius, required double bubbleGroupedRadius, required EdgeInsetsGeometry bubblePadding, required ChatBubbleTail bubbleTail, required double bubbleTailWidth, required double bubbleTailHeight, required double bubbleElevation, required Color bubbleShadowColor, required BorderSide outgoingBubbleBorderSide, required BorderSide incomingBubbleBorderSide, required double maxBubbleWidth, required double maxBubbleWidthFactor, required double avatarSize, required Color reactionChipColor, required Color reactionChipSelectedColor, required Color highlightColor, required Color inputBackgroundColor, required Color inputFieldColor, required TextStyle inputTextStyle, required TextStyle inputHintStyle, required Color sendButtonColor, required Color sendButtonIconColor, required Color readStatusColor, required Color errorColor, required Color typingIndicatorColor, required Color scrollButtonColor, required Color scrollButtonIconColor, required Color unreadBadgeColor, required Color unreadBadgeTextColor})
Creates resolved theme values. Prefer ChatThemeData.fallback or ChatThemeData.of.
const
ChatThemeData.fallback(ThemeData theme)
Derives every value from a Material theme.
factory

Properties

avatarSize → double
See ChatTheme.avatarSize.
final
backgroundColor → Color
See ChatTheme.backgroundColor.
final
bubbleElevation → double
See ChatTheme.bubbleElevation.
final
bubbleGroupedRadius → double
See ChatTheme.bubbleGroupedRadius.
final
bubblePadding → EdgeInsetsGeometry
See ChatTheme.bubblePadding.
final
bubbleRadius → double
See ChatTheme.bubbleRadius.
final
bubbleShadowColor → Color
See ChatTheme.bubbleShadowColor.
final
bubbleTail → ChatBubbleTail
See ChatTheme.bubbleTail.
final
bubbleTailHeight → double
See ChatTheme.bubbleTailHeight.
final
bubbleTailWidth → double
See ChatTheme.bubbleTailWidth.
final
codeTextStyle → TextStyle
See ChatTheme.codeTextStyle.
final
dateSeparatorColor → Color
See ChatTheme.dateSeparatorColor.
final
dateSeparatorTextStyle → TextStyle
See ChatTheme.dateSeparatorTextStyle.
final
errorColor → Color
See ChatTheme.errorColor.
final
hashCode → int
The hash code for this object.
no setteroverride
highlightColor → Color
See ChatTheme.highlightColor.
final
incomingBubbleBorderSide → BorderSide
See ChatTheme.incomingBubbleBorderSide.
final
incomingBubbleColor → Color
See ChatTheme.incomingBubbleColor.
final
incomingTextStyle → TextStyle
See ChatTheme.incomingTextStyle.
final
inputBackgroundColor → Color
See ChatTheme.inputBackgroundColor.
final
inputFieldColor → Color
See ChatTheme.inputFieldColor.
final
inputHintStyle → TextStyle
See ChatTheme.inputHintStyle.
final
inputTextStyle → TextStyle
See ChatTheme.inputTextStyle.
final
linkStyle → TextStyle
See ChatTheme.linkStyle.
final
maxBubbleWidth → double
See ChatTheme.maxBubbleWidth.
final
maxBubbleWidthFactor → double
See ChatTheme.maxBubbleWidthFactor.
final
outgoingBubbleBorderSide → BorderSide
See ChatTheme.outgoingBubbleBorderSide.
final
outgoingBubbleColor → Color
See ChatTheme.outgoingBubbleColor.
final
outgoingTextStyle → TextStyle
See ChatTheme.outgoingTextStyle.
final
reactionChipColor → Color
See ChatTheme.reactionChipColor.
final
reactionChipSelectedColor → Color
See ChatTheme.reactionChipSelectedColor.
final
readStatusColor → Color
See ChatTheme.readStatusColor.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollButtonColor → Color
See ChatTheme.scrollButtonColor.
final
scrollButtonIconColor → Color
See ChatTheme.scrollButtonIconColor.
final
sendButtonColor → Color
See ChatTheme.sendButtonColor.
final
sendButtonIconColor → Color
See ChatTheme.sendButtonIconColor.
final
systemMessageTextStyle → TextStyle
See ChatTheme.systemMessageTextStyle.
final
timestampTextStyle → TextStyle
See ChatTheme.timestampTextStyle.
final
typingIndicatorColor → Color
See ChatTheme.typingIndicatorColor.
final
unreadBadgeColor → Color
See ChatTheme.unreadBadgeColor.
final
unreadBadgeTextColor → Color
See ChatTheme.unreadBadgeTextColor.
final
unreadSeparatorColor → Color
See ChatTheme.unreadSeparatorColor.
final
userNameTextStyle → TextStyle
See ChatTheme.userNameTextStyle.
final

Methods

bubbleBorderSide({required bool isOutgoing}) → BorderSide
Outline of a bubble, depending on its direction.
bubbleColor({required bool isOutgoing}) → Color
Background of a bubble, depending on its direction.
bubbleTextStyle({required bool isOutgoing}) → TextStyle
Text style of a bubble, depending on its direction.
merge(ChatTheme? overrides) → ChatThemeData
Returns a copy where the non-null values of overrides win. Text styles are merged.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

of(BuildContext context) → ChatThemeData
Resolves the theme for context.