price policy

This commit is contained in:
Phuoc Nguyen
2025-11-26 14:44:17 +07:00
parent a07f165f0c
commit 88ac2f2f07
14 changed files with 588 additions and 654 deletions

View File

@@ -120,23 +120,11 @@ class DocumentCard extends StatelessWidget {
document.formattedDateWithPrefix,
style: const TextStyle(fontSize: 13, color: AppColors.grey500),
),
if (document.fileSize != null) ...[
const SizedBox(width: 8),
const Text(
'',
style: TextStyle(fontSize: 13, color: AppColors.grey500),
),
const SizedBox(width: 8),
Text(
document.fileSize!,
style: const TextStyle(fontSize: 13, color: AppColors.grey500),
),
],
],
),
const SizedBox(height: 6),
Text(
document.description,
document.title,
style: const TextStyle(
fontSize: 14,
color: AppColors.grey500,
@@ -150,19 +138,24 @@ class DocumentCard extends StatelessWidget {
}
Widget _buildDownloadButton() {
final isDownloaded = document.filePath != null;
final buttonColor = isDownloaded ? AppColors.success : AppColors.primaryBlue;
final buttonIcon = isDownloaded ? Icons.folder_open : Icons.download;
final buttonText = isDownloaded ? 'Mở file' : 'Tải về';
return ElevatedButton.icon(
onPressed: onDownload,
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryBlue,
backgroundColor: buttonColor,
foregroundColor: AppColors.white,
elevation: 0,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
icon: const Icon(Icons.download, size: 18),
label: const Text(
'Tải về',
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
icon: Icon(buttonIcon, size: 18),
label: Text(
buttonText,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
),
);
}