Frontend first draft
This commit is contained in:
47
frontend/pweb/lib/widgets/stats/card.dart
Normal file
47
frontend/pweb/lib/widgets/stats/card.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user