48 lines
1008 B
Dart
48 lines
1008 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:pweb/widgets/vspacer.dart';
|
|
|
|
|
|
class StatCard extends StatelessWidget {
|
|
final IconData icon;
|
|
final String text;
|
|
final int count;
|
|
final Color color;
|
|
|
|
const StatCard({
|
|
super.key,
|
|
required this.icon,
|
|
required this.text,
|
|
required this.count,
|
|
required this.color,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
|
|
return Expanded(
|
|
child: Card(
|
|
elevation: 2,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
children: [
|
|
Icon(icon, size: 24, color: color),
|
|
const VSpacer(multiplier: 0.25),
|
|
Text(
|
|
'$count',
|
|
style: theme.textTheme.titleMedium,
|
|
),
|
|
Text(
|
|
text,
|
|
style: theme.textTheme.bodySmall,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|