feat:更新颜色模块

This commit is contained in:
2025-11-20 23:40:06 +08:00
parent 6ed9efe06d
commit 3ea162f33e
9 changed files with 798 additions and 785 deletions

View File

@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
// 统计卡片
Widget buildTodoStatsCard(List<Todo> todos) {
Widget buildTodoStatsCard(BuildContext context, List<Todo> todos) {
int totalCount = todos.length;
int activeCount = todos.where((todo) => !todo.isCompleted).length;
@@ -17,15 +17,15 @@ Widget buildTodoStatsCard(List<Todo> todos) {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildStatItem('总计', totalCount, Colors.blue),
_buildStatItem('待完成', activeCount, Colors.orange),
_buildStatItem('已完成', completedCount, Colors.green),
_buildStatItem(context, '总计', totalCount),
_buildStatItem(context, '待完成', activeCount),
_buildStatItem(context, '已完成', completedCount),
],
),
);
}
Widget _buildStatItem(String label, int count, Color color) {
Widget _buildStatItem(BuildContext context, String label, int count) {
return Column(
children: [
Text(
@@ -33,7 +33,7 @@ Widget _buildStatItem(String label, int count, Color color) {
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: color,
color: Theme.of(context).colorScheme.primary,
),
),
const SizedBox(height: 4),