Flutter-Ernaehrungsapp/lib/components/cardComponent.dart

30 lines
844 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
class CardComponent extends StatelessWidget {
final String title;
final String description;
const CardComponent({super.key, required this.title, required this.description});
@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.8,
child: Card(
margin: const EdgeInsets.all(20.0),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(title, style: const TextStyle(fontSize: 24.0)),
const SizedBox(height: 8.0),
Text(description, style: const TextStyle(fontSize: 16.0)),
],
),
),
),
);
}
}