mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
69 lines
2.0 KiB
Dart
69 lines
2.0 KiB
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
import 'package:spotube/components/PlaylistView.dart';
|
|
|
|
class PlaylistCard extends StatefulWidget {
|
|
PlaylistSimple playlist;
|
|
PlaylistCard(this.playlist);
|
|
@override
|
|
_PlaylistCardState createState() => _PlaylistCardState();
|
|
}
|
|
|
|
class _PlaylistCardState extends State<PlaylistCard> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: () {
|
|
Navigator.of(context).push(MaterialPageRoute(
|
|
builder: (context) {
|
|
return PlaylistView(widget.playlist);
|
|
},
|
|
));
|
|
},
|
|
child: ConstrainedBox(
|
|
constraints: BoxConstraints(maxWidth: 200),
|
|
child: Ink(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(8),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
blurRadius: 10,
|
|
offset: Offset(0, 3),
|
|
spreadRadius: 5,
|
|
color: Colors.grey.shade300,
|
|
)
|
|
],
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
// thumbnail of the playlist
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(8),
|
|
child: CachedNetworkImage(
|
|
imageUrl: widget.playlist.images![0].url!),
|
|
),
|
|
SizedBox(height: 5),
|
|
Padding(
|
|
padding:
|
|
const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
widget.playlist.name!,
|
|
style: TextStyle(fontWeight: FontWeight.bold),
|
|
),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|