42 lines
1017 B
Dart
42 lines
1017 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class KpiCard extends StatelessWidget {
|
|
final String title;
|
|
final String value;
|
|
final IconData icon;
|
|
final Color? color;
|
|
|
|
const KpiCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.value,
|
|
required this.icon,
|
|
this.color,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
child: Container(
|
|
padding: const EdgeInsets.all(16.0),
|
|
width: 200,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Icon(icon,
|
|
size: 32,
|
|
color: color ?? Theme.of(context).colorScheme.primary),
|
|
const SizedBox(height: 8),
|
|
Text(title, style: Theme.of(context).textTheme.titleMedium),
|
|
Text(value,
|
|
style: Theme.of(context)
|
|
.textTheme
|
|
.headlineMedium
|
|
?.copyWith(color: color)),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|