Merge branch 'refs/heads/dev2'

# Conflicts:
#	pubspec.lock
master
Spark 2 weeks ago
commit b76c58a7fb

@ -0,0 +1,2 @@
#Sun Oct 27 00:29:01 HKT 2024
java.home=E\:\\Program Files\\Android\\Android Studio\\jbr

@ -0,0 +1,8 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sun Oct 27 00:29:01 HKT 2024
sdk.dir=E\:\\Android\\Sdk

@ -1,11 +1,18 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/central'}
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/spring'}
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/apache-snapshots'}
google()
mavenCentral()
}
dependencies {
//
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
@ -13,8 +20,16 @@ buildscript {
allprojects {
repositories {
// 使Maven
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/central'}
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/spring'}
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/apache-snapshots'}
google()
mavenCentral()
mavenCentral()
}
}

Binary file not shown.

Binary file not shown.

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=file:///E:/Flutter/MusicAPP/android/gradle/wrapper/gradle-7.5-all.zip

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -12,6 +12,8 @@ import '../common_widget/Song_widegt.dart';
import '../common_widget/list_cell.dart';
import '../models/getMusicList_bean.dart';
import 'music_view.dart';
import '../api/api_music_likes.dart'; // API
import '../models/universal_bean.dart';
class HomeView extends StatefulWidget {
const HomeView({super.key});
@ -42,15 +44,6 @@ class _HomeViewState extends State<HomeView> {
setState(() {
songs = [
Song(
artistPic: bean1.coverPath!,
title: bean1.name!,
artist: bean1.singerName!,
musicurl: bean1.musicPath!,
pic: bean1.coverPath!,
id: bean1.id!,
likes: bean1.likeOrNot!,
collection: bean1.collectOrNot!),
Song(
artistPic: bean2.coverPath!,
title: bean2.name!,
@ -337,110 +330,128 @@ class _HomeViewState extends State<HomeView> {
Future _bottomSheet(BuildContext context, int index) {
return showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container(
height: 210,
padding: const EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_add.png"),
iconSize: 60,
),
const Text("加入歌单")
],
),
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_download.png"),
iconSize: 60,
),
const Text("下载")
],
),
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_collection.png"),
iconSize: 60,
),
const Text("收藏")
],
),
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_good.png"),
iconSize: 60,
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30)),
),
builder: (context) => StatefulBuilder( // 使StatefulBuilder便
builder: (context, setState) {
bool likesnot = false; //
return Container(
height: 210,
padding: const EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_add.png"),
iconSize: 60,
),
const Text("加入歌单"),
],
),
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_download.png"),
iconSize: 60,
),
const Text("下载"),
],
),
Column(
children: [
IconButton(
onPressed: () {},
icon: Image.asset("assets/img/list_collection.png"),
iconSize: 60,
),
const Text("收藏"),
],
),
Column(
children: [
IconButton(
onPressed: (){},
icon: Image.asset("assets/img/list_good.png"),
iconSize: 60,
),
Text("点赞")
],
),
Column(
children: [
IconButton(
onPressed: () {
Get.to(() => CommentView(
initialSongIndex: index,
));
},
icon: Image.asset("assets/img/list_comment.png"),
iconSize: 60,
),
const Text("评论"),
],
),
],
),
const SizedBox(
height: 10,
),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
const Text("点赞")
],
);
},
child: const Text(
"查看详情页",
style: TextStyle(color: Colors.black, fontSize: 18),
),
Column(
children: [
IconButton(
onPressed: () {
Get.to(() => CommentView(
initialSongIndex: index,
));
},
icon: Image.asset("assets/img/list_comment.png"),
iconSize: 60,
),
const Text("评论")
],
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xffE6F4F1),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
],
),
const SizedBox(
height: 10,
),
ElevatedButton(
onPressed: () {},
child: const Text(
"查看详情页",
style: TextStyle(color: Colors.black, fontSize: 18),
),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xffE6F4F1),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
),
),
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
),
),
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
),
),
],
),
));
],
),
);
},
),
);
}
}

