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