refactor: enhance scroll-to-bottom button functionality and improve chat input layout

This commit is contained in:
cogwheel0
2025-08-25 16:16:58 +05:30
parent f934c59d19
commit 0a09372c4a
3 changed files with 110 additions and 43 deletions

View File

@@ -274,7 +274,12 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
children: [
// Collapsed/Expanded top row: text input with left/right buttons in collapsed
Padding(
padding: const EdgeInsets.all(Spacing.inputPadding),
padding: const EdgeInsets.only(
left: Spacing.inputPadding,
right: Spacing.inputPadding,
top: Spacing.inputPadding,
bottom: Spacing.inputPadding,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@@ -288,9 +293,15 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
context,
)!.addAttachment,
showBackground: false,
iconSize: IconSize.large,
iconSize: IconSize.large + 2.0,
),
const SizedBox(width: Spacing.xs),
] else ...[
// When expanded, the left padding was reduced to move the plus button.
// Add back spacing so the text field aligns comfortably from the edge.
SizedBox(
width: Spacing.inputPadding - Spacing.xs,
),
],
// Text input expands to fill
Expanded(
@@ -398,7 +409,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
context,
)!.addAttachment,
showBackground: false,
iconSize: IconSize.large,
iconSize: IconSize.large + 2.0,
),
const SizedBox(width: Spacing.xs),
// Quick pills: no scroll, clip text within fixed max width