update theme

This commit is contained in:
Phuoc Nguyen
2025-12-02 15:20:54 +07:00
parent 12bd70479c
commit 49a41d24eb
78 changed files with 3263 additions and 2756 deletions

View File

@@ -16,11 +16,13 @@ class DocumentCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Container(
decoration: BoxDecoration(
color: AppColors.white,
color: colorScheme.surface,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColors.grey100),
border: Border.all(color: colorScheme.surfaceContainerHighest),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
@@ -47,15 +49,15 @@ class DocumentCard extends StatelessWidget {
children: [
Row(
children: [
_buildIcon(),
_buildIcon(colorScheme),
const SizedBox(width: AppSpacing.md),
Expanded(child: _buildInfo()),
Expanded(child: _buildInfo(colorScheme)),
],
),
const SizedBox(height: AppSpacing.md),
SizedBox(
width: double.infinity,
child: _buildDownloadButton(),
child: _buildDownloadButton(colorScheme),
),
],
);
@@ -63,11 +65,11 @@ class DocumentCard extends StatelessWidget {
return Row(
children: [
_buildIcon(),
_buildIcon(colorScheme),
const SizedBox(width: AppSpacing.md),
Expanded(child: _buildInfo()),
Expanded(child: _buildInfo(colorScheme)),
const SizedBox(width: AppSpacing.md),
_buildDownloadButton(),
_buildDownloadButton(colorScheme),
],
);
},
@@ -78,7 +80,7 @@ class DocumentCard extends StatelessWidget {
);
}
Widget _buildIcon() {
Widget _buildIcon(ColorScheme colorScheme) {
final iconData = document.isPdf ? Icons.picture_as_pdf : Icons.table_chart;
final iconColor = document.isPdf
? Colors.red.shade600
@@ -88,46 +90,46 @@ class DocumentCard extends StatelessWidget {
width: 50,
height: 50,
decoration: BoxDecoration(
color: AppColors.grey50,
color: colorScheme.surfaceContainerLowest,
borderRadius: BorderRadius.circular(8),
),
child: Icon(iconData, size: 28, color: iconColor),
);
}
Widget _buildInfo() {
Widget _buildInfo(ColorScheme colorScheme) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
document.title,
style: const TextStyle(
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.grey900,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 4),
Row(
children: [
const Icon(
Icon(
Icons.calendar_today,
size: 13,
color: AppColors.grey500,
color: colorScheme.onSurfaceVariant,
),
const SizedBox(width: 4),
Text(
document.formattedDateWithPrefix,
style: const TextStyle(fontSize: 13, color: AppColors.grey500),
style: TextStyle(fontSize: 13, color: colorScheme.onSurfaceVariant),
),
],
),
const SizedBox(height: 6),
Text(
document.title,
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: AppColors.grey500,
color: colorScheme.onSurfaceVariant,
height: 1.4,
),
maxLines: 2,
@@ -137,9 +139,9 @@ class DocumentCard extends StatelessWidget {
);
}
Widget _buildDownloadButton() {
Widget _buildDownloadButton(ColorScheme colorScheme) {
final isDownloaded = document.filePath != null;
final buttonColor = isDownloaded ? AppColors.success : AppColors.primaryBlue;
final buttonColor = isDownloaded ? AppColors.success : colorScheme.primary;
final buttonIcon = isDownloaded ? Icons.folder_open : Icons.download;
final buttonText = isDownloaded ? 'Mở file' : 'Tải về';