fix: 修复合并后出现的一些BUG,修复排行榜更多按钮溢出,移除更多弹出面板中的“查看详细”和“取消”按钮,修复底部菜单栏溢出的问题,

master
Spark 2 weeks ago
parent b76c58a7fb
commit 0f0341fc19

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

@ -1,8 +0,0 @@
## 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,18 +1,11 @@
buildscript { buildscript {
ext.kotlin_version = '1.7.10' ext.kotlin_version = '1.7.10'
repositories { 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() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
//
classpath 'com.android.tools.build:gradle:7.3.0' classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
@ -20,13 +13,6 @@ buildscript {
allprojects { allprojects {
repositories { 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() google()
mavenCentral() mavenCentral()
mavenCentral() mavenCentral()

Binary file not shown.

Binary file not shown.

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

@ -12,8 +12,6 @@ import '../common_widget/Song_widegt.dart';
import '../common_widget/list_cell.dart'; import '../common_widget/list_cell.dart';
import '../models/getMusicList_bean.dart'; import '../models/getMusicList_bean.dart';
import 'music_view.dart'; import 'music_view.dart';
import '../api/api_music_likes.dart'; // API
import '../models/universal_bean.dart';
class HomeView extends StatefulWidget { class HomeView extends StatefulWidget {
const HomeView({super.key}); const HomeView({super.key});
@ -44,6 +42,15 @@ class _HomeViewState extends State<HomeView> {
setState(() { setState(() {
songs = [ 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( Song(
artistPic: bean2.coverPath!, artistPic: bean2.coverPath!,
title: bean2.name!, title: bean2.name!,
@ -340,7 +347,7 @@ class _HomeViewState extends State<HomeView> {
bool likesnot = false; // bool likesnot = false; //
return Container( return Container(
height: 210, height: 150,
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -404,49 +411,6 @@ class _HomeViewState extends State<HomeView> {
), ),
], ],
), ),
const SizedBox(
height: 10,
),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
);
},
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,
),
),
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
),
),
], ],
), ),
); );

@ -5,38 +5,34 @@ import 'package:music_player_miao/view/user/user_view.dart';
import '../home_view.dart'; import '../home_view.dart';
import '../release_view.dart'; import '../release_view.dart';
class MainTabView extends StatefulWidget { class MainTabView extends StatefulWidget {
const MainTabView({super.key}); const MainTabView({super.key});
@override @override
State<MainTabView> createState() => _MainTabViewState(); State<MainTabView> createState() => _MainTabViewState();
} }
class _MainTabViewState extends State<MainTabView> with SingleTickerProviderStateMixin{ class _MainTabViewState extends State<MainTabView> with SingleTickerProviderStateMixin {
TabController? controller; TabController? controller;
int selectTab = 0; int selectTab = 0;
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
controller = TabController(length: 4, vsync: this); controller = TabController(length: 4, vsync: this);
controller?.addListener(() { controller?.addListener(() {
selectTab = controller?.index ?? 0; selectTab = controller?.index ?? 0;
setState(() { setState(() {});
});
}); });
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose
super.dispose(); super.dispose();
controller?.dispose(); controller?.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -51,55 +47,55 @@ class _MainTabViewState extends State<MainTabView> with SingleTickerProviderStat
UserView() UserView()
], ],
), ),
bottomNavigationBar: BottomAppBar( bottomNavigationBar: Container(
color: Colors.white, color: Colors.white,
elevation: 0,
child: TabBar( child: TabBar(
controller: controller, controller: controller,
indicatorColor: Colors.transparent, indicatorColor: Colors.transparent,
indicatorWeight: 3,
labelColor: Colors.black, labelColor: Colors.black,
labelStyle: const TextStyle( labelStyle: const TextStyle(fontSize: 12), //
fontSize: 12
),
unselectedLabelColor: const Color(0xffCDCDCD), unselectedLabelColor: const Color(0xffCDCDCD),
unselectedLabelStyle: const TextStyle( unselectedLabelStyle: const TextStyle(fontSize: 12), //
fontSize: 12
),
tabs: [ tabs: [
Tab( Tab(
text: height: 60, //
"首页", icon: Image.asset(
icon:Image.asset( selectTab == 0 ? "assets/img/home_tab.png" : "assets/img/home_tab_un.png",
selectTab == 0?"assets/img/home_tab.png":"assets/img/home_tab_un.png", width: 32, //
width: 45,height: 45,), height: 32,
),
text: "首页",
), ),
Tab( Tab(
text: height: 60,
"排行榜", icon: Image.asset(
icon:Image.asset( selectTab == 1 ? "assets/img/list_tab.png" : "assets/img/list_tab_un.png",
selectTab == 1?"assets/img/list_tab.png":"assets/img/list_tab_un.png", width: 32,
width: 45,height: 45,), height: 32,
),
text: "排行榜",
), ),
Tab( Tab(
text: height: 60,
"发布", icon: Image.asset(
icon:Image.asset(selectTab == 2?"assets/img/music_tab.png":"assets/img/music_tab_un.png", selectTab == 2 ? "assets/img/music_tab.png" : "assets/img/music_tab_un.png",
width: 45,height: 45,), width: 32,
height: 32,
),
text: "发布",
), ),
Tab( Tab(
text: height: 60,
"个人", icon: Image.asset(
icon:Image.asset(selectTab == 3?"assets/img/user_tab.png":"assets/img/user_tab_un.png", selectTab == 3 ? "assets/img/user_tab.png" : "assets/img/user_tab_un.png",
width: 45,height: 45,), width: 32,
height: 32,
),
text: "个人",
), ),
], ],
), ),
), ),
); );
} }
} }

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:music_player_miao/common_widget/app_data.dart'; import 'package:music_player_miao/common_widget/app_data.dart';
import '../api/api_music_rank.dart'; import '../api/api_music_rank.dart';
import '../common_widget/rank_song_row.dart'; import '../common/download_manager.dart';
import '../models/getRank_bean.dart'; import '../models/getRank_bean.dart';
import '../view_model/rank_view_model.dart'; import '../view_model/rank_view_model.dart';
import 'music_view.dart'; import 'music_view.dart';
@ -23,6 +23,8 @@ class _RankViewState extends State<RankView> {
List rankMusicPath = []; List rankMusicPath = [];
List<Song> songs = []; List<Song> songs = [];
final downloadManager = Get.put(DownloadManager());
void initState() { void initState() {
super.initState(); super.initState();
_fetchSonglistData(); _fetchSonglistData();
@ -158,8 +160,16 @@ class _RankViewState extends State<RankView> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MusicView( builder: (context) => MusicView(
song: songs[index], songList: songs,
initialSongIndex: index, initialSongIndex: index,
onSongStatusChanged: (index, isCollected, isLiked) {
setState(() {
//
songs[index].collection = isCollected;
songs[index].likes = isLiked;
downloadManager.updateSongInfo(songs[index].id, isCollected, isLiked);
});
},
), ),
), ),
); );
@ -228,7 +238,7 @@ class _RankViewState extends State<RankView> {
), ),
), ),
const SizedBox( const SizedBox(
width: 20, width: 18,
), ),
], ],
), ),
@ -273,7 +283,7 @@ class _RankViewState extends State<RankView> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(30))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) =>Container( builder: (context) =>Container(
height: 210, height: 150,
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -333,49 +343,6 @@ class _RankViewState extends State<RankView> {
), ),
], ],
), ),
const SizedBox(height: 10,),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MusicView(
song: songs[index],
initialSongIndex: index,
),
),
);
},
child: Text(
"查看详情页",
style: const TextStyle(color:Colors.black,fontSize: 18),
),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xffE6F4F1),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
),
ElevatedButton(
onPressed: () =>Navigator.pop(context),
child: Text(
"取消",
style: const TextStyle(color:Colors.black,fontSize: 18),
),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 8),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
),
], ],
), ),
) )

@ -446,7 +446,7 @@ class _MyDownloadViewState extends State<MyDownloadView> {
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(30))), borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container( builder: (context) => Container(
height: 180, height: 150,
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -499,24 +499,6 @@ class _MyDownloadViewState extends State<MyDownloadView> {
), ),
], ],
), ),
const SizedBox(
height: 22,
),
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),
),
),
], ],
), ),
)); ));

Loading…
Cancel
Save