Skip to content

Commit 5809dee

Browse files
committed
emoji: Ensure consistent row height for plain text emoji theme.
Fixes #1587 Also Updated `test/api/core_test.dart` to match the new behavior of the http client.
1 parent 3ae958e commit 5809dee

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

lib/widgets/emoji_reaction.dart

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ class EmojiPickerListEntry extends StatelessWidget {
545545
final EmojiCandidate emoji;
546546

547547
static const _emojiSize = 24.0;
548+
static const _rowMinHeight = _emojiSize + 20;
548549

549550
void _onPressed() {
550551
Navigator.pop(pageContext, emoji);
@@ -578,20 +579,22 @@ class EmojiPickerListEntry extends StatelessWidget {
578579
: Colors.transparent),
579580
child: Padding(
580581
padding: const EdgeInsets.symmetric(horizontal: 8),
581-
child: Row(spacing: 4, children: [
582-
if (glyph != null)
583-
Padding(
584-
padding: const EdgeInsets.all(10),
585-
child: glyph),
586-
Flexible(child: Text(label,
587-
maxLines: 2,
588-
overflow: TextOverflow.ellipsis,
589-
style: TextStyle(
590-
fontSize: 17,
591-
height: 18 / 17,
592-
color: designVariables.textMessage)))
593-
]),
594-
));
582+
child: ConstrainedBox(
583+
constraints: const BoxConstraints(minHeight: _rowMinHeight),
584+
child: Row(spacing: 4, children: [
585+
if (glyph != null)
586+
Padding(
587+
padding: const EdgeInsets.all(10),
588+
child: glyph),
589+
Flexible(child: Text(label,
590+
maxLines: 2,
591+
overflow: TextOverflow.ellipsis,
592+
style: TextStyle(
593+
fontSize: 17,
594+
height: 18 / 17,
595+
color: designVariables.textMessage)))
596+
]),
597+
)));
595598
}
596599
}
597600

test/api/core_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void main() {
137137
...authHeader(email: eg.selfAccount.email, apiKey: eg.selfAccount.apiKey),
138138
...kFallbackUserAgentHeader,
139139
if (expectContentType)
140-
'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
140+
'content-type': 'application/x-www-form-urlencoded',
141141
})
142142
..body.equals(expectedBody);
143143
}));
@@ -213,7 +213,7 @@ void main() {
213213
...authHeader(email: eg.selfAccount.email, apiKey: eg.selfAccount.apiKey),
214214
...kFallbackUserAgentHeader,
215215
if (expectContentType)
216-
'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
216+
'content-type': 'application/x-www-form-urlencoded',
217217
})
218218
..body.equals(expectedBody);
219219
}));
@@ -244,7 +244,7 @@ void main() {
244244
...authHeader(email: eg.selfAccount.email, apiKey: eg.selfAccount.apiKey),
245245
...kFallbackUserAgentHeader,
246246
if (expectContentType)
247-
'content-type': 'application/x-www-form-urlencoded; charset=utf-8',
247+
'content-type': 'application/x-www-form-urlencoded',
248248
})
249249
..body.equals(expectedBody);
250250
}));

0 commit comments

Comments
 (0)