@ -5,6 +5,8 @@ import '../api/api_music_rank.dart';
import '../common_widget/rank_song_row.dart';
import '../models/getRank_bean.dart';
import '../view_model/rank_view_model.dart';
import 'music_view.dart';
import '../common_widget/Song_widegt.dart';
class RankView extends StatefulWidget {
const RankView({super.key});
@ -19,6 +21,7 @@ class _RankViewState extends State<RankView> {
List rankSingerName = [];
List rankCoverPath = [];
List rankMusicPath = [];
List<Song> songs = [];
void initState() {
super.initState();
@ -32,6 +35,24 @@ class _RankViewState extends State<RankView> {
rankSingerName = bean2.data!.map((data) => data.singerName!).toList();
rankCoverPath = bean2.data!.map((data) => data.coverPath!).toList();
rankMusicPath = bean2.data!.map((data) => data.musicPath!).toList();
if (rankNames.isNotEmpty &&
rankNames.length == rankSingerName.length &&
rankNames.length == rankCoverPath.length &&
rankNames.length == rankMusicPath.length) {
for (int i = 0; i < rankNames.length; i++) {
songs.add(Song(
artistPic: rankCoverPath[i],
title: rankNames[i],
artist: rankSingerName[i],
musicurl: rankMusicPath[i],
pic: rankCoverPath[i],
id: i,
likes: false,
collection: false,
));
}
}
});
}
@ -132,6 +153,17 @@ class _RankViewState extends State<RankView> {
itemBuilder: (context, index) {
int rankNum = index + 1;
return ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
);
},
title: Column(
children: [
Row(
@ -202,12 +234,16 @@ class _RankViewState extends State<RankView> {
),
IconButton(
onPressed: () {
_bottomSheet(context);
_bottomSheet(context, index); // index
},
icon: Image.asset(
"assets/img/More.png",
'assets/img/More.png',
width: 25,
height: 25,
errorBuilder: (context, error, stackTrace) {
print('Error loading image: $error');
return const Icon(Icons.error, size: 25); // 使 const
},
),
),
const SizedBox(
@ -231,7 +267,7 @@ class _RankViewState extends State<RankView> {
),
);
}
Future _bottomSheet(BuildContext context){
Future _bottomSheet(BuildContext context, int index){
return showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
@ -300,7 +336,15 @@ class _RankViewState extends State<RankView> {
const SizedBox(height: 10,),
ElevatedButton(
onPressed: () {
// Get.to(()=>const MainTabView());
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
);
},
child: Text(
"查看详情页",

@ -406,73 +406,75 @@ class _UserViewState extends State<UserView> {
///--退
Future _bottomSheet(BuildContext context) {
return showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container(
height: 200,
padding: const EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
IconButton(
onPressed: () {
Get.to(const UserInfo());
},
icon: Image.asset("assets/img/user_infor.png"),
iconSize: 60,
),
const Text("账户信息")
],
),
Column(
children: [
IconButton(
onPressed: () async {
UniversalBean bean = await LogoutApiClient()
.logout(
Authorization: AppData().currentToken);
if (bean.code == 200) {
Get.to(const BeginView());
}
},
icon: Image.asset("assets/img/user_out.png"),
iconSize: 60,
),
const Text("退出登录")
],
),
],
),
const SizedBox(
height: 30,
),
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 14),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30)),
),
isScrollControlled: true, //
builder: (context) => Padding(
padding: const EdgeInsets.only(top: 20),
child: Column(
mainAxisSize: MainAxisSize.min, // 使Column
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
IconButton(
onPressed: () {
Get.to(const UserInfo());
},
icon: Image.asset("assets/img/user_infor.png"),
iconSize: 60,
),
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
const Text("账户信息")
],
),
Column(
children: [
IconButton(
onPressed: () async {
UniversalBean bean = await LogoutApiClient().logout(
Authorization: AppData().currentToken,
);
if (bean.code == 200) {
Get.to(const BeginView());
}
},
icon: Image.asset("assets/img/user_out.png"),
iconSize: 60,
),
),
],
const Text("退出登录")
],
),
],
),
const SizedBox(height: 30),
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 14),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
));
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
),
),
],
),
),
);
}
///--
void _showAddPlaylistDialog() {
_controller.clear();

Loading…
Cancel
Save