Merge branch 'refs/heads/dev2'

# Conflicts:
#	pubspec.lock
master
Spark 1 week 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!,
@ -340,8 +333,13 @@ class _HomeViewState extends State<HomeView> {
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container(
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(
@ -357,7 +355,7 @@ class _HomeViewState extends State<HomeView> {
icon: Image.asset("assets/img/list_add.png"),
iconSize: 60,
),
const Text("加入歌单")
const Text("加入歌单"),
],
),
Column(
@ -367,7 +365,7 @@ class _HomeViewState extends State<HomeView> {
icon: Image.asset("assets/img/list_download.png"),
iconSize: 60,
),
const Text("下载")
const Text("下载"),
],
),
Column(
@ -377,17 +375,17 @@ class _HomeViewState extends State<HomeView> {
icon: Image.asset("assets/img/list_collection.png"),
iconSize: 60,
),
const Text("收藏")
const Text("收藏"),
],
),
Column(
children: [
IconButton(
onPressed: () {},
onPressed: (){},
icon: Image.asset("assets/img/list_good.png"),
iconSize: 60,
),
const Text("点赞")
Text("点赞")
],
),
Column(
@ -401,7 +399,7 @@ class _HomeViewState extends State<HomeView> {
icon: Image.asset("assets/img/list_comment.png"),
iconSize: 60,
),
const Text("评论")
const Text("评论"),
],
),
],
@ -410,7 +408,17 @@ class _HomeViewState extends State<HomeView> {
height: 10,
),
ElevatedButton(
onPressed: () {},
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
);
},
child: const Text(
"查看详情页",
style: TextStyle(color: Colors.black, fontSize: 18),
@ -441,6 +449,9 @@ class _HomeViewState extends State<HomeView> {
),
],
),
));
);
},
),
);
}
}

@ -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(
"查看详情页",

@ -409,11 +409,13 @@ class _UserViewState extends State<UserView> {
context: context,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container(
height: 200,
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(
@ -435,9 +437,9 @@ class _UserViewState extends State<UserView> {
children: [
IconButton(
onPressed: () async {
UniversalBean bean = await LogoutApiClient()
.logout(
Authorization: AppData().currentToken);
UniversalBean bean = await LogoutApiClient().logout(
Authorization: AppData().currentToken,
);
if (bean.code == 200) {
Get.to(const BeginView());
}
@ -450,9 +452,7 @@ class _UserViewState extends State<UserView> {
),
],
),
const SizedBox(
height: 30,
),
const SizedBox(height: 30),
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
@ -470,9 +470,11 @@ class _UserViewState extends State<UserView> {
),
],
),
));
),
);
}
///--
void _showAddPlaylistDialog() {
_controller.clear();

Loading…
Cancel
Save