fix: 修复合并后出现的一些Bug,调整了一些样式

master
Spark 1 week ago
parent 08a374f864
commit 874c491b0d

@ -231,7 +231,7 @@ class _HomeViewState extends State<HomeView> {
], ],
), ),
), ),
const SizedBox(height: 10,),
/// ///
Container( Container(
padding: const EdgeInsets.only(left: 20, right: 20, top: 10), padding: const EdgeInsets.only(left: 20, right: 20, top: 10),
@ -319,14 +319,16 @@ class _HomeViewState extends State<HomeView> {
), ),
), ),
const SizedBox(height: 10,),
///+ ///+
Container( Container(
padding: const EdgeInsets.only(left: 20, right: 20, top: 10), padding: const EdgeInsets.only(left: 20, right: 20, top: 10),
child: const Text( child: const Text(
'每日推荐', '每日推荐',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
), ),
), ),
const SizedBox(height: 5,),
Container( Container(
padding: const EdgeInsets.only(left: 20, right: 20, top: 5), padding: const EdgeInsets.only(left: 20, right: 20, top: 5),
height: 186, height: 186,
@ -334,15 +336,18 @@ class _HomeViewState extends State<HomeView> {
child: MySwiperWidget, child: MySwiperWidget,
), ),
const SizedBox(height: 10),
/// ///
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: const EdgeInsets.only(left: 20, right: 20, top: 5), padding: const EdgeInsets.only(left: 20, right: 20, top: 5),
child: const Text( child: const Text(
'精选歌曲', '精选歌曲',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
), ),
), ),
const SizedBox(height: 5,),
ListView.builder( ListView.builder(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: selectedSongs.length, itemCount: selectedSongs.length,
@ -388,14 +393,16 @@ class _HomeViewState extends State<HomeView> {
}, },
), ),
const SizedBox(height: 10,),
/// ///
Container( Container(
padding: const EdgeInsets.only(left: 20, right: 20, top: 5), padding: const EdgeInsets.only(left: 20, right: 20, top: 5),
child: const Text( child: const Text(
'精选歌单', '精选歌单',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
), ),
), ),
const SizedBox(height: 5,),
SizedBox( SizedBox(
height: 180, height: 180,
child: ListView.builder( child: ListView.builder(
@ -483,6 +490,7 @@ class _HomeViewState extends State<HomeView> {
children: [ children: [
IconButton( IconButton(
onPressed: () { onPressed: () {
Navigator.pop(context);
Get.to(() => CommentView( Get.to(() => CommentView(
initialSongIndex: index, initialSongIndex: index,
)); ));

@ -25,6 +25,7 @@ class _RankViewState extends State<RankView> {
final downloadManager = Get.put(DownloadManager()); final downloadManager = Get.put(DownloadManager());
@override
void initState() { void initState() {
super.initState(); super.initState();
_fetchSonglistData(); _fetchSonglistData();
@ -187,7 +188,7 @@ class _RankViewState extends State<RankView> {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: rankNum.toString(), text: rankNum.toString(),
style: TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xffCE0000), color: Color(0xffCE0000),
@ -221,7 +222,7 @@ class _RankViewState extends State<RankView> {
Text( Text(
rankNames[index], rankNames[index],
maxLines: 1, maxLines: 1,
style: TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
fontWeight: fontWeight:
@ -230,7 +231,7 @@ class _RankViewState extends State<RankView> {
Text( Text(
rankSingerName[index], rankSingerName[index],
maxLines: 1, maxLines: 1,
style: TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14), fontSize: 14),
) )
@ -298,7 +299,7 @@ class _RankViewState extends State<RankView> {
icon: Image.asset("assets/img/list_add.png"), icon: Image.asset("assets/img/list_add.png"),
iconSize: 60, iconSize: 60,
), ),
Text("加入歌单") const Text("加入歌单")
], ],
), ),
Column( Column(
@ -308,7 +309,7 @@ class _RankViewState extends State<RankView> {
icon: Image.asset("assets/img/list_download.png"), icon: Image.asset("assets/img/list_download.png"),
iconSize: 60, iconSize: 60,
), ),
Text("下载") const Text("下载")
], ],
), ),
Column( Column(
@ -318,7 +319,7 @@ class _RankViewState extends State<RankView> {
icon: Image.asset("assets/img/list_collection.png"), icon: Image.asset("assets/img/list_collection.png"),
iconSize: 60, iconSize: 60,
), ),
Text("收藏") const Text("收藏")
], ],
), ),
Column( Column(
@ -328,17 +329,19 @@ class _RankViewState extends State<RankView> {
icon: Image.asset("assets/img/list_good.png"), icon: Image.asset("assets/img/list_good.png"),
iconSize: 60, iconSize: 60,
), ),
Text("点赞") const Text("点赞")
], ],
), ),
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: (){
Navigator.pop(context);
},
icon: Image.asset("assets/img/list_comment.png"), icon: Image.asset("assets/img/list_comment.png"),
iconSize: 60, iconSize: 60,
), ),
Text("评论") const Text("评论")
], ],
), ),
], ],

