ocarina2/lib/widgets/song_row.dart

44 lines
1.1 KiB
Dart
Raw Normal View History

2024-05-23 19:14:08 +02:00
import 'package:auto_size_text/auto_size_text.dart';
2024-05-27 21:46:18 +02:00
import 'package:cached_network_image/cached_network_image.dart';
2024-05-23 19:14:08 +02:00
import 'package:flutter/material.dart';
import 'package:text_scroll/text_scroll.dart';
class SongRow extends StatelessWidget {
2024-05-28 18:54:05 +02:00
const SongRow({
required this.imageUrl,
required this.songTitle,
this.cacheKey,
super.key,
});
2024-05-23 19:14:08 +02:00
final String imageUrl;
final String songTitle;
2024-05-28 18:54:05 +02:00
final String? cacheKey;
2024-05-23 19:14:08 +02:00
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(8),
child: InkWell(
child: ListTile(
2024-05-27 21:46:18 +02:00
leading: SizedBox(
width: 100,
height: 100,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
2024-05-28 18:54:05 +02:00
child: CachedNetworkImage(
imageUrl: imageUrl,
cacheKey: cacheKey,
),
2024-05-27 21:46:18 +02:00
),
2024-05-23 19:14:08 +02:00
),
title: AutoSizeText(
songTitle,
overflowReplacement: TextScroll(
songTitle,
),
),
),
),
);
}
}