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
@@ -5,8 +5,9 @@ class AuthBootScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: const Color(0xFFEFF8FF),
backgroundColor: colorScheme.surface,
body: SafeArea(
child: Center(
child: Image.asset(
@@ -97,6 +97,8 @@ class _LoginViewState extends State<LoginView> {
}
Widget _buildAgreementCheckbox() {
final colorScheme = Theme.of(context).colorScheme;
return Center(
child: Row(
mainAxisSize: MainAxisSize.min,
@@ -107,7 +109,7 @@ class _LoginViewState extends State<LoginView> {
checked: _agreedToTerms,
button: true,
child: InkWell(
borderRadius: BorderRadius.circular(AppRadius.md),
borderRadius: BorderRadius.circular(AppRadius.sm),
onTap: () => setState(() => _agreedToTerms = !_agreedToTerms),
child: SizedBox(
width: 44,
@@ -119,21 +121,21 @@ class _LoginViewState extends State<LoginView> {
margin: const EdgeInsets.only(right: AppSpacing.sm),
decoration: BoxDecoration(
color: _agreedToTerms
? AppColors.blue600
: Colors.transparent,
? colorScheme.primary
: colorScheme.surface.withValues(alpha: 0),
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: _agreedToTerms
? AppColors.blue600
: AppColors.slate400,
? colorScheme.primary
: colorScheme.onSurfaceVariant,
width: 1.5,
),
),
child: _agreedToTerms
? const Icon(
? Icon(
Icons.check,
size: 14,
color: AppColors.white,
color: colorScheme.onPrimary,
)
: null,
),
@@ -143,21 +145,24 @@ class _LoginViewState extends State<LoginView> {
),
RichText(
text: TextSpan(
style: const TextStyle(fontSize: 13, color: AppColors.slate600),
style: TextStyle(
fontSize: 13,
color: colorScheme.onSurfaceVariant,
),
children: [
TextSpan(text: context.l10n.authAgreementPrefix),
TextSpan(
text: context.l10n.authAgreementTerms,
style: const TextStyle(
color: AppColors.blue600,
style: TextStyle(
color: colorScheme.primary,
decoration: TextDecoration.underline,
),
),
TextSpan(text: context.l10n.authAgreementAnd),
TextSpan(
text: context.l10n.authAgreementPrivacy,
style: const TextStyle(
color: AppColors.blue600,
style: TextStyle(
color: colorScheme.primary,
decoration: TextDecoration.underline,
),
),