forked from piaocbn2j/MTMusic
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
5.2 KiB
156 lines
5.2 KiB
import 'dart:ui';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:music_player_miao/common/color_extension.dart';
|
|
import 'package:music_player_miao/view/begin/login_v.dart';
|
|
import 'package:music_player_miao/view/begin/setup_view.dart';
|
|
|
|
class BeginView extends StatefulWidget {
|
|
const BeginView({super.key});
|
|
|
|
@override
|
|
State<BeginView> createState() => _BeginViewState();
|
|
}
|
|
|
|
class _BeginViewState extends State<BeginView> with TickerProviderStateMixin {
|
|
late TabController tabController;
|
|
|
|
@override
|
|
void initState() {
|
|
tabController = TabController(
|
|
initialIndex: 0,
|
|
length: 2,
|
|
vsync: this
|
|
);
|
|
super.initState();
|
|
}
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/img/app_bg.png"),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
child: Scaffold(
|
|
backgroundColor: Colors.transparent,
|
|
resizeToAvoidBottomInset: false,
|
|
body: ScrollConfiguration(
|
|
behavior: ScrollBehavior().copyWith(
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
// 顶部欢迎部分
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 110, left: 40, right: 40),
|
|
child: Row(
|
|
children: [
|
|
const Column(
|
|
children: [
|
|
Text(
|
|
"你好吖喵星来客,",
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
Text(
|
|
"欢迎来到",
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w500
|
|
),
|
|
),
|
|
Text(
|
|
"喵听",
|
|
style: TextStyle(
|
|
color: Colors.black,
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.w800
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(width: 25),
|
|
Image.asset("assets/img/app_logo.png", width: 80),
|
|
],
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 20), // 添加一些间距
|
|
|
|
// 剩余部分使用 Expanded
|
|
Expanded(
|
|
child: Column(
|
|
children: [
|
|
// TabBar部分
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 30.0),
|
|
child: Material(
|
|
color: Colors.white,
|
|
elevation: 3,
|
|
borderRadius: BorderRadius.circular(10),
|
|
child: TabBar(
|
|
controller: tabController,
|
|
unselectedLabelColor: const Color(0xffCDCDCD),
|
|
labelColor: Colors.black,
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
indicator: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(10),
|
|
color: MColor.LGreen
|
|
),
|
|
tabs: [
|
|
Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: const Text(
|
|
'登录',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: const Text(
|
|
'注册',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
|
|
// TabBarView部分
|
|
Expanded(
|
|
child: TabBarView(
|
|
controller: tabController,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
children: const [
|
|
LoginV(),
|
|
SignUpView(),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |