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.
This commit is contained in:
cogwheel0
2025-10-05 00:33:42 +05:30
parent 8cb55edab6
commit f924d894dd
2 changed files with 37 additions and 74 deletions

View File

@@ -48,7 +48,7 @@ class FileAttachmentWidget extends ConsumerWidget {
), ),
], ],
), ),
).animate().fadeIn(duration: const Duration(milliseconds: 300)); );
} }
} }
@@ -60,14 +60,14 @@ class _FileAttachmentCard extends ConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container( return Container(
width: 160, width: 140,
padding: const EdgeInsets.all(Spacing.md), padding: const EdgeInsets.all(Spacing.sm),
decoration: BoxDecoration( decoration: BoxDecoration(
color: context.conduitTheme.cardBackground, color: context.conduitTheme.cardBackground,
borderRadius: BorderRadius.circular(AppBorderRadius.md), borderRadius: BorderRadius.circular(AppBorderRadius.small),
border: Border.all( border: Border.all(
color: _getBorderColor(fileState.status, context), color: _getBorderColor(fileState.status, context),
width: BorderWidth.regular, width: BorderWidth.standard,
), ),
), ),
child: Column( child: Column(
@@ -77,18 +77,18 @@ class _FileAttachmentCard extends ConsumerWidget {
children: [ children: [
Text( Text(
fileState.fileIcon, fileState.fileIcon,
style: const TextStyle(fontSize: AppTypography.headlineLarge), style: const TextStyle(fontSize: 20),
), ),
const Spacer(), const Spacer(),
_buildStatusIcon(context), _buildStatusIcon(context),
], ],
), ),
const SizedBox(height: Spacing.sm), const SizedBox(height: Spacing.xs),
Text( Text(
fileState.fileName, fileState.fileName,
style: TextStyle( style: TextStyle(
color: context.conduitTheme.textPrimary, color: context.conduitTheme.textPrimary,
fontSize: AppTypography.labelLarge, fontSize: AppTypography.labelMedium,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
maxLines: 1, maxLines: 1,
@@ -99,11 +99,11 @@ class _FileAttachmentCard extends ConsumerWidget {
fileState.formattedSize, fileState.formattedSize,
style: TextStyle( style: TextStyle(
color: context.conduitTheme.textSecondary.withValues(alpha: 0.6), color: context.conduitTheme.textSecondary.withValues(alpha: 0.6),
fontSize: AppTypography.labelMedium, fontSize: AppTypography.labelSmall,
), ),
), ),
if (fileState.status == FileUploadStatus.uploading) ...[ if (fileState.status == FileUploadStatus.uploading) ...[
const SizedBox(height: Spacing.sm), const SizedBox(height: Spacing.xs),
_buildProgressBar(context), _buildProgressBar(context),
], ],
if (fileState.error != null) ...[ if (fileState.error != null) ...[
@@ -112,7 +112,7 @@ class _FileAttachmentCard extends ConsumerWidget {
'Failed to upload', 'Failed to upload',
style: TextStyle( style: TextStyle(
color: context.conduitTheme.error, color: context.conduitTheme.error,
fontSize: AppTypography.labelMedium, fontSize: AppTypography.labelSmall,
), ),
), ),
], ],
@@ -201,25 +201,25 @@ class MessageAttachmentPreview extends StatelessWidget {
return Container( return Container(
margin: const EdgeInsets.only(top: Spacing.sm), margin: const EdgeInsets.only(top: Spacing.sm),
child: Wrap( child: Wrap(
spacing: 8, spacing: Spacing.xs,
runSpacing: 8, runSpacing: Spacing.xs,
children: fileIds children: fileIds
.map( .map(
(fileId) => Container( (fileId) => Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 12, horizontal: Spacing.sm,
vertical: 6, vertical: Spacing.xs,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: context.conduitTheme.textPrimary.withValues( color: context.conduitTheme.textPrimary.withValues(
alpha: 0.1, alpha: 0.08,
), ),
borderRadius: BorderRadius.circular(AppBorderRadius.sm), borderRadius: BorderRadius.circular(AppBorderRadius.small),
border: Border.all( border: Border.all(
color: context.conduitTheme.textPrimary.withValues( color: context.conduitTheme.textPrimary.withValues(
alpha: 0.2, alpha: 0.15,
), ),
width: BorderWidth.regular, width: BorderWidth.thin,
), ),
), ),
child: Row( child: Row(
@@ -227,7 +227,7 @@ class MessageAttachmentPreview extends StatelessWidget {
children: [ children: [
const Text( const Text(
'📎', '📎',
style: TextStyle(fontSize: AppTypography.bodyLarge), style: TextStyle(fontSize: 14),
), ),
const SizedBox(width: Spacing.xs), const SizedBox(width: Spacing.xs),
Text( Text(
@@ -236,7 +236,7 @@ class MessageAttachmentPreview extends StatelessWidget {
color: context.conduitTheme.textPrimary.withValues( color: context.conduitTheme.textPrimary.withValues(
alpha: 0.8, alpha: 0.8,
), ),
fontSize: AppTypography.labelLarge, fontSize: AppTypography.labelSmall,
), ),
), ),
], ],

View File

@@ -1140,39 +1140,27 @@ class _DefaultModelBottomSheetState
return PressableScale( return PressableScale(
onTap: onTap, onTap: onTap,
borderRadius: BorderRadius.circular(AppBorderRadius.md), borderRadius: BorderRadius.circular(AppBorderRadius.small),
child: Container( child: Container(
margin: const EdgeInsets.only(bottom: Spacing.md), margin: const EdgeInsets.only(bottom: Spacing.sm),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: isSelected
? LinearGradient(
colors: [
context.conduitTheme.buttonPrimary.withValues(alpha: 0.2),
context.conduitTheme.buttonPrimary.withValues(alpha: 0.1),
],
)
: null,
color: isSelected color: isSelected
? null ? context.conduitTheme.buttonPrimary.withValues(alpha: 0.1)
: context.conduitTheme.surfaceBackground.withValues(alpha: 0.05), : context.conduitTheme.surfaceBackground.withValues(alpha: 0.05),
borderRadius: BorderRadius.circular(AppBorderRadius.md), borderRadius: BorderRadius.circular(AppBorderRadius.small),
border: Border.all( border: Border.all(
color: isSelected color: isSelected
? context.conduitTheme.buttonPrimary.withValues(alpha: 0.5) ? context.conduitTheme.buttonPrimary.withValues(alpha: 0.3)
: context.conduitTheme.dividerColor, : context.conduitTheme.dividerColor.withValues(alpha: 0.5),
width: BorderWidth.regular, width: BorderWidth.standard,
), ),
boxShadow: isSelected ? ConduitShadows.card(context) : null,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(Spacing.sm),
horizontal: Spacing.md,
vertical: Spacing.sm,
),
child: Row( child: Row(
children: [ children: [
leading, leading,
const SizedBox(width: Spacing.md), const SizedBox(width: Spacing.sm),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -1199,7 +1187,7 @@ class _DefaultModelBottomSheetState
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
] else ...[ ] else if (model.isMultimodal || _modelSupportsReasoning(model)) ...[
const SizedBox(height: Spacing.xs), const SizedBox(height: Spacing.xs),
Row( Row(
children: [ children: [
@@ -1223,38 +1211,13 @@ class _DefaultModelBottomSheetState
], ],
), ),
), ),
const SizedBox(width: Spacing.md), const SizedBox(width: Spacing.sm),
AnimatedOpacity( if (isSelected)
opacity: isSelected ? 1 : 0.6, Icon(
duration: AnimationDuration.fast, Platform.isIOS ? CupertinoIcons.check_mark : Icons.check,
child: Container( color: context.conduitTheme.buttonPrimary,
padding: const EdgeInsets.all(Spacing.xxs), size: IconSize.small,
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,
),
), ),
),
], ],
), ),
), ),