70 lines
2.3 KiB
Dart
70 lines
2.3 KiB
Dart
// widgets/exercise_card.dart
|
|
// Widget for a training exercise card view
|
|
// Widget für eine Trainingskarten-Ansicht
|
|
import 'package:flutter/material.dart';
|
|
|
|
/// A widget that displays a card for a training exercise, showing its icon, title, and category.
|
|
/// Widget, das eine Karte für eine Trainingsübung mit Icon, Titel und Kategorie anzeigt.
|
|
class ExerciseCard extends StatelessWidget {
|
|
/// The title of the exercise.
|
|
final String title;
|
|
/// The category of the exercise.
|
|
final String category;
|
|
/// The icon representing the exercise.
|
|
final IconData icon;
|
|
|
|
/// Creates an ExerciseCard widget.
|
|
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 for the exercise
|
|
// Icon für die Übung
|
|
Icon(icon, size: 60, color: Theme.of(context).colorScheme.primary),
|
|
const SizedBox(height: 16),
|
|
// Title of the exercise
|
|
// Titel der Übung
|
|
Text(
|
|
title,
|
|
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
const SizedBox(height: 8),
|
|
// Category badge
|
|
// 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,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |