60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
// widgets/exercise_card.dart
|
|
// Widget für eine Trainingskarten-Ansicht
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ExerciseCard extends StatelessWidget {
|
|
final String title;
|
|
final String category;
|
|
final IconData icon;
|
|
|
|
const ExerciseCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.category,
|
|
required this.icon,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: 180,
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Icon für die Übung
|
|
Icon(icon, size: 60, color: Theme.of(context).colorScheme.primary),
|
|
const SizedBox(height: 16),
|
|
// Titel der Übung
|
|
Text(
|
|
title,
|
|
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 8),
|
|
// Kategorie-Badge
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Text(
|
|
category,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |