From f924d894ddeade5fd71fdd4cd8699d405591da26 Mon Sep 17 00:00:00 2001 From: cogwheel0 <172976095+cogwheel0@users.noreply.github.com> Date: Sun, 5 Oct 2025 00:33:42 +0530 Subject: [PATCH] refactor: update styling and spacing in file attachment and profile components - Adjusted dimensions and padding in the file attachment widget for improved layout consistency and visual appeal. - Updated text styles to enhance readability and align with the overall theme. - Refined spacing values in the profile page to create a more cohesive design. - Streamlined widget structures by modifying border radius and background colors for better aesthetics. - Enhanced the user interface by ensuring consistent styling across various components. --- .../chat/widgets/file_attachment_widget.dart | 42 +++++------ lib/features/profile/views/profile_page.dart | 69 +++++-------------- 2 files changed, 37 insertions(+), 74 deletions(-) diff --git a/lib/features/chat/widgets/file_attachment_widget.dart b/lib/features/chat/widgets/file_attachment_widget.dart index ce568dd..526e967 100644 --- a/lib/features/chat/widgets/file_attachment_widget.dart +++ b/lib/features/chat/widgets/file_attachment_widget.dart @@ -48,7 +48,7 @@ class FileAttachmentWidget extends ConsumerWidget { ), ], ), - ).animate().fadeIn(duration: const Duration(milliseconds: 300)); + ); } } @@ -60,14 +60,14 @@ class _FileAttachmentCard extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Container( - width: 160, - padding: const EdgeInsets.all(Spacing.md), + width: 140, + padding: const EdgeInsets.all(Spacing.sm), decoration: BoxDecoration( color: context.conduitTheme.cardBackground, - borderRadius: BorderRadius.circular(AppBorderRadius.md), + borderRadius: BorderRadius.circular(AppBorderRadius.small), border: Border.all( color: _getBorderColor(fileState.status, context), - width: BorderWidth.regular, + width: BorderWidth.standard, ), ), child: Column( @@ -77,18 +77,18 @@ class _FileAttachmentCard extends ConsumerWidget { children: [ Text( fileState.fileIcon, - style: const TextStyle(fontSize: AppTypography.headlineLarge), + style: const TextStyle(fontSize: 20), ), const Spacer(), _buildStatusIcon(context), ], ), - const SizedBox(height: Spacing.sm), + const SizedBox(height: Spacing.xs), Text( fileState.fileName, style: TextStyle( color: context.conduitTheme.textPrimary, - fontSize: AppTypography.labelLarge, + fontSize: AppTypography.labelMedium, fontWeight: FontWeight.w500, ), maxLines: 1, @@ -99,11 +99,11 @@ class _FileAttachmentCard extends ConsumerWidget { fileState.formattedSize, style: TextStyle( color: context.conduitTheme.textSecondary.withValues(alpha: 0.6), - fontSize: AppTypography.labelMedium, + fontSize: AppTypography.labelSmall, ), ), if (fileState.status == FileUploadStatus.uploading) ...[ - const SizedBox(height: Spacing.sm), + const SizedBox(height: Spacing.xs), _buildProgressBar(context), ], if (fileState.error != null) ...[ @@ -112,7 +112,7 @@ class _FileAttachmentCard extends ConsumerWidget { 'Failed to upload', style: TextStyle( color: context.conduitTheme.error, - fontSize: AppTypography.labelMedium, + fontSize: AppTypography.labelSmall, ), ), ], @@ -201,25 +201,25 @@ class MessageAttachmentPreview extends StatelessWidget { return Container( margin: const EdgeInsets.only(top: Spacing.sm), child: Wrap( - spacing: 8, - runSpacing: 8, + spacing: Spacing.xs, + runSpacing: Spacing.xs, children: fileIds .map( (fileId) => Container( padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 6, + horizontal: Spacing.sm, + vertical: Spacing.xs, ), decoration: BoxDecoration( color: context.conduitTheme.textPrimary.withValues( - alpha: 0.1, + alpha: 0.08, ), - borderRadius: BorderRadius.circular(AppBorderRadius.sm), + borderRadius: BorderRadius.circular(AppBorderRadius.small), border: Border.all( color: context.conduitTheme.textPrimary.withValues( - alpha: 0.2, + alpha: 0.15, ), - width: BorderWidth.regular, + width: BorderWidth.thin, ), ), child: Row( @@ -227,7 +227,7 @@ class MessageAttachmentPreview extends StatelessWidget { children: [ const Text( '📎', - style: TextStyle(fontSize: AppTypography.bodyLarge), + style: TextStyle(fontSize: 14), ), const SizedBox(width: Spacing.xs), Text( @@ -236,7 +236,7 @@ class MessageAttachmentPreview extends StatelessWidget { color: context.conduitTheme.textPrimary.withValues( alpha: 0.8, ), - fontSize: AppTypography.labelLarge, + fontSize: AppTypography.labelSmall, ), ), ], diff --git a/lib/features/profile/views/profile_page.dart b/lib/features/profile/views/profile_page.dart index a8acfc1..93f9f41 100644 --- a/lib/features/profile/views/profile_page.dart +++ b/lib/features/profile/views/profile_page.dart @@ -1140,39 +1140,27 @@ class _DefaultModelBottomSheetState return PressableScale( onTap: onTap, - borderRadius: BorderRadius.circular(AppBorderRadius.md), + borderRadius: BorderRadius.circular(AppBorderRadius.small), child: Container( - margin: const EdgeInsets.only(bottom: Spacing.md), + margin: const EdgeInsets.only(bottom: Spacing.sm), decoration: BoxDecoration( - gradient: isSelected - ? LinearGradient( - colors: [ - context.conduitTheme.buttonPrimary.withValues(alpha: 0.2), - context.conduitTheme.buttonPrimary.withValues(alpha: 0.1), - ], - ) - : null, color: isSelected - ? null + ? context.conduitTheme.buttonPrimary.withValues(alpha: 0.1) : context.conduitTheme.surfaceBackground.withValues(alpha: 0.05), - borderRadius: BorderRadius.circular(AppBorderRadius.md), + borderRadius: BorderRadius.circular(AppBorderRadius.small), border: Border.all( color: isSelected - ? context.conduitTheme.buttonPrimary.withValues(alpha: 0.5) - : context.conduitTheme.dividerColor, - width: BorderWidth.regular, + ? context.conduitTheme.buttonPrimary.withValues(alpha: 0.3) + : context.conduitTheme.dividerColor.withValues(alpha: 0.5), + width: BorderWidth.standard, ), - boxShadow: isSelected ? ConduitShadows.card(context) : null, ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: Spacing.md, - vertical: Spacing.sm, - ), + padding: const EdgeInsets.all(Spacing.sm), child: Row( children: [ leading, - const SizedBox(width: Spacing.md), + const SizedBox(width: Spacing.sm), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1199,7 +1187,7 @@ class _DefaultModelBottomSheetState fontWeight: FontWeight.w400, ), ), - ] else ...[ + ] else if (model.isMultimodal || _modelSupportsReasoning(model)) ...[ const SizedBox(height: Spacing.xs), Row( children: [ @@ -1223,38 +1211,13 @@ class _DefaultModelBottomSheetState ], ), ), - const SizedBox(width: Spacing.md), - AnimatedOpacity( - opacity: isSelected ? 1 : 0.6, - duration: AnimationDuration.fast, - child: Container( - padding: const EdgeInsets.all(Spacing.xxs), - decoration: BoxDecoration( - color: isSelected - ? context.conduitTheme.buttonPrimary - : context.conduitTheme.surfaceBackground, - borderRadius: BorderRadius.circular(AppBorderRadius.md), - border: Border.all( - color: isSelected - ? context.conduitTheme.buttonPrimary.withValues( - alpha: 0.6, - ) - : context.conduitTheme.dividerColor, - ), - ), - child: Icon( - isSelected - ? (Platform.isIOS - ? CupertinoIcons.check_mark - : Icons.check) - : (Platform.isIOS ? CupertinoIcons.add : Icons.add), - color: isSelected - ? context.conduitTheme.textInverse - : context.conduitTheme.iconSecondary, - size: 14, - ), + const SizedBox(width: Spacing.sm), + if (isSelected) + Icon( + Platform.isIOS ? CupertinoIcons.check_mark : Icons.check, + color: context.conduitTheme.buttonPrimary, + size: IconSize.small, ), - ), ], ), ),