Skip to content

Commit 8f4f27f

Browse files
yash-agarwa-lgnprice
authored andcommitted
action_sheet: Use directional border radius for reaction buttons
Previously, the reaction buttons in the message action sheet used hardcoded physical border radii. In RTL locales, this caused the rounded corners to appear on the inner edges of the button row instead of the outer edges. We now use `BorderRadiusDirectional` and resolve it against the context's text direction to ensure the correct corners are rounded regardless of layout direction.
1 parent fa947a1 commit 8f4f27f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/widgets/action_sheet.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,8 @@ class ReactionButtons extends StatelessWidget {
12331233
onTap: () => _handleTapReaction(emoji: emoji, isSelfVoted: isSelfVoted),
12341234
splashFactory: NoSplash.splashFactory,
12351235
borderRadius: isFirst
1236-
? const BorderRadius.only(topLeft: Radius.circular(7))
1236+
? const BorderRadiusDirectional.only(topStart: Radius.circular(7))
1237+
.resolve(Directionality.of(context))
12371238
: null,
12381239
overlayColor: WidgetStateColor.resolveWith((states) =>
12391240
states.any((e) => e == WidgetState.pressed)
@@ -1253,6 +1254,7 @@ class ReactionButtons extends StatelessWidget {
12531254

12541255
@override
12551256
Widget build(BuildContext context) {
1257+
final textDirection = Directionality.of(context);
12561258
final store = PerAccountStoreWidget.of(pageContext);
12571259
final popularEmojiCandidates = store.popularEmojiCandidates();
12581260
assert(popularEmojiCandidates.every(
@@ -1289,7 +1291,8 @@ class ReactionButtons extends StatelessWidget {
12891291
InkWell(
12901292
onTap: _handleTapMore,
12911293
splashFactory: NoSplash.splashFactory,
1292-
borderRadius: const BorderRadius.only(topRight: Radius.circular(7)),
1294+
borderRadius: const BorderRadiusDirectional.only(
1295+
topEnd: Radius.circular(7)).resolve(textDirection),
12931296
overlayColor: WidgetStateColor.resolveWith((states) =>
12941297
states.any((e) => e == WidgetState.pressed)
12951298
? designVariables.contextMenuItemBg.withFadedAlpha(0.20)

0 commit comments

Comments
 (0)