@ -6,7 +6,6 @@ import '../../api/api_client.dart';
import '../../api/api_client_info.dart'; import '../../api/api_client_info.dart';
import '../../common_widget/app_data.dart'; import '../../common_widget/app_data.dart';
import '../../view_model/home_view_model.dart'; import '../../view_model/home_view_model.dart';
import '../../view/main_tab_view/main_tab_view.dart';
class UserInfo extends StatefulWidget { class UserInfo extends StatefulWidget {
const UserInfo({super.key}); const UserInfo({super.key});
@ -37,17 +36,7 @@ class _UserInfoState extends State<UserInfo> {
elevation: 0, elevation: 0,
leading: IconButton( leading: IconButton(
onPressed: () { onPressed: () {
// MainTabView Get.back(result: true);
Get.back(); //
//
Future.delayed(Duration(milliseconds: 100), () {
// MainTabView TabController
final mainTabController = Get.find<MainTabView>().getController(context);
if (mainTabController != null) {
mainTabController.index = 3; //
}
});
}, },
icon: Image.asset( icon: Image.asset(
"assets/img/back.png", "assets/img/back.png",
@ -171,7 +160,7 @@ class _UserInfoState extends State<UserInfo> {
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: 132, height: 80,
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -208,21 +197,6 @@ class _UserInfoState extends State<UserInfo> {
style: TextStyle(color: Colors.black, fontSize: 18), style: TextStyle(color: Colors.black, fontSize: 18),
), ),
), ),
ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 18),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
),
),
child: const Text(
"取消",
style: TextStyle(color: Colors.black, fontSize: 18),
),
),
], ],
), ),
), ),
@ -245,7 +219,11 @@ class _UserInfoState extends State<UserInfo> {
), ),
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
onPressed: () { onPressed: () async {
_updateNickname();
await ChangeApiClient().changeName(
Authorization: AppData().currentToken,
userName: AppData().currentUsername);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
@ -256,16 +234,12 @@ class _UserInfoState extends State<UserInfo> {
), ),
), ),
child: const Text( child: const Text(
"取消", "保存",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
TextButton( TextButton(
onPressed: () async { onPressed: () {
_updateNickname();
await ChangeApiClient().changeName(
Authorization: AppData().currentToken,
userName: AppData().currentUsername);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
@ -276,7 +250,7 @@ class _UserInfoState extends State<UserInfo> {
), ),
), ),
child: const Text( child: const Text(
"保存", "取消",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),

@ -31,6 +31,8 @@ class _UserViewState extends State<UserView> {
List playlistNames = []; List playlistNames = [];
List playlistid = []; List playlistid = [];
int downloadCount = 0; int downloadCount = 0;
String avatar = AppData().currentAvatar;
String username = AppData().currentUsername;
final downloadManager = Get.put(DownloadManager()); final downloadManager = Get.put(DownloadManager());
@ -85,7 +87,7 @@ class _UserViewState extends State<UserView> {
Row( Row(
children: [ children: [
Image.network( Image.network(
AppData().currentAvatar, avatar,
width: 64, width: 64,
height: 64, height: 64,
), ),
@ -93,7 +95,7 @@ class _UserViewState extends State<UserView> {
width: 25, width: 25,
), ),
Text( Text(
AppData().currentUsername, username,
style: const TextStyle(fontSize: 20), style: const TextStyle(fontSize: 20),
) )
], ],
@ -424,8 +426,15 @@ class _UserViewState extends State<UserView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: () { onPressed: () async {
Get.to(const UserInfo()); Navigator.pop(context);
bool result = await Get.to(const UserInfo());
if (result) {
setState(() {
avatar = AppData().currentAvatar;
username = AppData().currentUsername;
});
}
}, },
icon: Image.asset("assets/img/user_infor.png"), icon: Image.asset("assets/img/user_infor.png"),
iconSize: 60, iconSize: 60,
@ -437,6 +446,7 @@ class _UserViewState extends State<UserView> {
children: [ children: [
IconButton( IconButton(
onPressed: () async { onPressed: () async {
Navigator.pop(context);
UniversalBean bean = await LogoutApiClient().logout( UniversalBean bean = await LogoutApiClient().logout(
Authorization: AppData().currentToken, Authorization: AppData().currentToken,
); );
@ -453,21 +463,6 @@ class _UserViewState extends State<UserView> {
], ],
), ),
const SizedBox(height: 30), 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),
),
),
], ],
), ),
), ),

Loading…
Cancel
Save