@@ -287,13 +287,13 @@ class _EmojiAutocompleteItem extends StatelessWidget {
287
287
288
288
final EmojiAutocompleteResult option;
289
289
290
- // TODO adjust sizes to match _MentionAutocompleteItem avatar
291
- static const _size = 32.0 ;
292
- static const _notoColorEmojiTextSize = 25.7 ;
290
+ static const _size = 24.0 ;
291
+ static const _notoColorEmojiTextSize = 19.3 ;
293
292
294
293
@override
295
294
Widget build (BuildContext context) {
296
295
final store = PerAccountStoreWidget .of (context);
296
+ final designVariables = DesignVariables .of (context);
297
297
final candidate = option.candidate;
298
298
299
299
final emojiDisplay = candidate.emojiDisplay.resolve (store.userSettings);
@@ -311,16 +311,31 @@ class _EmojiAutocompleteItem extends StatelessWidget {
311
311
? candidate.emojiName
312
312
: [candidate.emojiName, ...candidate.aliases].join (", " ); // TODO(#1080)
313
313
314
+ // TODO(design): emoji autocomplete results
315
+ // There's no design in Figma for emoji autocomplete results.
316
+ // Instead we adapt the design for the emoji picker to the
317
+ // context of autocomplete results as exemplified by _MentionAutocompleteItem.
318
+ // That means: emoji size, text size, text line-height from emoji picker;
319
+ // text color (for contrast with background) and outer padding
320
+ // from _MentionAutocompleteItem; padding around emoji glyph
321
+ // to bring it to same size as avatar in _MentionAutocompleteItem.
314
322
return Padding (
315
323
padding: const EdgeInsetsDirectional .fromSTEB (4 , 4 , 8 , 4 ),
316
324
child: Row (children: [
317
325
if (glyph != null ) ...[
318
- glyph,
326
+ Padding (padding: const EdgeInsets .all (6 ),
327
+ child: glyph),
319
328
const SizedBox (width: 6 ),
320
329
],
321
- // TODO adjust text style to match _MentionAutocompleteItem
322
330
Expanded (
323
331
child: Text (
332
+ // The Figma design for the emoji picker actually calls for the
333
+ // line-height to be 24px when the label fits on one line,
334
+ // and 18px when it wraps. But whether it'll wrap is something we
335
+ // don't know at build time, so make it always 18px. Discussion:
336
+ // https://github.com/zulip/zulip-flutter/pull/995#discussion_r1868352275
337
+ style: TextStyle (fontSize: 17 , height: 18 / 17 ,
338
+ color: designVariables.contextMenuItemLabel),
324
339
maxLines: 2 ,
325
340
overflow: TextOverflow .ellipsis,
326
341
label)),
0 commit comments