|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:music_player_miao/view_model/splash_view_model.dart';
|
|
|
|
|
|
|
|
class SplashView extends StatefulWidget {
|
|
|
|
const SplashView({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<SplashView> createState() => _SplashViewState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SplashViewState extends State<SplashView> {
|
|
|
|
final splashVM = Get.put(SplashViewModel());
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
// 在initState中启动自动登录流程
|
|
|
|
splashVM.loadView();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var media = MediaQuery.sizeOf(context);
|
|
|
|
return Container(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: AssetImage("assets/img/app_bg.png"),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
body: Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
const SizedBox(height: 280,),
|
|
|
|
Image.asset(
|
|
|
|
"assets/img/app_logo.png",
|
|
|
|
width: media.width * 0.50,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 150,),
|
|
|
|
const Text(
|
|
|
|
"喵听",
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 40,
|
|
|
|
fontWeight: FontWeight.w600
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Text(
|
|
|
|
"你的云端音乐库",
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 16,
|
|
|
|
fontWeight: FontWeight.w500
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|