chore: address PR feedback
This commit is contained in:
@@ -118,10 +118,7 @@ class ChannelListPage extends StatelessWidget {
|
||||
channel: channel,
|
||||
),
|
||||
title: ChannelName(
|
||||
textStyle: StreamChatTheme.of(context)
|
||||
.channelPreviewTheme
|
||||
.titleStyle!
|
||||
.copyWith(
|
||||
textStyle: ChannelPreviewTheme.of(context).titleStyle!.copyWith(
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
.textHighEmphasis
|
||||
|
||||
@@ -105,7 +105,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final channel = StreamChannel.of(context).channel;
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
final channelHeaderTheme = ChannelHeaderTheme.of(context);
|
||||
|
||||
final leadingWidget = leading ??
|
||||
(showBackButton
|
||||
@@ -141,17 +141,17 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
brightness: Theme.of(context).brightness,
|
||||
elevation: 1,
|
||||
leading: leadingWidget,
|
||||
backgroundColor: chatThemeData.channelHeaderTheme.color,
|
||||
backgroundColor: channelHeaderTheme.color,
|
||||
actions: actions ??
|
||||
<Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: Center(
|
||||
child: ChannelAvatar(
|
||||
borderRadius: chatThemeData
|
||||
.channelHeaderTheme.avatarTheme?.borderRadius,
|
||||
constraints: chatThemeData
|
||||
.channelHeaderTheme.avatarTheme?.constraints,
|
||||
borderRadius:
|
||||
channelHeaderTheme.avatarTheme?.borderRadius,
|
||||
constraints:
|
||||
channelHeaderTheme.avatarTheme?.constraints,
|
||||
onTap: onImageTap,
|
||||
),
|
||||
),
|
||||
@@ -168,16 +168,14 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
children: <Widget>[
|
||||
title ??
|
||||
ChannelName(
|
||||
textStyle:
|
||||
chatThemeData.channelHeaderTheme.titleStyle,
|
||||
textStyle: channelHeaderTheme.titleStyle,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
subtitle ??
|
||||
ChannelInfo(
|
||||
showTypingIndicator: showTypingIndicator,
|
||||
channel: channel,
|
||||
textStyle:
|
||||
chatThemeData.channelHeaderTheme.subtitleStyle,
|
||||
textStyle: channelHeaderTheme.subtitleStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -65,7 +65,7 @@ class ChannelInfo extends StatelessWidget {
|
||||
}
|
||||
alternativeWidget = Text(
|
||||
text,
|
||||
style: StreamChatTheme.of(context).channelHeaderTheme.subtitleStyle,
|
||||
style: ChannelHeaderTheme.of(context).subtitleStyle,
|
||||
);
|
||||
} else {
|
||||
final userId = StreamChat.of(context).currentUser?.id;
|
||||
|
||||
@@ -241,12 +241,13 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
StreamChatClient client,
|
||||
) {
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
final channelListHeaderTheme = ChannelListHeaderTheme.of(context);
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
context.translations.offlineLabel,
|
||||
style: chatThemeData.channelListHeaderTheme.titleStyle?.copyWith(
|
||||
style: channelListHeaderTheme.titleStyle?.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -257,7 +258,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
..openConnection(),
|
||||
child: Text(
|
||||
context.translations.tryAgainLabel,
|
||||
style: chatThemeData.channelListHeaderTheme.titleStyle?.copyWith(
|
||||
style: channelListHeaderTheme.titleStyle?.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: chatThemeData.colorTheme.accentPrimary,
|
||||
|
||||
@@ -183,15 +183,13 @@ class ChannelPreview extends StatelessWidget {
|
||||
|
||||
return Text(
|
||||
stringDate,
|
||||
style: StreamChatTheme.of(context)
|
||||
.channelPreviewTheme
|
||||
.lastMessageAtStyle,
|
||||
style: ChannelPreviewTheme.of(context).lastMessageAtStyle,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Widget _buildSubtitle(BuildContext context) {
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
final channelPreviewTheme = ChannelPreviewTheme.of(context);
|
||||
if (channel.isMuted) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
@@ -201,7 +199,7 @@ class ChannelPreview extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
' ${context.translations.channelIsMutedText}',
|
||||
style: chatThemeData.channelPreviewTheme.subtitleStyle,
|
||||
style: channelPreviewTheme.subtitleStyle,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -209,7 +207,7 @@ class ChannelPreview extends StatelessWidget {
|
||||
return TypingIndicator(
|
||||
channel: channel,
|
||||
alternativeWidget: _buildLastMessage(context),
|
||||
style: chatThemeData.channelPreviewTheme.subtitleStyle,
|
||||
style: channelPreviewTheme.subtitleStyle,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,9 +124,7 @@ class _FullScreenMediaState extends State<FullScreenMedia>
|
||||
),
|
||||
backgroundDecoration: BoxDecoration(
|
||||
color: ColorTween(
|
||||
begin: StreamChatTheme.of(context)
|
||||
.channelHeaderTheme
|
||||
.color,
|
||||
begin: ChannelHeaderTheme.of(context).color,
|
||||
end: Colors.black,
|
||||
).lerp(_controller.value),
|
||||
),
|
||||
|
||||
@@ -566,8 +566,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
elevation: 2,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
isScrollControlled: true,
|
||||
backgroundColor:
|
||||
streamChatThemeData.messageInputTheme.inputBackgroundColor,
|
||||
backgroundColor: MessageInputTheme.of(context).inputBackgroundColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
|
||||
@@ -629,7 +629,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
child: Text(
|
||||
context.translations.threadSeparatorText(replyCount),
|
||||
textAlign: TextAlign.center,
|
||||
style: _streamTheme.channelHeaderTheme.subtitleStyle,
|
||||
style: ChannelHeaderTheme.of(context).subtitleStyle,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -122,18 +122,18 @@ class MessageSearchItem extends StatelessWidget {
|
||||
text = parts.join(' ');
|
||||
}
|
||||
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
final channelPreviewTheme = ChannelPreviewTheme.of(context);
|
||||
return Text.rich(
|
||||
_getDisplayText(
|
||||
text!,
|
||||
message.mentionedUsers,
|
||||
message.attachments,
|
||||
chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
|
||||
channelPreviewTheme.subtitleStyle?.copyWith(
|
||||
fontStyle: (message.isSystem || message.isDeleted)
|
||||
? FontStyle.italic
|
||||
: FontStyle.normal,
|
||||
),
|
||||
chatThemeData.channelPreviewTheme.subtitleStyle?.copyWith(
|
||||
channelPreviewTheme.subtitleStyle?.copyWith(
|
||||
fontStyle: (message.isSystem || message.isDeleted)
|
||||
? FontStyle.italic
|
||||
: FontStyle.normal,
|
||||
|
||||
Reference in New Issue
Block a user