refactor(apps): 主题系统迁移至 ColorScheme + 扩展架构并支持 Dark Mode

This commit is contained in:
qzl
2026-03-27 19:07:39 +08:00
parent ecc1ec6ce4
commit ae29a8209b
146 changed files with 4301 additions and 3200 deletions
+20 -27
View File
@@ -42,10 +42,13 @@ class _BackButtonState extends State<BackButton> {
@override
Widget build(BuildContext context) {
final background = _isPressed ? AppColors.surfaceInfo : AppColors.white;
final colorScheme = Theme.of(context).colorScheme;
final background = _isPressed
? colorScheme.secondaryContainer
: colorScheme.surface;
final borderColor = _isPressed
? AppColors.borderQuaternary
: AppColors.borderTertiary;
? colorScheme.outlineVariant
: colorScheme.outline;
return AnimatedScale(
scale: _isPressed ? 0.96 : 1,
@@ -60,13 +63,13 @@ class _BackButtonState extends State<BackButton> {
boxShadow: _isPressed
? const []
: [
const BoxShadow(
color: AppColors.white,
BoxShadow(
color: colorScheme.surface,
blurRadius: AppRadius.sm,
offset: Offset(0, -1),
offset: const Offset(0, -1),
),
BoxShadow(
color: AppColors.slate200.withValues(alpha: 0.42),
color: colorScheme.shadow.withValues(alpha: 0.42),
blurRadius: AppRadius.md,
offset: const Offset(0, AppSpacing.xs),
),
@@ -76,39 +79,29 @@ class _BackButtonState extends State<BackButton> {
width: AppSpacing.xl * 2,
height: AppSpacing.xl * 2,
child: Material(
color: Colors.transparent,
color: colorScheme.surface.withValues(alpha: 0),
child: InkWell(
borderRadius: BorderRadius.circular(AppRadius.full),
onTap: widget.onPressed ?? () => Navigator.of(context).pop(),
onTapDown: (_) {
if (_isPressed) {
return;
}
setState(() {
_isPressed = true;
});
if (_isPressed) return;
setState(() => _isPressed = true);
},
onTapCancel: () {
if (!_isPressed) {
return;
}
setState(() {
_isPressed = false;
});
if (!_isPressed) return;
setState(() => _isPressed = false);
},
onTapUp: (_) {
if (!_isPressed) {
return;
}
setState(() {
_isPressed = false;
});
if (!_isPressed) return;
setState(() => _isPressed = false);
},
child: Center(
child: Icon(
Icons.chevron_left,
size: AppSpacing.lg + AppSpacing.xs,
color: _isPressed ? AppColors.blue600 : AppColors.slate700,
color: _isPressed
? colorScheme.primary
: colorScheme.onSurfaceVariant,
),
),
),