From 3b1880e04673f495f645fc27381ac42cf05c26eb Mon Sep 17 00:00:00 2001 From: yash Date: Wed, 26 Nov 2025 00:18:14 +0530 Subject: [PATCH] content: Use directional layout for message media Previously, these previews (for images and video) were hardcoded to align to the left, with padding on the right. This resulted in an incorrect layout in RTL locales. We now use directional positioning so that the alignment and padding flip correctly based on the text direction. --- lib/widgets/content.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/content.dart b/lib/widgets/content.dart index 85a573cdcb..b4f1f92562 100644 --- a/lib/widgets/content.dart +++ b/lib/widgets/content.dart @@ -741,11 +741,11 @@ class MessageMediaContainer extends StatelessWidget { return GestureDetector( onTap: onTap, child: UnconstrainedBox( - alignment: Alignment.centerLeft, + alignment: AlignmentDirectional.centerStart, child: Padding( // TODO clean up this padding by imitating web less precisely; // in particular, avoid adding loose whitespace at end of message. - padding: const EdgeInsets.only(right: 5, bottom: 5), + padding: const EdgeInsetsDirectional.only(end: 5, bottom: 5), child: ColoredBox( color: ContentTheme.of(context).colorMessageMediaContainerBackground, child: Padding(