chore: rename ChannelPreviewTheme.title and .subtitle to .titleStyle and .subtitleStyle

This commit is contained in:
groovinchip
2021-07-30 13:43:22 -04:00
parent c7d399704e
commit 6765854132
6 changed files with 25 additions and 25 deletions
@@ -119,7 +119,7 @@ class ChannelListPage extends StatelessWidget {
), ),
title: ChannelName( title: ChannelName(
textStyle: textStyle:
StreamChatTheme.of(context).channelPreviewTheme.title!.copyWith( StreamChatTheme.of(context).channelPreviewTheme.titleStyle!.copyWith(
color: StreamChatTheme.of(context) color: StreamChatTheme.of(context)
.colorTheme .colorTheme
.textHighEmphasis .textHighEmphasis
@@ -64,7 +64,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
showTypingIndicator: false, showTypingIndicator: false,
channel: _streamChannelState.channel, channel: _streamChannelState.channel,
textStyle: textStyle:
_streamChatThemeData.channelPreviewTheme.subtitle, _streamChatThemeData.channelPreviewTheme.subtitleStyle,
), ),
), ),
const SizedBox( const SizedBox(
@@ -90,7 +90,7 @@ class ChannelPreview extends StatelessWidget {
Flexible( Flexible(
child: title ?? child: title ??
ChannelName( ChannelName(
textStyle: channelPreviewTheme.title, textStyle: channelPreviewTheme.titleStyle,
), ),
), ),
BetterStreamBuilder<List<Member>?>( BetterStreamBuilder<List<Member>?>(
@@ -199,7 +199,7 @@ class ChannelPreview extends StatelessWidget {
), ),
Text( Text(
' Channel is muted', ' Channel is muted',
style: chatThemeData.channelPreviewTheme.subtitle, style: chatThemeData.channelPreviewTheme.subtitleStyle,
), ),
], ],
); );
@@ -207,7 +207,7 @@ class ChannelPreview extends StatelessWidget {
return TypingIndicator( return TypingIndicator(
channel: channel, channel: channel,
alternativeWidget: _buildLastMessage(context), alternativeWidget: _buildLastMessage(context),
style: chatThemeData.channelPreviewTheme.subtitle, style: chatThemeData.channelPreviewTheme.subtitleStyle,
); );
} }
@@ -248,13 +248,13 @@ class ChannelPreview extends StatelessWidget {
text, text,
lastMessage.mentionedUsers, lastMessage.mentionedUsers,
lastMessage.attachments, lastMessage.attachments,
chatThemeData.channelPreviewTheme.subtitle?.copyWith( chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
color: chatThemeData.channelPreviewTheme.subtitle?.color, color: chatThemeData.channelPreviewTheme.subtitleStyle?.color,
fontStyle: (lastMessage.isSystem || lastMessage.isDeleted) fontStyle: (lastMessage.isSystem || lastMessage.isDeleted)
? FontStyle.italic ? FontStyle.italic
: FontStyle.normal), : FontStyle.normal),
chatThemeData.channelPreviewTheme.subtitle?.copyWith( chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
color: chatThemeData.channelPreviewTheme.subtitle?.color, color: chatThemeData.channelPreviewTheme.subtitleStyle?.color,
fontStyle: (lastMessage.isSystem || lastMessage.isDeleted) fontStyle: (lastMessage.isSystem || lastMessage.isDeleted)
? FontStyle.italic ? FontStyle.italic
: FontStyle.normal, : FontStyle.normal,
@@ -52,18 +52,18 @@ class MessageSearchItem extends StatelessWidget {
user.id == StreamChat.of(context).currentUser?.id user.id == StreamChat.of(context).currentUser?.id
? 'You' ? 'You'
: user.name, : user.name,
style: chatThemeData.channelPreviewTheme.title, style: chatThemeData.channelPreviewTheme.titleStyle,
), ),
if (channelName != null) ...[ if (channelName != null) ...[
Text( Text(
' in ', ' in ',
style: chatThemeData.channelPreviewTheme.title?.copyWith( style: chatThemeData.channelPreviewTheme.titleStyle?.copyWith(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
), ),
Text( Text(
channelName as String, channelName as String,
style: chatThemeData.channelPreviewTheme.title, style: chatThemeData.channelPreviewTheme.titleStyle,
), ),
], ],
], ],
@@ -127,12 +127,12 @@ class MessageSearchItem extends StatelessWidget {
text!, text!,
message.mentionedUsers, message.mentionedUsers,
message.attachments, message.attachments,
chatThemeData.channelPreviewTheme.subtitle?.copyWith( chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
fontStyle: (message.isSystem || message.isDeleted) fontStyle: (message.isSystem || message.isDeleted)
? FontStyle.italic ? FontStyle.italic
: FontStyle.normal, : FontStyle.normal,
), ),
chatThemeData.channelPreviewTheme.subtitle?.copyWith( chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
fontStyle: (message.isSystem || message.isDeleted) fontStyle: (message.isSystem || message.isDeleted)
? FontStyle.italic ? FontStyle.italic
: FontStyle.normal, : FontStyle.normal,
@@ -292,8 +292,8 @@ class StreamChatThemeData {
width: 40, width: 40,
), ),
), ),
title: textTheme.bodyBold, titleStyle: textTheme.bodyBold,
subtitle: textTheme.footnote.copyWith( subtitleStyle: textTheme.footnote.copyWith(
color: const Color(0xff7A7A7A), color: const Color(0xff7A7A7A),
), ),
lastMessageAt: textTheme.footnote.copyWith( lastMessageAt: textTheme.footnote.copyWith(
@@ -460,7 +460,7 @@ class StreamChatThemeData {
backgroundColor: channelHeaderTheme.color, backgroundColor: channelHeaderTheme.color,
iconMenuPointColor: colorTheme.textHighEmphasis, iconMenuPointColor: colorTheme.textHighEmphasis,
titleTextStyle: textTheme.headlineBold, titleTextStyle: textTheme.headlineBold,
subtitleTextStyle: channelPreviewTheme.subtitle, subtitleTextStyle: channelPreviewTheme.subtitleStyle,
bottomSheetBarrierColor: colorTheme.overlay, bottomSheetBarrierColor: colorTheme.overlay,
), ),
galleryFooterTheme: GalleryFooterThemeData( galleryFooterTheme: GalleryFooterThemeData(
@@ -5,8 +5,8 @@ import 'package:stream_chat_flutter/src/theme/avatar_theme.dart';
class ChannelPreviewTheme { class ChannelPreviewTheme {
/// Constructor for creating [ChannelPreviewTheme] /// Constructor for creating [ChannelPreviewTheme]
const ChannelPreviewTheme({ const ChannelPreviewTheme({
this.title, this.titleStyle,
this.subtitle, this.subtitleStyle,
this.lastMessageAt, this.lastMessageAt,
this.avatarTheme, this.avatarTheme,
this.unreadCounterColor, this.unreadCounterColor,
@@ -14,10 +14,10 @@ class ChannelPreviewTheme {
}); });
/// Theme for title /// Theme for title
final TextStyle? title; final TextStyle? titleStyle;
/// Theme for subtitle /// Theme for subtitle
final TextStyle? subtitle; final TextStyle? subtitleStyle;
/// Theme of last message at /// Theme of last message at
final TextStyle? lastMessageAt; final TextStyle? lastMessageAt;
@@ -41,8 +41,8 @@ class ChannelPreviewTheme {
double? indicatorIconSize, double? indicatorIconSize,
}) => }) =>
ChannelPreviewTheme( ChannelPreviewTheme(
title: title ?? this.title, titleStyle: title ?? this.titleStyle,
subtitle: subtitle ?? this.subtitle, subtitleStyle: subtitle ?? this.subtitleStyle,
lastMessageAt: lastMessageAt ?? this.lastMessageAt, lastMessageAt: lastMessageAt ?? this.lastMessageAt,
avatarTheme: avatarTheme ?? this.avatarTheme, avatarTheme: avatarTheme ?? this.avatarTheme,
unreadCounterColor: unreadCounterColor ?? this.unreadCounterColor, unreadCounterColor: unreadCounterColor ?? this.unreadCounterColor,
@@ -53,8 +53,8 @@ class ChannelPreviewTheme {
ChannelPreviewTheme merge(ChannelPreviewTheme? other) { ChannelPreviewTheme merge(ChannelPreviewTheme? other) {
if (other == null) return this; if (other == null) return this;
return copyWith( return copyWith(
title: title?.merge(other.title) ?? other.title, title: titleStyle?.merge(other.titleStyle) ?? other.titleStyle,
subtitle: subtitle?.merge(other.subtitle) ?? other.subtitle, subtitle: subtitleStyle?.merge(other.subtitleStyle) ?? other.subtitleStyle,
lastMessageAt: lastMessageAt:
lastMessageAt?.merge(other.lastMessageAt) ?? other.lastMessageAt, lastMessageAt?.merge(other.lastMessageAt) ?? other.lastMessageAt,
avatarTheme: avatarTheme?.merge(other.avatarTheme) ?? other.avatarTheme, avatarTheme: avatarTheme?.merge(other.avatarTheme) ?? other.avatarTheme,