通知中心封面图显示
部分界面的信息更新 缓存系统初步引入 即将进入播放列表更新
This commit is contained in:
@@ -130,9 +130,34 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(
|
||||
PopupMenuButton<String>(
|
||||
icon: const Icon(Icons.more_vert, color: Colors.white54),
|
||||
onPressed: () {},
|
||||
onSelected: (value) async {
|
||||
if (value == 'clear_cache') {
|
||||
final service = context.read<AudioService>();
|
||||
await service.clearCurrentSongCache();
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('缓存已清除,重新加载中...'),
|
||||
backgroundColor: Colors.orange,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
itemBuilder: (context) => [
|
||||
const PopupMenuItem(
|
||||
value: 'clear_cache',
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.cleaning_services, color: Colors.redAccent),
|
||||
SizedBox(width: 12),
|
||||
Text('清除缓存'),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user