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"),
|
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("Play"),
|
"play" : MessageLookupByLibrary.simpleMessage("Play"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage("Play next"),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage("Add episode to top of the playlist"),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("Playback control"),
|
"playback" : MessageLookupByLibrary.simpleMessage("Playback control"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medium"),
|
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medium"),
|
||||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("Reproducir"),
|
"play" : MessageLookupByLibrary.simpleMessage("Reproducir"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("Control de reproducción"),
|
"playback" : MessageLookupByLibrary.simpleMessage("Control de reproducción"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("Reproductor"),
|
"player" : MessageLookupByLibrary.simpleMessage("Reproductor"),
|
||||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
||||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
"pause" : MessageLookupByLibrary.simpleMessage("Pause"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("Lecture"),
|
"play" : MessageLookupByLibrary.simpleMessage("Lecture"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("Commandes du lecteur"),
|
"playback" : MessageLookupByLibrary.simpleMessage("Commandes du lecteur"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Moyen"),
|
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Moyen"),
|
||||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("Riproduci"),
|
"play" : MessageLookupByLibrary.simpleMessage("Riproduci"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("Controlli di riproduzione"),
|
"playback" : MessageLookupByLibrary.simpleMessage("Controlli di riproduzione"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
"player" : MessageLookupByLibrary.simpleMessage("Player"),
|
||||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Medio"),
|
||||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
"password" : MessageLookupByLibrary.simpleMessage("Password"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
"pause" : MessageLookupByLibrary.simpleMessage("Pausa"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("Reproduzir"),
|
"play" : MessageLookupByLibrary.simpleMessage("Reproduzir"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage(""),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("Controlo da reprodução"),
|
"playback" : MessageLookupByLibrary.simpleMessage("Controlo da reprodução"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("Reprodutor"),
|
"player" : MessageLookupByLibrary.simpleMessage("Reprodutor"),
|
||||||
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Médio"),
|
"playerHeightMed" : MessageLookupByLibrary.simpleMessage("Médio"),
|
||||||
|
|
|
@ -220,6 +220,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"password" : MessageLookupByLibrary.simpleMessage("密码"),
|
"password" : MessageLookupByLibrary.simpleMessage("密码"),
|
||||||
"pause" : MessageLookupByLibrary.simpleMessage("暂停"),
|
"pause" : MessageLookupByLibrary.simpleMessage("暂停"),
|
||||||
"play" : MessageLookupByLibrary.simpleMessage("播放"),
|
"play" : MessageLookupByLibrary.simpleMessage("播放"),
|
||||||
|
"playNext" : MessageLookupByLibrary.simpleMessage("下一首"),
|
||||||
|
"playNextDes" : MessageLookupByLibrary.simpleMessage("添加节目到播放列表的顶部"),
|
||||||
"playback" : MessageLookupByLibrary.simpleMessage("播放控制"),
|
"playback" : MessageLookupByLibrary.simpleMessage("播放控制"),
|
||||||
"player" : MessageLookupByLibrary.simpleMessage("播放器"),
|
"player" : MessageLookupByLibrary.simpleMessage("播放器"),
|
||||||
"playerHeightMed" : 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`
|
/// `Plugins`
|
||||||
String get plugins {
|
String get plugins {
|
||||||
return Intl.message(
|
return Intl.message(
|
||||||
|
|
|
@ -752,130 +752,142 @@ class ShowEpisode extends StatelessWidget {
|
||||||
audio.episodeLoad(episodes[index]);
|
audio.episodeLoad(episodes[index]);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
menuList.contains(1)
|
if (menuList.contains(1))
|
||||||
? FocusedMenuItem(
|
FocusedMenuItem(
|
||||||
backgroundColor: context.brightness ==
|
backgroundColor:
|
||||||
Brightness.light
|
context.brightness == Brightness.light
|
||||||
? context.primaryColor
|
? context.primaryColor
|
||||||
: context.dialogBackgroundColor,
|
: context.dialogBackgroundColor,
|
||||||
title: data.item2.contains(
|
title: data.item2.contains(
|
||||||
episodes[index].enclosureUrl)
|
episodes[index].enclosureUrl)
|
||||||
? Text(s.remove)
|
? Text(s.remove)
|
||||||
: Text(s.later),
|
: Text(s.later),
|
||||||
trailingIcon: Icon(
|
trailingIcon: Icon(
|
||||||
LineIcons.clock_solid,
|
LineIcons.clock_solid,
|
||||||
color: Colors.cyan,
|
color: Colors.cyan,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (!data.item2.contains(
|
if (!data.item2.contains(
|
||||||
episodes[index].enclosureUrl)) {
|
episodes[index].enclosureUrl)) {
|
||||||
audio
|
audio.addToPlaylist(episodes[index]);
|
||||||
.addToPlaylist(episodes[index]);
|
Fluttertoast.showToast(
|
||||||
Fluttertoast.showToast(
|
msg: s.toastAddPlaylist,
|
||||||
msg: s.toastAddPlaylist,
|
gravity: ToastGravity.BOTTOM,
|
||||||
gravity: ToastGravity.BOTTOM,
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
audio
|
||||||
audio.delFromPlaylist(
|
.delFromPlaylist(episodes[index]);
|
||||||
episodes[index]);
|
Fluttertoast.showToast(
|
||||||
Fluttertoast.showToast(
|
msg: s.toastRemovePlaylist,
|
||||||
msg: s.toastRemovePlaylist,
|
gravity: ToastGravity.BOTTOM,
|
||||||
gravity: ToastGravity.BOTTOM,
|
);
|
||||||
);
|
}
|
||||||
}
|
}),
|
||||||
})
|
if (menuList.contains(2))
|
||||||
: null,
|
FocusedMenuItem(
|
||||||
menuList.contains(2)
|
backgroundColor:
|
||||||
? FocusedMenuItem(
|
context.brightness == Brightness.light
|
||||||
backgroundColor: context.brightness ==
|
? context.primaryColor
|
||||||
Brightness.light
|
: context.dialogBackgroundColor,
|
||||||
? context.primaryColor
|
title: isLiked
|
||||||
: context.dialogBackgroundColor,
|
? Text(s.unlike)
|
||||||
title: isLiked
|
: Text(s.like),
|
||||||
? Text(s.unlike)
|
trailingIcon: Icon(LineIcons.heart,
|
||||||
: Text(s.like),
|
color: Colors.red, size: 21),
|
||||||
trailingIcon: Icon(LineIcons.heart,
|
onPressed: () async {
|
||||||
color: Colors.red, size: 21),
|
if (isLiked) {
|
||||||
onPressed: () async {
|
await _setUnliked(
|
||||||
if (isLiked) {
|
episodes[index].enclosureUrl);
|
||||||
await _setUnliked(
|
audio.setEpisodeState = true;
|
||||||
episodes[index].enclosureUrl);
|
Fluttertoast.showToast(
|
||||||
audio.setEpisodeState = true;
|
msg: s.unliked,
|
||||||
Fluttertoast.showToast(
|
gravity: ToastGravity.BOTTOM,
|
||||||
msg: s.unliked,
|
);
|
||||||
gravity: ToastGravity.BOTTOM,
|
} else {
|
||||||
);
|
await _saveLiked(
|
||||||
} else {
|
episodes[index].enclosureUrl);
|
||||||
await _saveLiked(
|
audio.setEpisodeState = true;
|
||||||
episodes[index].enclosureUrl);
|
Fluttertoast.showToast(
|
||||||
audio.setEpisodeState = true;
|
msg: s.liked,
|
||||||
Fluttertoast.showToast(
|
gravity: ToastGravity.BOTTOM,
|
||||||
msg: s.liked,
|
);
|
||||||
gravity: ToastGravity.BOTTOM,
|
}
|
||||||
);
|
}),
|
||||||
}
|
if (menuList.contains(3))
|
||||||
})
|
FocusedMenuItem(
|
||||||
: null,
|
backgroundColor:
|
||||||
menuList.contains(3)
|
context.brightness == Brightness.light
|
||||||
? FocusedMenuItem(
|
? context.primaryColor
|
||||||
backgroundColor: context.brightness ==
|
: context.dialogBackgroundColor,
|
||||||
Brightness.light
|
title: isListened > 0
|
||||||
? context.primaryColor
|
? Text(s.listened,
|
||||||
: context.dialogBackgroundColor,
|
style: TextStyle(
|
||||||
title: isListened > 0
|
color: context.textColor
|
||||||
? Text(s.listened,
|
.withOpacity(0.5)))
|
||||||
style: TextStyle(
|
: Text(
|
||||||
color: context.textColor
|
s.markListened,
|
||||||
.withOpacity(0.5)))
|
maxLines: 1,
|
||||||
: Text(
|
overflow: TextOverflow.ellipsis,
|
||||||
s.markListened,
|
),
|
||||||
maxLines: 1,
|
trailingIcon: SizedBox(
|
||||||
overflow: TextOverflow.ellipsis,
|
width: 23,
|
||||||
),
|
height: 23,
|
||||||
trailingIcon: SizedBox(
|
child: CustomPaint(
|
||||||
width: 23,
|
painter: ListenedAllPainter(
|
||||||
height: 23,
|
Colors.blue,
|
||||||
child: CustomPaint(
|
stroke: 1.5)),
|
||||||
painter: ListenedAllPainter(
|
),
|
||||||
Colors.blue,
|
onPressed: () async {
|
||||||
stroke: 1.5)),
|
if (isListened < 1) {
|
||||||
),
|
await _markListened(episodes[index]);
|
||||||
onPressed: () async {
|
audio.setEpisodeState = true;
|
||||||
if (isListened < 1) {
|
Fluttertoast.showToast(
|
||||||
await _markListened(
|
msg: s.markListened,
|
||||||
episodes[index]);
|
gravity: ToastGravity.BOTTOM,
|
||||||
audio.setEpisodeState = true;
|
);
|
||||||
Fluttertoast.showToast(
|
}
|
||||||
msg: s.markListened,
|
}),
|
||||||
gravity: ToastGravity.BOTTOM,
|
if (menuList.contains(4))
|
||||||
);
|
FocusedMenuItem(
|
||||||
}
|
backgroundColor:
|
||||||
})
|
context.brightness == Brightness.light
|
||||||
: null,
|
? context.primaryColor
|
||||||
menuList.contains(4)
|
: context.dialogBackgroundColor,
|
||||||
? FocusedMenuItem(
|
title: isDownloaded
|
||||||
backgroundColor: context.brightness ==
|
? Text(s.downloaded,
|
||||||
Brightness.light
|
style: TextStyle(
|
||||||
? context.primaryColor
|
color: context.textColor
|
||||||
: context.dialogBackgroundColor,
|
.withOpacity(0.5)))
|
||||||
title: isDownloaded
|
: Text(s.download),
|
||||||
? Text(s.downloaded,
|
trailingIcon: Icon(
|
||||||
style: TextStyle(
|
LineIcons.download_solid,
|
||||||
color: context.textColor
|
color: Colors.green),
|
||||||
.withOpacity(0.5)))
|
onPressed: () {
|
||||||
: Text(s.download),
|
if (!isDownloaded) {
|
||||||
trailingIcon: Icon(
|
_requestDownload(context,
|
||||||
LineIcons.download_solid,
|
episode: episodes[index]);
|
||||||
color: Colors.green),
|
// downloader
|
||||||
onPressed: () {
|
// .startTask(episodes[index]);
|
||||||
if (!isDownloaded) {
|
}
|
||||||
_requestDownload(context,
|
}),
|
||||||
episode: episodes[index]);
|
if (menuList.contains(5))
|
||||||
// downloader
|
FocusedMenuItem(
|
||||||
// .startTask(episodes[index]);
|
backgroundColor:
|
||||||
}
|
context.brightness == Brightness.light
|
||||||
})
|
? context.primaryColor
|
||||||
: null
|
: 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(
|
action: () => Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "Playing",
|
"playing": "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": "Plugins",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "Reproduciendo",
|
"playing": "Reproduciendo",
|
||||||
"@playing": {},
|
"@playing": {},
|
||||||
|
"playNext": "",
|
||||||
|
"@playNext": {
|
||||||
|
"description": "Popup menu for episode."
|
||||||
|
},
|
||||||
|
"playNextDes": "",
|
||||||
|
"@playNextDes": {
|
||||||
|
"description": "Description for next play."
|
||||||
|
},
|
||||||
"plugins": "Plugins",
|
"plugins": "Plugins",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "En cours",
|
"playing": "En cours",
|
||||||
"@playing": {},
|
"@playing": {},
|
||||||
|
"playNext": "",
|
||||||
|
"@playNext": {
|
||||||
|
"description": "Popup menu for episode."
|
||||||
|
},
|
||||||
|
"playNextDes": "",
|
||||||
|
"@playNextDes": {
|
||||||
|
"description": "Description for next play."
|
||||||
|
},
|
||||||
"plugins": "Plugins",
|
"plugins": "Plugins",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "In riproduzione",
|
"playing": "In riproduzione",
|
||||||
"@playing": {},
|
"@playing": {},
|
||||||
|
"playNext": "",
|
||||||
|
"@playNext": {
|
||||||
|
"description": "Popup menu for episode."
|
||||||
|
},
|
||||||
|
"playNextDes": "",
|
||||||
|
"@playNextDes": {
|
||||||
|
"description": "Description for next play."
|
||||||
|
},
|
||||||
"plugins": "Plugin",
|
"plugins": "Plugin",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcast}}",
|
"podcast": "{count, plural, zero{} one{Podcast} other{Podcast}}",
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "Em reprodução",
|
"playing": "Em reprodução",
|
||||||
"@playing": {},
|
"@playing": {},
|
||||||
|
"playNext": "",
|
||||||
|
"@playNext": {
|
||||||
|
"description": "Popup menu for episode."
|
||||||
|
},
|
||||||
|
"playNextDes": "",
|
||||||
|
"@playNextDes": {
|
||||||
|
"description": "Description for next play."
|
||||||
|
},
|
||||||
"plugins": "Plugins",
|
"plugins": "Plugins",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
"podcast": "{count, plural, zero{} one{Podcast} other{Podcasts}}",
|
||||||
|
|
|
@ -364,6 +364,14 @@
|
||||||
"@playerHeightTall": {},
|
"@playerHeightTall": {},
|
||||||
"playing": "正在播放",
|
"playing": "正在播放",
|
||||||
"@playing": {},
|
"@playing": {},
|
||||||
|
"playNext": "下一首",
|
||||||
|
"@playNext": {
|
||||||
|
"description": "Popup menu for episode."
|
||||||
|
},
|
||||||
|
"playNextDes": "添加节目到播放列表的顶部",
|
||||||
|
"@playNextDes": {
|
||||||
|
"description": "Description for next play."
|
||||||
|
},
|
||||||
"plugins": "插件",
|
"plugins": "插件",
|
||||||
"@plugins": {},
|
"@plugins": {},
|
||||||
"podcast": "{count, plural, zero{} other{播客}}",
|
"podcast": "{count, plural, zero{} other{播客}}",
|
||||||
|
|
|
@ -132,9 +132,10 @@ class KeyValueStorage {
|
||||||
Future<List<int>> getMenu() async {
|
Future<List<int>> getMenu() async {
|
||||||
var prefs = await SharedPreferences.getInstance();
|
var prefs = await SharedPreferences.getInstance();
|
||||||
if (prefs.getStringList(key) == null || prefs.getStringList(key).isEmpty) {
|
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);
|
var list = prefs.getStringList(key);
|
||||||
|
if(list.length == 5) list = [...list,'15'];
|
||||||
return list.map(int.parse).toList();
|
return list.map(int.parse).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ class _PopupMenuSettingState extends State<PopupMenuSetting> {
|
||||||
)),
|
)),
|
||||||
FutureBuilder<List<int>>(
|
FutureBuilder<List<int>>(
|
||||||
future: _getEpisodeMenu(),
|
future: _getEpisodeMenu(),
|
||||||
initialData: [0, 1, 12, 13, 14],
|
initialData: [0, 1, 12, 13, 14, 15],
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
var menu = snapshot.data;
|
var menu = snapshot.data;
|
||||||
return Expanded(
|
return Expanded(
|
||||||
|
@ -206,8 +206,15 @@ class _PopupMenuSettingState extends State<PopupMenuSetting> {
|
||||||
text: s.download,
|
text: s.download,
|
||||||
description: s.popupMenuDownloadDes);
|
description: s.popupMenuDownloadDes);
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
return _popupMenuItem(menu, e,
|
||||||
|
icon: Icon(LineIcons.bolt_solid,
|
||||||
|
color: Colors.amber,),
|
||||||
|
text: s.playNext,
|
||||||
|
description: s.playNextDes);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return Text('Text');
|
return Center();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
|
@ -666,139 +666,152 @@ class EpisodeGrid extends StatelessWidget {
|
||||||
audio.episodeLoad(episodes[index]);
|
audio.episodeLoad(episodes[index]);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
menuList.contains(1)
|
if (menuList.contains(1))
|
||||||
? FocusedMenuItem(
|
FocusedMenuItem(
|
||||||
backgroundColor: context.brightness ==
|
backgroundColor: context.brightness ==
|
||||||
Brightness.light
|
Brightness.light
|
||||||
? context.primaryColor
|
? context.primaryColor
|
||||||
: context.dialogBackgroundColor,
|
: context.dialogBackgroundColor,
|
||||||
title: data.item2.contains(
|
title: data.item2.contains(
|
||||||
episodes[index].enclosureUrl)
|
episodes[index].enclosureUrl)
|
||||||
? Text(s.remove)
|
? Text(s.remove)
|
||||||
: Text(s.later),
|
: Text(s.later),
|
||||||
trailingIcon: Icon(
|
trailingIcon: Icon(
|
||||||
LineIcons.clock_solid,
|
LineIcons.clock_solid,
|
||||||
color: Colors.cyan,
|
color: Colors.cyan,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (!data.item2.contains(
|
if (!data.item2.contains(
|
||||||
episodes[index].enclosureUrl)) {
|
episodes[index].enclosureUrl)) {
|
||||||
audio.addToPlaylist(
|
audio
|
||||||
episodes[index]);
|
.addToPlaylist(episodes[index]);
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: s.toastAddPlaylist,
|
msg: s.toastAddPlaylist,
|
||||||
gravity: ToastGravity.BOTTOM,
|
gravity: ToastGravity.BOTTOM,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
audio.delFromPlaylist(
|
audio.delFromPlaylist(
|
||||||
episodes[index]);
|
episodes[index]);
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: s.toastRemovePlaylist,
|
msg: s.toastRemovePlaylist,
|
||||||
gravity: ToastGravity.BOTTOM,
|
gravity: ToastGravity.BOTTOM,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
: null,
|
if (menuList.contains(2))
|
||||||
menuList.contains(2)
|
FocusedMenuItem(
|
||||||
? FocusedMenuItem(
|
backgroundColor: context.brightness ==
|
||||||
backgroundColor: context.brightness ==
|
Brightness.light
|
||||||
Brightness.light
|
? context.primaryColor
|
||||||
? context.primaryColor
|
: context.dialogBackgroundColor,
|
||||||
: context.dialogBackgroundColor,
|
title: isLiked
|
||||||
title: isLiked
|
? Text(s.unlike)
|
||||||
? Text(s.unlike)
|
: Text(s.like),
|
||||||
: Text(s.like),
|
trailingIcon: Icon(LineIcons.heart,
|
||||||
trailingIcon: Icon(LineIcons.heart,
|
color: Colors.red, size: 21),
|
||||||
color: Colors.red, size: 21),
|
onPressed: () async {
|
||||||
onPressed: () async {
|
if (isLiked) {
|
||||||
if (isLiked) {
|
await _setUnliked(
|
||||||
await _setUnliked(
|
episodes[index].enclosureUrl);
|
||||||
episodes[index].enclosureUrl);
|
audio.setEpisodeState = true;
|
||||||
audio.setEpisodeState = true;
|
Fluttertoast.showToast(
|
||||||
Fluttertoast.showToast(
|
msg: s.unliked,
|
||||||
msg: s.unliked,
|
gravity: ToastGravity.BOTTOM,
|
||||||
gravity: ToastGravity.BOTTOM,
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
await _saveLiked(
|
||||||
await _saveLiked(
|
episodes[index].enclosureUrl);
|
||||||
episodes[index].enclosureUrl);
|
audio.setEpisodeState = true;
|
||||||
audio.setEpisodeState = true;
|
Fluttertoast.showToast(
|
||||||
Fluttertoast.showToast(
|
msg: s.liked,
|
||||||
msg: s.liked,
|
gravity: ToastGravity.BOTTOM,
|
||||||
gravity: ToastGravity.BOTTOM,
|
);
|
||||||
);
|
}
|
||||||
}
|
}),
|
||||||
})
|
if (menuList.contains(3))
|
||||||
: null,
|
FocusedMenuItem(
|
||||||
menuList.contains(3)
|
backgroundColor: context.brightness ==
|
||||||
? FocusedMenuItem(
|
Brightness.light
|
||||||
backgroundColor: context.brightness ==
|
? context.primaryColor
|
||||||
Brightness.light
|
: context.dialogBackgroundColor,
|
||||||
? context.primaryColor
|
title: isListened > 0
|
||||||
: context.dialogBackgroundColor,
|
? Text(s.markNotListened,
|
||||||
title: isListened > 0
|
style: TextStyle(
|
||||||
? Text(s.markNotListened,
|
color: context.textColor
|
||||||
style: TextStyle(
|
.withOpacity(0.5)))
|
||||||
color: context.textColor
|
: Text(
|
||||||
.withOpacity(0.5)))
|
s.markListened,
|
||||||
: Text(
|
maxLines: 1,
|
||||||
s.markListened,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
),
|
||||||
overflow:
|
trailingIcon: SizedBox(
|
||||||
TextOverflow.ellipsis,
|
width: 23,
|
||||||
),
|
height: 23,
|
||||||
trailingIcon: SizedBox(
|
child: CustomPaint(
|
||||||
width: 23,
|
painter: ListenedAllPainter(
|
||||||
height: 23,
|
Colors.blue,
|
||||||
child: CustomPaint(
|
stroke: 1.5)),
|
||||||
painter: ListenedAllPainter(
|
),
|
||||||
Colors.blue,
|
onPressed: () async {
|
||||||
stroke: 1.5)),
|
if (isListened < 1) {
|
||||||
),
|
await _markListened(
|
||||||
onPressed: () async {
|
episodes[index]);
|
||||||
if (isListened < 1) {
|
audio.setEpisodeState = true;
|
||||||
await _markListened(
|
Fluttertoast.showToast(
|
||||||
episodes[index]);
|
msg: s.markListened,
|
||||||
audio.setEpisodeState = true;
|
gravity: ToastGravity.BOTTOM,
|
||||||
Fluttertoast.showToast(
|
);
|
||||||
msg: s.markListened,
|
} else {
|
||||||
gravity: ToastGravity.BOTTOM,
|
await _markNotListened(
|
||||||
);
|
episodes[index].enclosureUrl);
|
||||||
} else {
|
audio.setEpisodeState = true;
|
||||||
await _markNotListened(
|
Fluttertoast.showToast(
|
||||||
episodes[index].enclosureUrl);
|
msg: s.markNotListened,
|
||||||
audio.setEpisodeState = true;
|
gravity: ToastGravity.BOTTOM,
|
||||||
Fluttertoast.showToast(
|
);
|
||||||
msg: s.markNotListened,
|
}
|
||||||
gravity: ToastGravity.BOTTOM,
|
}),
|
||||||
);
|
if (menuList.contains(4))
|
||||||
}
|
FocusedMenuItem(
|
||||||
})
|
backgroundColor: context.brightness ==
|
||||||
: null,
|
Brightness.light
|
||||||
menuList.contains(4)
|
? context.primaryColor
|
||||||
? FocusedMenuItem(
|
: context.dialogBackgroundColor,
|
||||||
backgroundColor: context.brightness ==
|
title: isDownloaded
|
||||||
Brightness.light
|
? Text(s.downloaded,
|
||||||
? context.primaryColor
|
style: TextStyle(
|
||||||
: context.dialogBackgroundColor,
|
color: context.textColor
|
||||||
title: isDownloaded
|
.withOpacity(0.5)))
|
||||||
? Text(s.downloaded,
|
: Text(s.download),
|
||||||
style: TextStyle(
|
trailingIcon: Icon(
|
||||||
color: context.textColor
|
LineIcons.download_solid,
|
||||||
.withOpacity(0.5)))
|
color: Colors.green),
|
||||||
: Text(s.download),
|
onPressed: () async {
|
||||||
trailingIcon: Icon(
|
if (!isDownloaded) {
|
||||||
LineIcons.download_solid,
|
await _requestDownload(context,
|
||||||
color: Colors.green),
|
episode: episodes[index]);
|
||||||
onPressed: () async {
|
// downloader
|
||||||
if (!isDownloaded) {
|
// .startTask(episodes[index]);
|
||||||
await _requestDownload(context,
|
}
|
||||||
episode: episodes[index]);
|
}),
|
||||||
// downloader
|
if (menuList.contains(5))
|
||||||
// .startTask(episodes[index]);
|
FocusedMenuItem(
|
||||||
}
|
backgroundColor: context.brightness ==
|
||||||
})
|
Brightness.light
|
||||||
: null
|
? 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,
|
action: action,
|
||||||
child: _episodeCard(context,
|
child: _episodeCard(context,
|
||||||
|
|
Loading…
Reference in New Issue