update theme
This commit is contained in:
@@ -38,24 +38,26 @@ class _PricePolicyPageState extends ConsumerState<PricePolicyPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.grey50,
|
||||
backgroundColor: colorScheme.surfaceContainerLowest,
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
icon: Icon(Icons.arrow_back, color: colorScheme.onSurface),
|
||||
onPressed: () => context.pop(),
|
||||
),
|
||||
title: const Text(
|
||||
title: Text(
|
||||
'Chính sách giá',
|
||||
style: TextStyle(color: Colors.black),
|
||||
style: TextStyle(color: colorScheme.onSurface),
|
||||
),
|
||||
elevation: AppBarSpecs.elevation,
|
||||
backgroundColor: AppColors.white,
|
||||
foregroundColor: AppColors.grey900,
|
||||
backgroundColor: colorScheme.surface,
|
||||
foregroundColor: colorScheme.onSurface,
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.info_outline, color: Colors.black),
|
||||
icon: Icon(Icons.info_outline, color: colorScheme.onSurface),
|
||||
onPressed: _showInfoDialog,
|
||||
),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
@@ -69,16 +71,16 @@ class _PricePolicyPageState extends ConsumerState<PricePolicyPage>
|
||||
child: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.grey100,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: AppColors.white,
|
||||
unselectedLabelColor: AppColors.grey900,
|
||||
labelColor: colorScheme.surface,
|
||||
unselectedLabelColor: colorScheme.onSurface,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicator: BoxDecoration(
|
||||
color: AppColors.primaryBlue,
|
||||
color: colorScheme.primary,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
dividerColor: Colors.transparent,
|
||||
@@ -115,24 +117,25 @@ class _PricePolicyPageState extends ConsumerState<PricePolicyPage>
|
||||
}
|
||||
|
||||
Widget _buildDocumentList(DocumentCategory category) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final documentsAsync = ref.watch(filteredPriceDocumentsProvider(category));
|
||||
|
||||
return documentsAsync.when(
|
||||
data: (documents) {
|
||||
if (documents.isEmpty) {
|
||||
return const Center(
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.description_outlined,
|
||||
size: 64,
|
||||
color: AppColors.grey500,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
SizedBox(height: AppSpacing.md),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
Text(
|
||||
'Chưa có tài liệu',
|
||||
style: TextStyle(fontSize: 16, color: AppColors.grey500),
|
||||
style: TextStyle(fontSize: 16, color: colorScheme.onSurfaceVariant),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -166,11 +169,11 @@ class _PricePolicyPageState extends ConsumerState<PricePolicyPage>
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.error_outline, size: 64, color: AppColors.danger),
|
||||
const Icon(Icons.error_outline, size: 64, color: AppColors.danger),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
Text(
|
||||
'Không thể tải tài liệu',
|
||||
style: TextStyle(fontSize: 16, color: AppColors.grey500),
|
||||
style: TextStyle(fontSize: 16, color: colorScheme.onSurfaceVariant),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
ElevatedButton(
|
||||
|
||||
@@ -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ề';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user