Skip to content

Commit 5421518

Browse files
committed
emoji [nfc]: Move some vertical padding outward
As Greg suggested: #442 (comment) We drop a comment about giving 1px vertical padding on the label when it's taller than the emoji (e.g., because the label needs multiple lines). We still give that padding, and that's a difference from the web app -- and so arguably worth noting in the code -- but it's a small point, and clearly an improvement, so it's probably OK to drop the comment and let the reader use their attention on more important things.
1 parent 73281dd commit 5421518

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/widgets/emoji_reaction.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class ReactionChip extends StatelessWidget {
138138
child: Padding(
139139
// 1px of this padding accounts for the border, which Flutter
140140
// just paints without changing size.
141-
padding: const EdgeInsetsDirectional.fromSTEB(4, 2, 5, 2),
141+
padding: const EdgeInsetsDirectional.fromSTEB(4, 3, 5, 3),
142142
child: LayoutBuilder(
143143
builder: (context, constraints) {
144144
final maxRowWidth = constraints.maxWidth;
@@ -160,14 +160,11 @@ class ReactionChip extends StatelessWidget {
160160
children: [
161161
// So text-emoji chips are at least as tall as square-emoji
162162
// ones (probably a good thing).
163-
// 2 is for the `vertical: 1` padding around `emoji`.
164-
SizedBox(height: _squareEmojiScalerClamped(context).scale(_squareEmojiSize) + 2),
163+
SizedBox(height: _squareEmojiScalerClamped(context).scale(_squareEmojiSize)),
165164
Flexible( // [Flexible] to let text emojis expand if they can
166-
child: Padding(padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 1),
165+
child: Padding(padding: const EdgeInsets.symmetric(horizontal: 3),
167166
child: emoji)),
168-
// Added vertical: 1 to give some space when the label is
169-
// taller than the emoji (e.g. because it needs multiple lines)
170-
Padding(padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 1),
167+
Padding(padding: const EdgeInsets.symmetric(horizontal: 3),
171168
child: Container(
172169
constraints: BoxConstraints(maxWidth: maxLabelWidth),
173170
child: Text(

0 commit comments

Comments
 (0)