From d4526da56d551c8cbefd8e113758f39302788dac Mon Sep 17 00:00:00 2001 From: ddshi <8811906+ddshi@user.noreply.gitee.com> Date: Thu, 23 Jan 2025 13:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0login=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 4 +-- lib/pages/login.dart | 74 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 lib/pages/login.dart diff --git a/lib/main.dart b/lib/main.dart index 6a3b3bb..641bfb8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'pages/splash.dart'; +import 'pages/login.dart'; void main() { @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - home: const SplashPage(), + home: const LoginPage(), debugShowCheckedModeBanner: false, theme: ThemeData( //设置主题色 diff --git a/lib/pages/login.dart b/lib/pages/login.dart new file mode 100644 index 0000000..bda56f6 --- /dev/null +++ b/lib/pages/login.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; + +import '../common/app_colors.dart'; +import '../common/assets.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({Key? key}) : super(key: key); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + //登录表达 + Widget _buildForm() { + return Container(); + } + + //主视图 拆成函数 + Widget _buildView(BuildContext context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + //logo + Image.asset( + AssetsImages.logoPng, + height: 60, + width: 57, + ), + + const SizedBox(height: 22), + + //主标题 + const Text( + "Let's sign you in", + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + + const SizedBox(height: 10), + + //子标题 + const Text( + "Wlecome back,you've been missed", + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w300, + color: Color(0xFFEEEEEE), + ), + ), + + const SizedBox(height: 55), + + //表单 + _buildForm(), + + //end + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.backgroundSplash, + body: _buildView(context), + ); + } +}