Compare commits

..

No commits in common. 'cbdad8db5b793aebf08ebffab530605e735f9dc1' and '1bab49f99747edab8591e61fdd740554bc8d60d8' have entirely different histories.

@ -151,7 +151,6 @@ class _UserViewState extends State<UserView> {
], ],
), ),
), ),
const SizedBox( const SizedBox(
height: 10, height: 10,
), ),
@ -196,22 +195,14 @@ class _UserViewState extends State<UserView> {
), ),
], ],
)), )),
/// ///
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'歌单 $playlistCount', '歌单 $playlistCount',
style: const TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 20, fontWeight: FontWeight.w500),
fontWeight: FontWeight.w500
),
), ),
Row( Row(
children: [ children: [
@ -223,73 +214,120 @@ class _UserViewState extends State<UserView> {
"assets/img/user_add.png", "assets/img/user_add.png",
width: 31, width: 31,
color: const Color(0xff404040), color: const Color(0xff404040),
) )),
),
IconButton( IconButton(
onPressed: () {}, onPressed: () {},
icon: Image.asset( icon: Image.asset("assets/img/user_export.png",
"assets/img/user_export.png", width: 31))
width: 31
)
)
], ],
) )
], ],
), ),
Container(
const SizedBox( padding: const EdgeInsets.only(left: 15, right: 15, top: 10, bottom: 5),
height: 10, child: ListView.builder(
), shrinkWrap: true, // 使ListView
itemCount: playlistNames.length, // itemCount
// itemBuilder: (context, index) {
Padding( return InkWell(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Column(
children: List.generate(
playlistNames.length,
(index) => Column(
children: [
InkWell(
onTap: () { onTap: () {
print('点击成功'); print('点击成功');
Get.to(MyMusicView(songlistIdd: playlistid[index])); Get.to(MyMusicView(songlistIdd: playlistid[index]));
//
//
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset("assets/img/artist_pic.png"), Image.asset("assets/img/artist_pic.png"),
const SizedBox(width: 25), Column(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
playlistNames[index], playlistNames[index], //
style: const TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
Text( Text(
'$playlistCount', '$playlistCount', //
style: const TextStyle(fontSize: 16), style: TextStyle(fontSize: 16),
), ),
], ],
), ),
), const SizedBox(width: 80),
Image.asset("assets/img/user_next.png"), Image.asset("assets/img/user_next.png"),
], ],
), ),
);
},
), ),
if (index < playlistNames.length - 1)
const SizedBox(height: 10),
],
), ),
InkWell(
onTap: () {
Get.to(const MyMusicView());
},
child: Column(
children: List.generate(playlistNames.length, (index) {
return Dismissible(
key: Key(playlistNames[index]),
direction: DismissDirection.endToStart,
background: Container(
color: Colors.red,
alignment: Alignment.centerRight,
padding: const EdgeInsets.only(right: 20.0),
child: const Icon(
Icons.delete,
color: Colors.white,
),
),
confirmDismiss: (direction) async {
return await _showDeleteConfirmationDialog(
context, index);
},
onDismissed: (direction) {
setState(() {
playlistNames.removeAt(index);
playlistid.removeAt(index);
playlistCount--;
});
},
child: ListTile(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset("assets/img/artist_pic.png"),
const SizedBox(
width: 30,
), ),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
playlistNames[index],
style: const TextStyle(fontSize: 18),
), ),
const Text(
'0首',
style: TextStyle(fontSize: 18),
), ),
], ],
), ),
],
),
Image.asset(
"assets/img/user_next.png",
)
],
),
),
);
}),
),
), ),
const SizedBox( const SizedBox(
height: 30, height: 20,
), ),
const Text( const Text(
@ -425,19 +463,8 @@ class _UserViewState extends State<UserView> {
content: TextFieldColor(controller: _controller, hintText: '请输入歌单名称'), content: TextFieldColor(controller: _controller, hintText: '请输入歌单名称'),
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
onPressed: () async { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
String enteredSongName = _controller.text;
SonglistBean bean = await SonglistApi().addSonglist(
songlistName: enteredSongName,
Authorization: AppData().currentToken);
if (bean.code == 200) {
print('添加成功');
setState(() {
playlistCount++;
playlistNames.add(enteredSongName);
});
}
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: const Color(0xff429482), backgroundColor: const Color(0xff429482),
@ -447,13 +474,22 @@ class _UserViewState extends State<UserView> {
), ),
), ),
child: const Text( child: const Text(
"确认", "取消",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
String enteredSongName = _controller.text;
playlistCount++;
// Add the new playlist
setState(() {
playlistNames.add(enteredSongName);
});
SonglistBean bean = await SonglistApi().addSonglist(
songlistName: _controller.text,
Authorization: AppData().currentToken);
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: const Color(0xff429482), backgroundColor: const Color(0xff429482),
@ -463,7 +499,7 @@ class _UserViewState extends State<UserView> {
), ),
), ),
child: const Text( child: const Text(
"取消", "确认",
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),

@ -181,10 +181,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: file_selector_linux name: file_selector_linux
sha256: b2b91daf8a68ecfa4a01b778a6f52edef9b14ecd506e771488ea0f2e0784198b sha256: "712ce7fab537ba532c8febdb1a8f167b32441e74acd68c3ccb2e36dcb52c4ab2"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.3+1" version: "0.9.3"
file_selector_macos: file_selector_macos:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save