2021-01-17 10:20:51 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import '../theming.dart';
|
|
|
|
import '../utils.dart' as utils;
|
|
|
|
|
|
|
|
class AlbumListTileExtended extends StatelessWidget {
|
|
|
|
const AlbumListTileExtended(
|
2021-01-21 21:49:29 +01:00
|
|
|
{Key key, this.title, this.subtitle, this.albumArtPath, this.onTap, this.highlight = false, this.onTapPlay})
|
2021-01-17 10:20:51 +01:00
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
final String subtitle;
|
|
|
|
final String albumArtPath;
|
|
|
|
final Function onTap;
|
|
|
|
final bool highlight;
|
2021-01-21 21:49:29 +01:00
|
|
|
final Function onTapPlay;
|
2021-01-17 10:20:51 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () => onTap(),
|
2021-01-21 21:49:29 +01:00
|
|
|
child: Container(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
SizedBox(
|
|
|
|
height: 72,
|
|
|
|
width: 72,
|
|
|
|
child: Container(
|
2021-01-27 18:13:21 +01:00
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.0)),
|
2021-01-21 21:49:29 +01:00
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
child: Image(
|
|
|
|
image: utils.getAlbumImage(albumArtPath),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
2021-01-17 10:20:51 +01:00
|
|
|
),
|
|
|
|
),
|
2021-01-21 21:49:29 +01:00
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0),
|
|
|
|
maxLines: 2,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
subtitle,
|
|
|
|
style: TEXT_SMALL_SUBTITLE,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2021-01-17 10:20:51 +01:00
|
|
|
),
|
|
|
|
),
|
2021-01-21 21:49:29 +01:00
|
|
|
IconButton(
|
|
|
|
icon: Icon(Icons.play_circle_fill_rounded),
|
|
|
|
iconSize: 40.0,
|
|
|
|
onPressed: () => onTapPlay(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2021-01-17 10:20:51 +01:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|