mucke/lib/presentation/widgets/album_art_list_tile.dart

38 lines
858 B
Dart
Raw Normal View History

2020-03-28 11:08:43 +01:00
import 'package:flutter/material.dart';
import '../utils.dart' as utils;
class AlbumArtListTile extends StatelessWidget {
const AlbumArtListTile(
2020-10-25 11:54:11 +01:00
{Key key, this.title, this.subtitle, this.albumArtPath, this.onTap, this.highlight = false})
2020-03-28 11:08:43 +01:00
: super(key: key);
final String title;
final String subtitle;
final String albumArtPath;
final Function onTap;
2020-10-25 11:54:11 +01:00
final bool highlight;
2020-03-28 11:08:43 +01:00
@override
Widget build(BuildContext context) {
return ListTile(
2020-04-04 21:02:42 +02:00
leading: SizedBox(
height: 56,
width: 56,
child: Image(
image: utils.getAlbumImage(albumArtPath),
fit: BoxFit.cover,
2020-03-28 11:08:43 +01:00
),
),
title: Text(
title,
),
subtitle: Text(
subtitle,
),
onTap: () => onTap(),
2020-10-25 11:54:11 +01:00
tileColor: highlight ? Colors.white10 : Colors.transparent,
2020-03-28 11:08:43 +01:00
);
}
}