Add play next in popupmenu.
This commit is contained in:
parent
434609eaeb
commit
074f31e7cd
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("Play"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage("Play next"),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage("Add episode to top of the playlist"),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("Playback control"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medium"),
|
||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("Reproducir"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("Control de reproducción"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("Reproductor"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("Lecture"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("Commandes du lecteur"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Moyen"),
|
||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("Riproduci"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("Controlli di riproduzione"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("Reproduzir"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("Controlo da reprodução"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("Reprodutor"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Médio"),
|
||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"password" : MessageLookupByLibrary.simpleMessage("密码"),
|
||||
"pause" : MessageLookupByLibrary.simpleMessage("暂停"),
|
||||
"play" : MessageLookupByLibrary.simpleMessage("播放"),
|
||||
"playNext" : MessageLookupByLibrary.simpleMessage("下一首"),
|
||||
"playNextDes" : MessageLookupByLibrary.simpleMessage("添加节目到播放列表的顶部"),
|
||||
"playback" : MessageLookupByLibrary.simpleMessage("播放控制"),
|
||||
"player" : MessageLookupByLibrary.simpleMessage("播放器"),
|
||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("中"),
|
||||
|
|
|
@ -1495,6 +1495,26 @@ class S {
|
|||
);
|
||||
}
|
||||
|
||||
/// `Play next`
|
||||
String get playNext {
|
||||
return Intl.message(
|
||||
'Play next',
|
||||
name: 'playNext',
|
||||
desc: 'Popup menu for episode.',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Add episode to top of the playlist`
|
||||
String get playNextDes {
|
||||
return Intl.message(
|
||||
'Add episode to top of the playlist',
|
||||
name: 'playNextDes',
|
||||
desc: 'Description for next play.',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Plugins`
|
||||
String get plugins {
|
||||
return Intl.message(
|
||||
|
|
|
@ -752,10 +752,10 @@ class ShowEpisode extends StatelessWidget {
|
|||
audio.episodeLoad(episodes[index]);
|
||||
}
|
||||
}),
|
||||
menuList.contains(1)
|
||||
? FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
if (menuList.contains(1))
|
||||
FocusedMenuItem(
|
||||
backgroundColor:
|
||||
context.brightness == Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: data.item2.contains(
|
||||
|
@ -769,26 +769,24 @@ class ShowEpisode extends StatelessWidget {
|
|||
onPressed: () {
|
||||
if (!data.item2.contains(
|
||||
episodes[index].enclosureUrl)) {
|
||||
audio
|
||||
.addToPlaylist(episodes[index]);
|
||||
audio.addToPlaylist(episodes[index]);
|
||||
Fluttertoast.showToast(
|
||||
msg: s.toastAddPlaylist,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
audio.delFromPlaylist(
|
||||
episodes[index]);
|
||||
audio
|
||||
.delFromPlaylist(episodes[index]);
|
||||
Fluttertoast.showToast(
|
||||
msg: s.toastRemovePlaylist,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(2)
|
||||
? FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
}),
|
||||
if (menuList.contains(2))
|
||||
FocusedMenuItem(
|
||||
backgroundColor:
|
||||
context.brightness == Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: isLiked
|
||||
|
@ -814,12 +812,11 @@ class ShowEpisode extends StatelessWidget {
|
|||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(3)
|
||||
? FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
}),
|
||||
if (menuList.contains(3))
|
||||
FocusedMenuItem(
|
||||
backgroundColor:
|
||||
context.brightness == Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: isListened > 0
|
||||
|
@ -842,20 +839,18 @@ class ShowEpisode extends StatelessWidget {
|
|||
),
|
||||
onPressed: () async {
|
||||
if (isListened < 1) {
|
||||
await _markListened(
|
||||
episodes[index]);
|
||||
await _markListened(episodes[index]);
|
||||
audio.setEpisodeState = true;
|
||||
Fluttertoast.showToast(
|
||||
msg: s.markListened,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(4)
|
||||
? FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
}),
|
||||
if (menuList.contains(4))
|
||||
FocusedMenuItem(
|
||||
backgroundColor:
|
||||
context.brightness == Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: isDownloaded
|
||||
|
@ -874,8 +869,25 @@ class ShowEpisode extends StatelessWidget {
|
|||
// downloader
|
||||
// .startTask(episodes[index]);
|
||||
}
|
||||
})
|
||||
: null
|
||||
}),
|
||||
if (menuList.contains(5))
|
||||
FocusedMenuItem(
|
||||
backgroundColor:
|
||||
context.brightness == Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: Text(s.playNext),
|
||||
trailingIcon: Icon(
|
||||
LineIcons.bolt_solid,
|
||||
color: Colors.amber,
|
||||
),
|
||||
onPressed: () {
|
||||
audio.moveToTop(episodes[index]);
|
||||
Fluttertoast.showToast(
|
||||
msg: s.playNextDes,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}),
|
||||
],
|
||||
action: () => Navigator.push(
|
||||
context,
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "Playing",
|
||||
"@playing": {},
|
||||
"playNext": "Play next",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "Add episode to top of the playlist",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "Plugins",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "Reproduciendo",
|
||||
"@playing": {},
|
||||
"playNext": "",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "Plugins",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "En cours",
|
||||
"@playing": {},
|
||||
"playNext": "",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "Plugins",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "In riproduzione",
|
||||
"@playing": {},
|
||||
"playNext": "",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "Plugin",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcast}}",
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "Em reprodução",
|
||||
"@playing": {},
|
||||
"playNext": "",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "Plugins",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||
|
|
|
@ -364,6 +364,14 @@
|
|||
"@playerHeightTall": {},
|
||||
"playing": "正在播放",
|
||||
"@playing": {},
|
||||
"playNext": "下一首",
|
||||
"@playNext": {
|
||||
"description": "Popup menu for episode."
|
||||
},
|
||||
"playNextDes": "添加节目到播放列表的顶部",
|
||||
"@playNextDes": {
|
||||
"description": "Description for next play."
|
||||
},
|
||||
"plugins": "插件",
|
||||
"@plugins": {},
|
||||
"podcast": "{count, plural, zero{} other{播客}}",
|
||||
|
|
|
@ -132,9 +132,10 @@ class KeyValueStorage {
|
|||
Future<List<int>> getMenu() async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
if (prefs.getStringList(key) == null || prefs.getStringList(key).isEmpty) {
|
||||
await prefs.setStringList(key, ['0', '1', '2', '13', '14']);
|
||||
await prefs.setStringList(key, ['0', '1', '2', '13', '14', '15']);
|
||||
}
|
||||
var list = prefs.getStringList(key);
|
||||
if(list.length == 5) list = [...list,'15'];
|
||||
return list.map(int.parse).toList();
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class _PopupMenuSettingState extends State<PopupMenuSetting> {
|
|||
)),
|
||||
FutureBuilder<List<int>>(
|
||||
future: _getEpisodeMenu(),
|
||||
initialData: [0, 1, 12, 13, 14],
|
||||
initialData: [0, 1, 12, 13, 14, 15],
|
||||
builder: (context, snapshot) {
|
||||
var menu = snapshot.data;
|
||||
return Expanded(
|
||||
|
@ -206,8 +206,15 @@ class _PopupMenuSettingState extends State<PopupMenuSetting> {
|
|||
text: s.download,
|
||||
description: s.popupMenuDownloadDes);
|
||||
break;
|
||||
case 5:
|
||||
return _popupMenuItem(menu, e,
|
||||
icon: Icon(LineIcons.bolt_solid,
|
||||
color: Colors.amber,),
|
||||
text: s.playNext,
|
||||
description: s.playNextDes);
|
||||
break;
|
||||
default:
|
||||
return Text('Text');
|
||||
return Center();
|
||||
break;
|
||||
}
|
||||
}).toList(),
|
||||
|
|
|
@ -666,8 +666,8 @@ class EpisodeGrid extends StatelessWidget {
|
|||
audio.episodeLoad(episodes[index]);
|
||||
}
|
||||
}),
|
||||
menuList.contains(1)
|
||||
? FocusedMenuItem(
|
||||
if (menuList.contains(1))
|
||||
FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
? context.primaryColor
|
||||
|
@ -683,8 +683,8 @@ class EpisodeGrid extends StatelessWidget {
|
|||
onPressed: () {
|
||||
if (!data.item2.contains(
|
||||
episodes[index].enclosureUrl)) {
|
||||
audio.addToPlaylist(
|
||||
episodes[index]);
|
||||
audio
|
||||
.addToPlaylist(episodes[index]);
|
||||
Fluttertoast.showToast(
|
||||
msg: s.toastAddPlaylist,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
|
@ -697,10 +697,9 @@ class EpisodeGrid extends StatelessWidget {
|
|||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(2)
|
||||
? FocusedMenuItem(
|
||||
}),
|
||||
if (menuList.contains(2))
|
||||
FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
? context.primaryColor
|
||||
|
@ -728,10 +727,9 @@ class EpisodeGrid extends StatelessWidget {
|
|||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(3)
|
||||
? FocusedMenuItem(
|
||||
}),
|
||||
if (menuList.contains(3))
|
||||
FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
? context.primaryColor
|
||||
|
@ -744,8 +742,7 @@ class EpisodeGrid extends StatelessWidget {
|
|||
: Text(
|
||||
s.markListened,
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
trailingIcon: SizedBox(
|
||||
width: 23,
|
||||
|
@ -773,10 +770,9 @@ class EpisodeGrid extends StatelessWidget {
|
|||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
})
|
||||
: null,
|
||||
menuList.contains(4)
|
||||
? FocusedMenuItem(
|
||||
}),
|
||||
if (menuList.contains(4))
|
||||
FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
? context.primaryColor
|
||||
|
@ -797,8 +793,25 @@ class EpisodeGrid extends StatelessWidget {
|
|||
// downloader
|
||||
// .startTask(episodes[index]);
|
||||
}
|
||||
})
|
||||
: null
|
||||
}),
|
||||
if (menuList.contains(5))
|
||||
FocusedMenuItem(
|
||||
backgroundColor: context.brightness ==
|
||||
Brightness.light
|
||||
? context.primaryColor
|
||||
: context.dialogBackgroundColor,
|
||||
title: Text(s.playNext),
|
||||
trailingIcon: Icon(
|
||||
LineIcons.bolt_solid,
|
||||
color: Colors.amber,
|
||||
),
|
||||
onPressed: () {
|
||||
audio.moveToTop(episodes[index]);
|
||||
Fluttertoast.showToast(
|
||||
msg: s.playNextDes,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}),
|
||||
],
|
||||
action: action,
|
||||
child: _episodeCard(context,
|
||||
|
|
Loading…
Reference in New Issue