Skip to content

Commit 920a178

Browse files
authored
chore: update to flutter 3.29.0 (#15)
1 parent 33f91dc commit 920a178

File tree

11 files changed

+1780
-1756
lines changed

11 files changed

+1780
-1756
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [main]
66

77
env:
8-
FLUTTER_VERSION: '3.27.1'
8+
FLUTTER_VERSION: '3.29.0'
99

1010
jobs:
1111
analyze:

assets/NotoColorEmoji.ttf

22.6 MB
Binary file not shown.

lib/chat/chat_room/common/view/chat_room_create_or_edit_avatar.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class ChatRoomCreateOrEditAvatar extends StatelessWidget with WatchItMixin {
7676
right: 0,
7777
child: IconButton.filled(
7878
style: IconButton.styleFrom(
79+
backgroundColor: context.colorScheme.primary,
80+
foregroundColor: Colors.white,
7981
shape: const CircleBorder(),
8082
disabledBackgroundColor: context.colorScheme.surface,
8183
disabledForegroundColor: foreGroundColor,
@@ -101,9 +103,9 @@ class ChatRoomCreateOrEditAvatar extends StatelessWidget with WatchItMixin {
101103
color: foreGroundColor,
102104
),
103105
)
104-
: const Icon(
106+
: Icon(
105107
YaruIcons.pen,
106-
color: Colors.white,
108+
color: contrastColor(context.colorScheme.primary),
107109
),
108110
),
109111
),

lib/chat/events/view/chat_image.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ class ChatImage extends StatelessWidget with WatchItMixin {
5353
padding: EdgeInsets.only(
5454
top: kBigPadding,
5555
bottom: kBigPadding,
56-
right: kMediumPadding,
57-
left: kMediumPadding +
58-
(isUserMessage ? 0 : kAvatarDefaultSize + kBigPadding),
56+
right: kSmallPadding,
57+
left: (isUserMessage ? 0 : kAvatarDefaultSize + kBigPadding),
5958
),
6059
child: Align(
6160
alignment: isUserMessage ? Alignment.centerRight : Alignment.centerLeft,

lib/chat/events/view/chat_message_bubble.dart

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import 'chat_message_reactions.dart';
2020
import 'chat_message_reply_header.dart';
2121
import 'localized_display_event_text.dart';
2222

23-
class ChatMessageBubble extends StatelessWidget with WatchItMixin {
23+
class ChatMessageBubble extends StatelessWidget {
2424
const ChatMessageBubble({
2525
super.key,
2626
required this.event,
@@ -100,14 +100,25 @@ class _ChatMessageBubbleContent extends StatelessWidget {
100100
final ChatMessageBubbleShape messageBubbleShape;
101101
final bool partOfMessageCohort;
102102

103+
String replaceColoredEmojiWithMonochrome(String text) {
104+
final RegExp emojiRegex =
105+
RegExp(r'(\p{Extended_Pictographic})\ufe0f', unicode: true);
106+
107+
return text.replaceAllMapped(emojiRegex, (match) {
108+
final String emoji = match.group(1)!;
109+
return '$emoji\ufe0e';
110+
});
111+
}
112+
103113
@override
104114
Widget build(BuildContext context) {
105115
var html = event.formattedText;
106116
if (event.messageType == MessageTypes.Emote) {
107117
html = '* $html';
108118
}
109119
final textTheme = context.textTheme;
110-
final messageStyle = textTheme.bodyMedium;
120+
final messageStyle =
121+
textTheme.bodyMedium?.copyWith(fontFamilyFallback: ['NotoEmoji']);
111122
final displayEvent = event.getDisplayEvent(timeline);
112123

113124
return Row(
@@ -179,15 +190,19 @@ class _ChatMessageBubbleContent extends StatelessWidget {
179190
)
180191
: event.isRichMessage
181192
? HtmlMessage(
182-
html: html,
193+
html: replaceColoredEmojiWithMonochrome(
194+
html,
195+
),
183196
room: timeline.room,
184197
defaultTextColor:
185198
context.colorScheme.onSurface,
186199
)
187200
: SelectableText.rich(
188201
TextSpan(
189202
style: messageStyle,
190-
text: displayEvent.body,
203+
text: replaceColoredEmojiWithMonochrome(
204+
displayEvent.body,
205+
),
191206
),
192207
style: messageStyle,
193208
),

0 commit comments

Comments
 (0)