refactoring
This commit is contained in:
@@ -34,6 +34,7 @@ class UFPageHeader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final effectiveIconColor = iconColor ?? AppColors.primaryGreen;
|
||||
|
||||
return Column(
|
||||
@@ -59,30 +60,30 @@ class UFPageHeader extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: SpacingTokens.md),
|
||||
|
||||
|
||||
// Titre
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: AppTypography.headerSmall.copyWith(
|
||||
color: AppColors.textPrimaryLight,
|
||||
color: isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Actions
|
||||
if (actions != null) ...actions!,
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Divider optionnel
|
||||
if (showDivider)
|
||||
const Divider(
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: AppColors.lightBorder,
|
||||
color: isDark ? AppColors.darkBorder : AppColors.lightBorder,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -110,6 +111,7 @@ class UFPageHeaderWithStats extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final effectiveIconColor = iconColor ?? AppColors.primaryGreen;
|
||||
|
||||
return Column(
|
||||
@@ -138,18 +140,18 @@ class UFPageHeaderWithStats extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: SpacingTokens.md),
|
||||
|
||||
|
||||
// Titre
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: AppTypography.headerSmall.copyWith(
|
||||
color: AppColors.textPrimaryLight,
|
||||
color: isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Actions
|
||||
if (actions != null) ...actions!,
|
||||
],
|
||||
@@ -172,7 +174,7 @@ class UFPageHeaderWithStats extends StatelessWidget {
|
||||
padding: EdgeInsets.only(
|
||||
right: isLast ? 0 : SpacingTokens.sm,
|
||||
),
|
||||
child: _buildStatItem(stat),
|
||||
child: _buildStatItem(stat, isDark),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
@@ -180,16 +182,16 @@ class UFPageHeaderWithStats extends StatelessWidget {
|
||||
),
|
||||
|
||||
// Divider
|
||||
const Divider(
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: AppColors.lightBorder,
|
||||
color: isDark ? AppColors.darkBorder : AppColors.lightBorder,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildStatItem(UFHeaderStat stat) {
|
||||
Widget _buildStatItem(UFHeaderStat stat, bool isDark) {
|
||||
final effectiveColor = stat.color ?? AppColors.primaryGreen;
|
||||
return UFContainer.rounded(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -211,7 +213,7 @@ class UFPageHeaderWithStats extends StatelessWidget {
|
||||
Text(
|
||||
stat.label,
|
||||
style: AppTypography.badgeText.copyWith(
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
Reference in New Issue
Block a user