2020-03-25 17:00:00 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2020-04-09 17:50:28 +02:00
|
|
|
import '../../domain/entities/song.dart';
|
|
|
|
import '../utils.dart';
|
|
|
|
|
2020-03-25 17:00:00 +01:00
|
|
|
class AlbumArt extends StatelessWidget {
|
2020-04-09 17:50:28 +02:00
|
|
|
const AlbumArt({Key key, this.song}) : super(key: key);
|
|
|
|
|
|
|
|
final Song song;
|
2020-03-25 17:00:00 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AspectRatio(
|
|
|
|
aspectRatio: 1.0,
|
|
|
|
child: Card(
|
|
|
|
elevation: 2.0,
|
|
|
|
clipBehavior: Clip.antiAlias,
|
2020-04-09 17:50:28 +02:00
|
|
|
margin: const EdgeInsets.all(0),
|
2020-04-10 20:12:26 +02:00
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.circular(2.0),
|
|
|
|
),
|
2020-03-25 17:00:00 +01:00
|
|
|
child: Stack(
|
|
|
|
children: [
|
2020-04-09 17:50:28 +02:00
|
|
|
Image(
|
|
|
|
image: getAlbumImage(song.albumArtPath),
|
2020-04-10 20:12:26 +02:00
|
|
|
fit: BoxFit.cover,
|
2020-04-09 17:50:28 +02:00
|
|
|
),
|
2020-03-25 17:00:00 +01:00
|
|
|
Positioned(
|
|
|
|
bottom: 0,
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
height: 250,
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
end: Alignment.bottomCenter,
|
2020-04-09 17:50:28 +02:00
|
|
|
colors: const [
|
|
|
|
Color(0x00555555),
|
|
|
|
Color(0x77333333),
|
|
|
|
Color(0xCC111111),
|
|
|
|
Color(0xEE000000)
|
2020-03-25 17:00:00 +01:00
|
|
|
],
|
2020-04-09 17:50:28 +02:00
|
|
|
stops: const [
|
2020-03-25 17:00:00 +01:00
|
|
|
0.0,
|
|
|
|
0.6,
|
|
|
|
0.8,
|
|
|
|
1.0
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
2020-03-26 10:19:36 +01:00
|
|
|
bottom: 0,
|
|
|
|
left: 0,
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
2020-04-09 17:50:28 +02:00
|
|
|
song.title,
|
2020-03-26 10:19:36 +01:00
|
|
|
style: Theme.of(context).textTheme.title,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 4.0,
|
|
|
|
),
|
2020-04-09 17:50:28 +02:00
|
|
|
Text(
|
|
|
|
song.artist,
|
2020-03-25 17:00:00 +01:00
|
|
|
style: TextStyle(
|
2020-03-26 10:19:36 +01:00
|
|
|
color: Colors.white70,
|
2020-03-25 17:00:00 +01:00
|
|
|
),
|
|
|
|
),
|
2020-04-09 17:50:28 +02:00
|
|
|
Text(
|
|
|
|
song.album,
|
2020-03-26 10:19:36 +01:00
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
color: Colors.white70,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2020-03-25 17:00:00 +01:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|