mucke/lib/presentation/widgets/next_song.dart

46 lines
1.1 KiB
Dart
Raw Normal View History

2020-07-12 18:25:34 +02:00
import 'package:flutter/material.dart';
import '../../domain/entities/song.dart';
class NextSong extends StatelessWidget {
2020-08-24 16:43:22 +02:00
const NextSong({Key key, this.queue, this.index}) : super(key: key);
2020-07-12 18:25:34 +02:00
2020-08-24 16:43:22 +02:00
final List<Song> queue;
final int index;
2020-07-12 18:25:34 +02:00
@override
Widget build(BuildContext context) {
2020-08-24 16:43:22 +02:00
if (index < queue.length - 1) {
final Song song = queue[index + 1];
return RichText(
2020-12-31 17:52:20 +01:00
textAlign: TextAlign.center,
2020-08-24 16:43:22 +02:00
text: TextSpan(
style: const TextStyle(
fontSize: 14,
color: Colors.white70,
2020-07-12 18:25:34 +02:00
),
2020-08-24 16:43:22 +02:00
children: [
2020-12-31 17:52:20 +01:00
TextSpan(
text: '${song.title}',
style: const TextStyle(
fontWeight: FontWeight.w300,
),
),
2020-08-24 16:43:22 +02:00
const TextSpan(text: ''),
TextSpan(
text: '${song.artist}',
style: const TextStyle(
fontWeight: FontWeight.w300,
),
),
],
),
);
} else {
return Container(
height: 16.0,
);
}
2020-07-12 18:25:34 +02:00
}
}