feat: 调整登录页面的一些样式,在注册页面加入验证码发送倒计时

ruan
Spark 3 months ago
parent 5ef4804e2f
commit bbf70c81c6

@ -0,0 +1,65 @@
import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
class PasswordManager {
static const String PREFS_KEY = 'stored_password';
late SharedPreferences _prefs;
//
static final PasswordManager _instance = PasswordManager._internal();
factory PasswordManager() {
return _instance;
}
PasswordManager._internal();
//
Future<void> init() async {
_prefs = await SharedPreferences.getInstance();
}
//
Future<void> savePassword(String username, String password) async {
final Map<String, String> credentials = {
'username': username,
'password': password,
};
await _prefs.setString(PREFS_KEY, json.encode(credentials));
}
//
Map<String, String>? getStoredCredentials() {
final String? storedData = _prefs.getString(PREFS_KEY);
if (storedData != null) {
final Map<String, String> decoded = json.decode(storedData);
return {
'username': decoded['username'] as String,
'password': decoded['password'] as String,
};
}
return null;
}
//
bool hasStoredPassword() {
return _prefs.containsKey(PREFS_KEY);
}
//
Future<void> removePassword() async {
await _prefs.remove(PREFS_KEY);
}
//
String? getStoredUsername() {
final credentials = getStoredCredentials();
return credentials?['username'];
}
//
String? getStoredPassword() {
final credentials = getStoredCredentials();
return credentials?['password'];
}
}

