Skip to content

Commit ab8f667

Browse files
committed
emoji: Use directional alignment for Unicode emoji on iOS
On iOS and macOS, use AlignmentDirectional.centerStart instead of Alignment.centerLeft for the Stack containing Unicode emoji. Fixes the issue described here: #1991 (comment)
1 parent 5691ed1 commit ab8f667

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/widgets/emoji.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ class UnicodeEmojiWidget extends StatelessWidget {
159159
// visible part. Key points that enable the [Stack] workaround:
160160
// - The emoji seems approximately vertically centered (this is
161161
// accomplished with help from a [StrutStyle]; see below).
162-
// - There seems to be approximately no space on its left.
162+
// - There seems to be approximately no space at its start edge.
163163
final boxSize = textScaler.scale(size);
164-
return Stack(alignment: Alignment.centerLeft, clipBehavior: Clip.none, children: [
164+
return Stack(alignment: AlignmentDirectional.centerStart, clipBehavior: Clip.none, children: [
165165
SizedBox(height: boxSize, width: boxSize),
166166
PositionedDirectional(start: 0, child: Text(
167167
textScaler: textScaler,

0 commit comments

Comments
 (0)