FreekakeApp/lib/components/card_list.dart
2025-04-28 10:41:18 +07:00

81 lines
2.5 KiB
Dart

import 'package:flutter/material.dart';
class CardList extends StatelessWidget {
final String title;
final String body;
const CardList({super.key, required this.title, required this.body});
@override
Widget build(BuildContext context) {
return Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
elevation: 5,
color: const Color.fromARGB(225, 79, 76, 182),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(
10.0,
), // Opsional: membuat gambar lebih rounded
child: Image.asset(
'assets/images/cepott.png',
width: 80, // Atur ukuran gambar
height: 120,
fit: BoxFit.cover,
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
this.title,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 1, width: 5),
Text(
body,
style: const TextStyle(
letterSpacing: 0.2,
fontSize: 14,
fontWeight: FontWeight.normal,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const Spacer(),
Padding(
padding: EdgeInsets.all(0.08),
child: const Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text("50"),
SizedBox(width: 40),
Text("100"),
],
),
Text("Quiz"),
],
),
),
],
),
),
],
),
),
);
}
}