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
+10 -5
View File
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import '../../../core/l10n/l10n.dart';
import '../../../core/theme/design_tokens.dart';
enum MessageSender { user, ai }
@@ -23,6 +22,7 @@ class ChatBubble extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isUser = sender == MessageSender.user;
final colorScheme = Theme.of(context).colorScheme;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
@@ -36,7 +36,10 @@ class ChatBubble extends StatelessWidget {
padding: const EdgeInsets.only(bottom: 6),
child: Text(
_formatTimestamp(timestamp),
style: const TextStyle(fontSize: 11, color: AppColors.slate400),
style: TextStyle(
fontSize: 11,
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.7),
),
),
),
Container(
@@ -45,11 +48,11 @@ class ChatBubble extends StatelessWidget {
),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: isUser ? AppColors.blue500 : AppColors.white,
color: isUser ? colorScheme.primary : colorScheme.surface,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.06),
color: colorScheme.shadow.withValues(alpha: 0.08),
blurRadius: 8,
offset: const Offset(0, 2),
),
@@ -60,7 +63,9 @@ class ChatBubble extends StatelessWidget {
content,
style: TextStyle(
fontSize: 15,
color: isUser ? AppColors.white : AppColors.slate700,
color: isUser
? colorScheme.onPrimary
: colorScheme.onSurface,
height: 1.45,
),
)