feat:更新图表模块

This commit is contained in:
2025-07-27 22:28:04 +08:00
parent a2ed0f3d98
commit 34780651a8
7 changed files with 305 additions and 115 deletions

View File

@@ -0,0 +1,58 @@
import 'package:flutter/material.dart';
class StatisticCard extends StatelessWidget {
final IconData icon;
final Color color;
final String title;
final num value;
final String unit;
const StatisticCard({
super.key,
required this.icon,
required this.color,
required this.title,
required this.value,
required this.unit,
});
@override
Widget build(BuildContext context) {
return Card(
color: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: [
SizedBox(
width: 60,
height: 60,
child: Icon(icon, color: color, size: 42),
),
const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(title, style: TextStyle(fontSize: 20, color: color)),
const SizedBox(height: 4),
Row(
children: [
Text(
value.toString(),
style: TextStyle(fontSize: 20, color: color),
),
const SizedBox(width: 5),
Text(unit, style: TextStyle(fontSize: 20, color: color)),
],
),
],
),
],
),
),
);
}
}