refactor(apps): 主题系统迁移至 ColorScheme + 扩展架构并支持 Dark Mode
This commit is contained in:
@@ -20,8 +20,9 @@ Future<T?> showAppSelectionSheet<T>(
|
||||
final result = await showModalBottomSheet<T>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0),
|
||||
builder: (sheetContext) {
|
||||
final colorScheme = Theme.of(sheetContext).colorScheme;
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: Container(
|
||||
@@ -33,9 +34,9 @@ Future<T?> showAppSelectionSheet<T>(
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: AppSpacing.lg),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.white,
|
||||
color: colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(AppRadius.xl),
|
||||
border: Border.all(color: AppColors.borderSecondary),
|
||||
border: Border.all(color: colorScheme.outlineVariant),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -46,10 +47,10 @@ Future<T?> showAppSelectionSheet<T>(
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.slate900,
|
||||
color: colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -62,9 +63,9 @@ Future<T?> showAppSelectionSheet<T>(
|
||||
isSelected: isSelected,
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
const Divider(height: 1, color: AppColors.border),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
Divider(height: 1, color: colorScheme.outlineVariant),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.lg),
|
||||
child: SizedBox(
|
||||
@@ -90,6 +91,7 @@ Widget _buildItem<T>(
|
||||
required AppSelectionItem<T> item,
|
||||
required bool isSelected,
|
||||
}) {
|
||||
final colorScheme = Theme.of(sheetContext).colorScheme;
|
||||
return InkWell(
|
||||
onTap: () => Navigator.of(sheetContext).pop(item.value),
|
||||
child: Container(
|
||||
@@ -105,12 +107,14 @@ Widget _buildItem<T>(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w500,
|
||||
color: isSelected ? AppColors.blue600 : AppColors.slate800,
|
||||
color: isSelected
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isSelected)
|
||||
const Icon(Icons.check, size: 20, color: AppColors.blue600),
|
||||
Icon(Icons.check, size: 20, color: colorScheme.primary),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user