PMU-PIbd-32-Fedorenko-G-Y/flutter_app/lib/widgets/album_card.dart

57 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import '../models/album.dart';
class AlbumCard extends StatelessWidget {
final Album album;
const AlbumCard({super.key, required this.album});
@override
Widget build(BuildContext context) {
return Card(
margin: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
album.imageUrl,
width: double.infinity,
height: 150,
fit: BoxFit.cover,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
album.title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
Text(
album.artist,
style: const TextStyle(
fontSize: 16,
color: Colors.grey,
),
),
Text(
'${album.reviews.length} reviews',
style: const TextStyle(
fontSize: 14,
fontStyle: FontStyle.italic,
color: Colors.grey,
),
),
],
),
),
],
),
);
}
}