@ -29,7 +29,7 @@ class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/img/app_bg.png"), image: AssetImage("assets/img/app_bg.png"),
fit: BoxFit.cover, fit: BoxFit.cover,
@ -37,11 +37,16 @@ class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
), ),
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: SingleChildScrollView( resizeToAvoidBottomInset: false,
body: ScrollConfiguration(
behavior: ScrollBehavior().copyWith(
physics: const NeverScrollableScrollPhysics(),
),
child: Column( child: Column(
children: [ children: [
//
Padding( Padding(
padding: const EdgeInsets.only(top: 110,left: 40,right: 40), padding: const EdgeInsets.only(top: 110, left: 40, right: 40),
child: Row( child: Row(
children: [ children: [
const Column( const Column(
@ -76,20 +81,19 @@ class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
), ),
], ],
), ),
const SizedBox(width: 25,), const SizedBox(width: 25),
Image.asset("assets/img/app_logo.png", width: 80), Image.asset("assets/img/app_logo.png", width: 80),
], ],
), ),
), ),
SizedBox(
height: MediaQuery.of(context).size.height, const SizedBox(height: 20), //
child: Stack(
children: [ // 使 Expanded
Align( Expanded(
child: SizedBox(
height: MediaQuery.of(context).size.height/1.06,
child: Column( child: Column(
children: [ children: [
// TabBar
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 30.0), padding: const EdgeInsets.symmetric(horizontal: 30.0),
child: Material( child: Material(
@ -98,27 +102,26 @@ class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: TabBar( child: TabBar(
controller: tabController, controller: tabController,
unselectedLabelColor: Color(0xffCDCDCD), unselectedLabelColor: const Color(0xffCDCDCD),
labelColor: Colors.black, labelColor: Colors.black,
indicator:BoxDecoration( indicatorSize: TabBarIndicatorSize.tab,
indicator: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: MColor.LGreen color: MColor.LGreen
), ),
tabs: [ tabs: [
Container( Container(
padding: EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
// color: Colors.pink, child: const Text(
child: Text(
'登录', '登录',
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
), ),
), ),
), ),
Container( Container(
padding: EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: const Text(
'注册', '注册',
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
@ -129,17 +132,16 @@ class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
), ),
), ),
), ),
// TabBarView
Expanded( Expanded(
child: TabBarView( child: TabBarView(
controller: tabController, controller: tabController,
children: [ physics: const NeverScrollableScrollPhysics(),
children: const [
LoginV(), LoginV(),
SignUpView(), SignUpView(),
], ],
)
)
],
),
), ),
) )
], ],

@ -4,15 +4,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; 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 'package:music_player_miao/models/search_bean.dart';
import 'package:music_player_miao/view/main_tab_view/main_tab_view.dart'; import 'package:music_player_miao/view/main_tab_view/main_tab_view.dart';
import '../../api/api_client.dart'; import '../../api/api_client.dart';
import '../../api/api_songlist.dart';
import '../../common/color_extension.dart'; import '../../common/color_extension.dart';
import '../../common/password_manager.dart';
import '../../models/getInfo_bean.dart'; import '../../models/getInfo_bean.dart';
import '../../models/login_bean.dart'; import '../../models/login_bean.dart';
import '../../models/songlist_bean.dart';
import '../../widget/my_text_field.dart'; import '../../widget/my_text_field.dart';
class LoginV extends StatefulWidget { class LoginV extends StatefulWidget {
@ -29,6 +27,7 @@ class _LoginVState extends State<LoginV> {
bool signInRequired = false; bool signInRequired = false;
IconData iconPassword = CupertinoIcons.eye_fill; IconData iconPassword = CupertinoIcons.eye_fill;
bool obscurePassword = true; bool obscurePassword = true;
final passwordManager = Get.put(PasswordManager());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -86,19 +85,59 @@ class _LoginVState extends State<LoginV> {
password: passwordController.text, password: passwordController.text,
); );
if (bean.code == 200) { if (bean.code == 200) {
passwordManager.savePassword(nameController.text, passwordController.text);
Get.to(() => const MainTabView()); Get.to(() => const MainTabView());
_showDialog(context, ScaffoldMessenger.of(context).showSnackBar(
title: 'assets/img/correct.png', SnackBar(
message: '登录成功!'); content: const Center(
child: Text(
'登录成功!',
style: TextStyle(
color: Colors.black,
fontSize: 16.0, //
fontWeight: FontWeight.w500, //
),
),
),
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.white,
elevation: 3,
width: 200, //
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
);
GetInfoBean bean1 = await GetInfoApiClient() GetInfoBean bean1 = await GetInfoApiClient()
.getInfo( .getInfo(
Authorization: AppData().currentToken); Authorization: AppData().currentToken);
} else {
throw Exception("账号或密码错误");
} }
} catch (error) { } catch (error) {
String errorMessage = error.toString(); ScaffoldMessenger.of(context).showSnackBar(
_showDialog(context, SnackBar(
title: 'assets/img/warning.png', content: Center(
message: errorMessage); child: Text(
'${error.toString().replaceAll ('Exception: ', '')} ',
style: TextStyle(
color: Colors.red,
fontSize: 16.0, //
fontWeight: FontWeight.w500, //
),
),
),
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.white,
elevation: 3,
width: 200, //
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
);
} }
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(

@ -1,5 +1,7 @@
// ignore_for_file: use_build_context_synchronously // ignore_for_file: use_build_context_synchronously
import 'dart:async';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -28,6 +30,38 @@ class _SignUpViewState extends State<SignUpView> {
bool obscurePassword = true; bool obscurePassword = true;
bool signUpRequired = false; bool signUpRequired = false;
//
Timer? _timer;
int _countDown = 60;
bool _canSendCode = true;
@override
void dispose() {
_timer?.cancel(); //
super.dispose();
}
//
void startTimer() {
setState(() {
_canSendCode = false;
_countDown = 60;
});
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
if (_countDown == 0) {
setState(() {
_canSendCode = true;
timer.cancel();
});
} else {
setState(() {
_countDown--;
});
}
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Form( return Form(
@ -160,27 +194,75 @@ class _SignUpViewState extends State<SignUpView> {
}), }),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.313,
height: MediaQuery.of(context).size.width * 0.13, height: MediaQuery.of(context).size.width * 0.13,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: MColor.LGreen), backgroundColor: _canSendCode ? MColor.LGreen : Colors.grey[300],
onPressed: () async { shape: RoundedRectangleBorder(
UniversalBean bean = borderRadius: BorderRadius.circular(8.0),
await SetupApiClient().verification( ),
),
onPressed: _canSendCode
? () async {
UniversalBean bean = await SetupApiClient().verification(
email: emailController.text, email: emailController.text,
); );
_showSuccessDialog(context,
title: bean.code == 200 if (bean.code == 200) {
? 'assets/img/correct.png' startTimer(); //
: 'assets/img/warning.png', ScaffoldMessenger.of(context).showSnackBar(
errorMessage: SnackBar(
bean.code == 200 ? '验证码已成功发送!' : '邮箱格式不正确!'); content: Center(
}, child: Text(
child: const Text( '验证码已成功发送!',
"获取验证码", style: TextStyle(color: Colors.black),
style: TextStyle(color: Colors.black45, fontSize: 16), ),
)), ),
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.white,
elevation: 3,
width: 200,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Center(
child: Text(
'邮箱为空或格式不正确!',
style: TextStyle(
color: Colors.black,
fontSize: 16.0, //
fontWeight: FontWeight.w500, //
),
),
),
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.white,
elevation: 3,
width: 220,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
);
}
}
: null,
child: Text(
_canSendCode ? "获取验证码" : "${_countDown}s后重试",
style: TextStyle(
color: _canSendCode ? Colors.black45 : Colors.grey,
fontSize: 16,
),
),
),
), ),
], ],
), ),
@ -198,6 +280,11 @@ class _SignUpViewState extends State<SignUpView> {
), ),
); );
} }
if (nameController.text.isNotEmpty &&
emailController.text.isNotEmpty &&
passwordController.text.isNotEmpty &&
confirmPSWController.text.isNotEmpty &&
confirmController.text.isNotEmpty) {
UniversalBean bean = await SetupApiClient().register( UniversalBean bean = await SetupApiClient().register(
email: emailController.text, email: emailController.text,
password: passwordController.text, password: passwordController.text,
@ -208,8 +295,11 @@ class _SignUpViewState extends State<SignUpView> {
? 'assets/img/correct.png' ? 'assets/img/correct.png'
: 'assets/img/warning.png', : 'assets/img/warning.png',
errorMessage: errorMessage:
bean.code == 200 ? '注册成功,一键登录' : '登录失败,验证码错误'); bean.code == 200
? '注册成功,一键登录'
: '注册失败,验证码错误');
if (bean.code == 200) Get.to(const MainTabView()); if (bean.code == 200) Get.to(const MainTabView());
}
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
elevation: 3.0, elevation: 3.0,

@ -209,7 +209,8 @@ class _MyDownloadViewState extends State<MyDownloadView> {
onPressed: () { onPressed: () {
setState(() { setState(() {
_isSelectMode = false; _isSelectMode = false;
_selectedItems = List.generate(_songs.length, (index) => false); _selectedItems =
List.generate(_songs.length, (index) => false);
}); });
}, },
child: const Text( child: const Text(
@ -232,19 +233,26 @@ class _MyDownloadViewState extends State<MyDownloadView> {
Row( Row(
children: [ children: [
IconButton( IconButton(
onPressed: _songs.isEmpty ? null : () { onPressed: _songs.isEmpty
? null
: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MusicView( builder: (context) => MusicView(
songList: _songs, songList: _songs,
initialSongIndex: 0, initialSongIndex: 0,
onSongStatusChanged: (index, isCollected, isLiked) { onSongStatusChanged:
(index, isCollected, isLiked) {
setState(() { setState(() {
// //
_songs[index].collection = isCollected; _songs[index].collection =
isCollected;
_songs[index].likes = isLiked; _songs[index].likes = isLiked;
downloadManager.updateSongInfo(_songs[index].id, isCollected, isLiked); downloadManager.updateSongInfo(
_songs[index].id,
isCollected,
isLiked);
}); });
}, },
), ),
@ -326,10 +334,12 @@ class _MyDownloadViewState extends State<MyDownloadView> {
builder: (context) => MusicView( builder: (context) => MusicView(
songList: _songs, songList: _songs,
initialSongIndex: index, initialSongIndex: index,
onSongStatusChanged: (index, isCollected, isLiked) { onSongStatusChanged:
(index, isCollected, isLiked) {
setState(() { setState(() {
// //
_songs[index].collection = isCollected; _songs[index].collection =
isCollected;
_songs[index].likes = isLiked; _songs[index].likes = isLiked;
}); });
}, },

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../common_widget/app_data.dart'; import '../../common_widget/app_data.dart';
@ -13,20 +12,21 @@ List<T> flatten<T>(Iterable<Iterable<T>> iterable) {
class MyMusicView extends StatefulWidget { class MyMusicView extends StatefulWidget {
final int? songlistIdd; final int? songlistIdd;
const MyMusicView({Key? key, this.songlistIdd}) : super(key: key); const MyMusicView({Key? key, this.songlistIdd}) : super(key: key);
@override @override
State<MyMusicView> createState() => _MyMusicViewState(); State<MyMusicView> createState() => _MyMusicViewState();
} }
class _MyMusicViewState extends State<MyMusicView> { class _MyMusicViewState extends State<MyMusicView> {
int songsNum = 0; int songsNum = 0;
List songlistId =[]; List songlistId = [];
List musicDetail = []; List musicDetail = [];
List name = []; List name = [];
List coverPath = []; List coverPath = [];
List musicPath = []; List musicPath = [];
List singerName =[]; List singerName = [];
List uploadUserName = []; List uploadUserName = [];
final listVM = Get.put(HomeViewModel()); final listVM = Get.put(HomeViewModel());
@ -34,7 +34,6 @@ class _MyMusicViewState extends State<MyMusicView> {
final List<bool> _mySongListSelections = List.generate(2, (index) => false); final List<bool> _mySongListSelections = List.generate(2, (index) => false);
List<bool> _selectedItems = List.generate(10, (index) => false); List<bool> _selectedItems = List.generate(10, (index) => false);
// //
@override @override
void initState() { void initState() {
@ -86,8 +85,8 @@ class _MyMusicViewState extends State<MyMusicView> {
print('Error fetching myworks data: $error'); print('Error fetching myworks data: $error');
} }
} }
//
//
void _toggleSelectMode() { void _toggleSelectMode() {
setState(() { setState(() {
@ -110,21 +109,20 @@ class _MyMusicViewState extends State<MyMusicView> {
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius:BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
title: Row( title: Row(
children: [ children: [
const Text("添加到",), const Text(
"添加到",
),
Text( Text(
'(${_selectedItems.where((item) => item).length} 首)', '(${_selectedItems.where((item) => item).length} 首)',
style: const TextStyle( style: const TextStyle(color: Color(0xff429482), fontSize: 16),
color: Color(0xff429482),
fontSize: 16
),
) )
], ],
), ),
content:SingleChildScrollView( content: SingleChildScrollView(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
child: Column( child: Column(
children: [ children: [
@ -151,8 +149,7 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {},
},
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: const Color(0xff429482), backgroundColor: const Color(0xff429482),
minimumSize: const Size(130, 50), minimumSize: const Size(130, 50),
@ -192,7 +189,6 @@ class _MyMusicViewState extends State<MyMusicView> {
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -209,7 +205,7 @@ class _MyMusicViewState extends State<MyMusicView> {
centerTitle: true, centerTitle: true,
elevation: 0, elevation: 0,
leading: !_isSelectMode leading: !_isSelectMode
?IconButton( ? IconButton(
onPressed: () { onPressed: () {
Get.back(result: true); Get.back(result: true);
}, },
@ -224,8 +220,14 @@ class _MyMusicViewState extends State<MyMusicView> {
onPressed: _selectAll, onPressed: _selectAll,
style: TextButton.styleFrom( style: TextButton.styleFrom(
foregroundColor: Colors.black, foregroundColor: Colors.black,
minimumSize: const Size(50, 40), //
padding:
const EdgeInsets.symmetric(horizontal: 8), //
),
child: const Text(
'全选',
style: TextStyle(fontSize: 18),
), ),
child: const Text('全选',style: TextStyle(fontSize: 18),),
), ),
title: _isSelectMode title: _isSelectMode
? Text( ? Text(
@ -241,7 +243,7 @@ class _MyMusicViewState extends State<MyMusicView> {
actions: [ actions: [
if (_isSelectMode) if (_isSelectMode)
TextButton( TextButton(
onPressed: (){ onPressed: () {
setState(() { setState(() {
_isSelectMode = false; _isSelectMode = false;
_selectedItems = List.generate(10, (index) => false); _selectedItems = List.generate(10, (index) => false);
@ -249,12 +251,8 @@ class _MyMusicViewState extends State<MyMusicView> {
}, },
child: const Text( child: const Text(
"完成", "完成",
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 18),
color: Colors.black, ))
fontSize: 18
),
)
)
], ],
), ),
body: Container( body: Container(
@ -271,7 +269,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Row( Row(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset( icon: Image.asset(
"assets/img/button_play.png", "assets/img/button_play.png",
width: 20, width: 20,
@ -280,16 +278,14 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
const Text( const Text(
'播放全部', '播放全部',
style: TextStyle( style: TextStyle(fontSize: 16),
fontSize: 16
), ),
const SizedBox(
width: 5,
), ),
const SizedBox(width: 5,),
const Text( const Text(
'50', '50',
style: TextStyle( style: TextStyle(fontSize: 16),
fontSize: 16
),
), ),
], ],
), ),
@ -324,10 +320,14 @@ class _MyMusicViewState extends State<MyMusicView> {
activeColor: const Color(0xff429482), activeColor: const Color(0xff429482),
) )
: CircleAvatar( : CircleAvatar(
backgroundImage: NetworkImage(coverPath[index]), // backgroundImage:
NetworkImage(coverPath[index]),
//
radius: 25, radius: 25,
), ),
title: Text('${name[index]} - ${singerName[index]}'), // title:
Text('${name[index]} - ${singerName[index]}'),
//
trailing: _isSelectMode trailing: _isSelectMode
? null ? null
: IconButton( : IconButton(
@ -344,7 +344,6 @@ class _MyMusicViewState extends State<MyMusicView> {
], ],
), ),
), ),
bottomNavigationBar: _isSelectMode bottomNavigationBar: _isSelectMode
? BottomAppBar( ? BottomAppBar(
child: SizedBox( child: SizedBox(
@ -358,7 +357,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Row( Row(
children: [ children: [
IconButton( IconButton(
onPressed: (){ onPressed: () {
_showSelectionDialog(); _showSelectionDialog();
}, },
icon: Image.asset("assets/img/list_add.png"), icon: Image.asset("assets/img/list_add.png"),
@ -375,8 +374,9 @@ class _MyMusicViewState extends State<MyMusicView> {
Row( Row(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_download.png"), icon:
Image.asset("assets/img/list_download.png"),
iconSize: 60, iconSize: 60,
), ),
const Text("下载"), const Text("下载"),
@ -388,7 +388,8 @@ class _MyMusicViewState extends State<MyMusicView> {
onPressed: () { onPressed: () {
setState(() { setState(() {
_isSelectMode = false; _isSelectMode = false;
_selectedItems = List.generate(10, (index) => false); _selectedItems =
List.generate(10, (index) => false);
}); });
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -399,11 +400,10 @@ class _MyMusicViewState extends State<MyMusicView> {
borderRadius: BorderRadius.zero, borderRadius: BorderRadius.zero,
), ),
), ),
child: const Text('取消', child: const Text(
style: TextStyle( '取消',
color: Colors.black, style: TextStyle(color: Colors.black, fontSize: 16),
fontSize: 16 ),
),),
), ),
], ],
), ),
@ -413,12 +413,14 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
); );
} }
Future _bottomSheet(BuildContext context){
Future _bottomSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.white, backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(30))), shape: const RoundedRectangleBorder(
builder: (context) =>Container( borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
builder: (context) => Container(
height: 210, height: 210,
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
child: Column( child: Column(
@ -430,7 +432,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_remove.png"), icon: Image.asset("assets/img/list_remove.png"),
iconSize: 60, iconSize: 60,
), ),
@ -440,7 +442,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_download.png"), icon: Image.asset("assets/img/list_download.png"),
iconSize: 60, iconSize: 60,
), ),
@ -450,7 +452,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_collection.png"), icon: Image.asset("assets/img/list_collection.png"),
iconSize: 60, iconSize: 60,
), ),
@ -460,7 +462,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_good.png"), icon: Image.asset("assets/img/list_good.png"),
iconSize: 60, iconSize: 60,
), ),
@ -470,7 +472,7 @@ class _MyMusicViewState extends State<MyMusicView> {
Column( Column(
children: [ children: [
IconButton( IconButton(
onPressed: (){}, onPressed: () {},
icon: Image.asset("assets/img/list_comment.png"), icon: Image.asset("assets/img/list_comment.png"),
iconSize: 60, iconSize: 60,
), ),
@ -479,7 +481,9 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
], ],
), ),
const SizedBox(height: 10,), const SizedBox(
height: 10,
),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
// Get.to(()=>const MusicView()); // Get.to(()=>const MusicView());
@ -494,12 +498,11 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
child: const Text( child: const Text(
"查看详情页", "查看详情页",
style: TextStyle(color:Colors.black,fontSize: 18), style: TextStyle(color: Colors.black, fontSize: 18),
), ),
), ),
ElevatedButton( ElevatedButton(
onPressed: () =>Navigator.pop(context), onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff429482), backgroundColor: const Color(0xff429482),
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
@ -510,17 +513,11 @@ class _MyMusicViewState extends State<MyMusicView> {
), ),
child: const Text( child: const Text(
"取消", "取消",
style: TextStyle(color:Colors.black,fontSize: 18), style: TextStyle(color: Colors.black, fontSize: 18),
), ),
), ),
], ],
), ),
) ));
);
} }
} }

@ -384,12 +384,10 @@ class _UserViewState extends State<UserView> {
IconButton( IconButton(
onPressed: () async { onPressed: () async {
Navigator.pop(context); Navigator.pop(context);
Get.to(const BeginView());
UniversalBean bean = await LogoutApiClient().logout( UniversalBean bean = await LogoutApiClient().logout(
Authorization: AppData().currentToken, Authorization: AppData().currentToken,
); );
if (bean.code == 200) {
Get.to(const BeginView());
}
}, },
icon: Image.asset("assets/img/user_out.png"), icon: Image.asset("assets/img/user_out.png"),
iconSize: 60, iconSize: 60,

Loading…
Cancel
Save