Skip to content

Commit e0d2988

Browse files
committed
autocomplete: Update emoji-results style to follow design
This follows the new design for user-mention results, but adapted for emoji based on the design for the emoji picker. See comment for details.
1 parent a31cb4a commit e0d2988

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/widgets/autocomplete.dart

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,13 @@ class _EmojiAutocompleteItem extends StatelessWidget {
289289

290290
final EmojiAutocompleteResult option;
291291

292-
static const _size = 32.0;
293-
static const _notoColorEmojiTextSize = 25.7;
292+
static const _size = 24.0;
293+
static const _notoColorEmojiTextSize = 19.3;
294294

295295
@override
296296
Widget build(BuildContext context) {
297297
final store = PerAccountStoreWidget.of(context);
298+
final designVariables = DesignVariables.of(context);
298299
final candidate = option.candidate;
299300

300301
// TODO deduplicate this logic with [EmojiPickerListEntry]
@@ -313,15 +314,26 @@ class _EmojiAutocompleteItem extends StatelessWidget {
313314
? candidate.emojiName
314315
: [candidate.emojiName, ...candidate.aliases].join(", "); // TODO(#1080)
315316

317+
// TODO(design): emoji autocomplete results
318+
// There's no design in Figma for emoji autocomplete results.
319+
// Instead we adapt the design for the emoji picker to the
320+
// context of autocomplete results as exemplified by _MentionAutocompleteItem.
321+
// That means: emoji size, text size, text line-height, and font weight
322+
// from emoji picker; text color (for contrast with background) and
323+
// outer padding from _MentionAutocompleteItem; padding around emoji glyph
324+
// to bring it to same size as avatar in _MentionAutocompleteItem.
316325
return Padding(
317326
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
318327
child: Row(children: [
319328
if (glyph != null) ...[
320-
glyph,
321-
const SizedBox(width: 8),
329+
Padding(padding: const EdgeInsets.all(6),
330+
child: glyph),
331+
const SizedBox(width: 6),
322332
],
323333
Expanded(
324334
child: Text(
335+
style: TextStyle(fontSize: 17, height: 18 / 17,
336+
color: designVariables.contextMenuItemLabel),
325337
maxLines: 2,
326338
overflow: TextOverflow.ellipsis,
327339
label)),

0 commit comments

Comments
 (0)