|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import '../../../core/utils/logger.dart'; |
|
|
import '../../../core/utils/logger.dart'; |
|
|
import '../../agent/controllers/agent_controller.dart'; |
|
|
import '../../agent/controllers/agent_controller.dart'; |
|
|
import '../../agent/views/circular_progress_button.dart'; |
|
|
import '../../agent/widgets/circular_progress_button.dart'; |
|
|
|
|
|
|
|
|
class MusicPlaylistView extends StatelessWidget { |
|
|
class MusicPlaylistView extends StatelessWidget { |
|
|
const MusicPlaylistView({Key? key}) : super(key: key); |
|
|
const MusicPlaylistView({Key? key}) : super(key: key); |
|
|
@ -115,7 +115,9 @@ class MusicPlaylistView extends StatelessWidget { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
final title = currentSong['name'] ?? currentSong['title'] ?? 'unknownSong'.tr; // 未知歌曲 |
|
|
final title = currentSong['name'] ?? |
|
|
|
|
|
currentSong['title'] ?? |
|
|
|
|
|
'unknownSong'.tr; // 未知歌曲 |
|
|
final artist = currentSong['singer'] ?? |
|
|
final artist = currentSong['singer'] ?? |
|
|
currentSong['sgener'] ?? |
|
|
currentSong['sgener'] ?? |
|
|
currentSong['artist'] ?? |
|
|
currentSong['artist'] ?? |
|
|
@ -192,7 +194,8 @@ class MusicPlaylistView extends StatelessWidget { |
|
|
final id = item["id"] ?? 0; |
|
|
final id = item["id"] ?? 0; |
|
|
final name = item["name"] ?? 'unknownSong'.tr; // 未知歌曲 |
|
|
final name = item["name"] ?? 'unknownSong'.tr; // 未知歌曲 |
|
|
final url = item["url"] ?? ""; |
|
|
final url = item["url"] ?? ""; |
|
|
final singer = item["singer"] ?? item["sgener"] ?? 'unknownArtist'.tr; // 未知歌手 |
|
|
final singer = |
|
|
|
|
|
item["singer"] ?? item["sgener"] ?? 'unknownArtist'.tr; // 未知歌手 |
|
|
final image = item["image"] ?? ""; |
|
|
final image = item["image"] ?? ""; |
|
|
|
|
|
|
|
|
return _buildMusicItem( |
|
|
return _buildMusicItem( |
|
|
@ -628,8 +631,8 @@ class MusicPlaylistView extends StatelessWidget { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 播放选中的歌曲 |
|
|
// 播放选中的歌曲 |
|
|
Future<void> _playSelectedSong(AgentController controller, Map<String, dynamic> song, |
|
|
Future<void> _playSelectedSong(AgentController controller, |
|
|
List<Map<String, dynamic>> playlist) async { |
|
|
Map<String, dynamic> song, List<Map<String, dynamic>> playlist) async { |
|
|
// 防止重复点击导致的状态混乱 |
|
|
// 防止重复点击导致的状态混乱 |
|
|
if (controller.isLoadingMusic.value) { |
|
|
if (controller.isLoadingMusic.value) { |
|
|
return; |
|
|
return; |
|
|
|