refactor: wrap chat bubble content in IntrinsicWidth to prevent unnecessary stretching for short messages
This commit is contained in:
@@ -480,8 +480,12 @@ class _SupportChatScreenState extends ConsumerState<SupportChatScreen> {
|
|||||||
color: AppColors.primaryDark.withValues(alpha: 0.1),
|
color: AppColors.primaryDark.withValues(alpha: 0.1),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// IntrinsicWidth shrinks the bubble to the widest child (content or
|
||||||
|
// time), so short messages like "hi" don't stretch to maxWidth.
|
||||||
|
child: IntrinsicWidth(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (!isOwn)
|
if (!isOwn)
|
||||||
const Padding(
|
const Padding(
|
||||||
@@ -522,6 +526,7 @@ class _SupportChatScreenState extends ConsumerState<SupportChatScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user