Fix queue reorder eoor.
This commit is contained in:
parent
c625e114ad
commit
a34b9f3a8a
|
@ -118,11 +118,18 @@ class _PlaylistDetailState extends State<PlaylistDetail> {
|
||||||
final episodes = playlist.episodes;
|
final episodes = playlist.episodes;
|
||||||
return ReorderableListView(
|
return ReorderableListView(
|
||||||
onReorder: (oldIndex, newIndex) {
|
onReorder: (oldIndex, newIndex) {
|
||||||
context.read<AudioPlayerNotifier>().reorderEpisodesInPlaylist(
|
if (widget.playlist.isQueue) {
|
||||||
widget.playlist,
|
context
|
||||||
oldIndex: oldIndex,
|
.read<AudioPlayerNotifier>()
|
||||||
newIndex: newIndex);
|
.reorderPlaylist(oldIndex, newIndex);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
} else {
|
||||||
|
context
|
||||||
|
.read<AudioPlayerNotifier>()
|
||||||
|
.reorderEpisodesInPlaylist(widget.playlist,
|
||||||
|
oldIndex: oldIndex, newIndex: newIndex);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
children: episodes.map<Widget>((episode) {
|
children: episodes.map<Widget>((episode) {
|
||||||
|
@ -331,6 +338,7 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
||||||
final s = context.s;
|
final s = context.s;
|
||||||
final textStyle = context.textTheme.bodyText2;
|
final textStyle = context.textTheme.bodyText2;
|
||||||
return Column(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
@ -339,7 +347,7 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Row(
|
title: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.highlight_off, size: 18),
|
Icon(Icons.clear_all_outlined, size: 18),
|
||||||
SizedBox(width: 20),
|
SizedBox(width: 20),
|
||||||
Text('Clear all', style: textStyle),
|
Text('Clear all', style: textStyle),
|
||||||
],
|
],
|
||||||
|
@ -415,6 +423,18 @@ class __PlaylistSettingState extends State<_PlaylistSetting> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (widget.playlist.isQueue)
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.info_outline,
|
||||||
|
size: 16, color: context.textColor.withAlpha(90)),
|
||||||
|
Text('This is the default queue, can\'t be removed.',
|
||||||
|
style: TextStyle(color: context.textColor.withAlpha(90))),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue