feat:更新颜色模块
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user