ocarina2/lib/widgets/song_row.dart
2024-05-28 18:54:05 +02:00

43 lines
1.1 KiB
Dart

import 'package:auto_size_text/auto_size_text.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:text_scroll/text_scroll.dart';
class SongRow extends StatelessWidget {
const SongRow({
required this.imageUrl,
required this.songTitle,
this.cacheKey,
super.key,
});
final String imageUrl;
final String songTitle;
final String? cacheKey;
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(8),
child: InkWell(
child: ListTile(
leading: SizedBox(
width: 100,
height: 100,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: imageUrl,
cacheKey: cacheKey,
),
),
),
title: AutoSizeText(
songTitle,
overflowReplacement: TextScroll(
songTitle,
),
),
),
),
);
}
}