From 1d32b674f77abc3fef34cc42da108861dde49f34 Mon Sep 17 00:00:00 2001 From: zhuce <821293938@qq.com> Date: Thu, 7 Mar 2024 18:00:47 +0800 Subject: [PATCH] login page first commit --- lib/{pages => }/config/theme_colors.dart | 0 lib/main.dart | 3 +- lib/pages/home/home_page.dart | 3 +- lib/pages/login/login_page.dart | 85 ++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 2 deletions(-) rename lib/{pages => }/config/theme_colors.dart (100%) create mode 100644 lib/pages/login/login_page.dart diff --git a/lib/pages/config/theme_colors.dart b/lib/config/theme_colors.dart similarity index 100% rename from lib/pages/config/theme_colors.dart rename to lib/config/theme_colors.dart diff --git a/lib/main.dart b/lib/main.dart index d69d256..1eeccc4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:autosos_flutter/pages/home/home_page.dart'; +import 'package:autosos_flutter/pages/login/login_page.dart'; import 'package:flutter/material.dart'; void main() { @@ -17,6 +18,6 @@ class MyApp extends StatelessWidget { colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), - home: const HomePage()); + home: const LoginPage()); } } diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index bbedac0..6b73e67 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -1,10 +1,11 @@ import 'package:amap_flutter_map/amap_flutter_map.dart'; import 'package:autosos_flutter/const_config.dart'; -import 'package:autosos_flutter/pages/config/theme_colors.dart'; import 'package:autosos_flutter/pages/home/widgets/image_block.dart'; import 'package:autosos_flutter/pages/home/widgets/number_block.dart'; import 'package:flutter/material.dart'; +import '../../config/theme_colors.dart'; + class HomePage extends StatefulWidget { const HomePage({super.key}); diff --git a/lib/pages/login/login_page.dart b/lib/pages/login/login_page.dart new file mode 100644 index 0000000..ace9081 --- /dev/null +++ b/lib/pages/login/login_page.dart @@ -0,0 +1,85 @@ +import 'package:flutter/material.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(), + body: Column( + children: [ + ListTile( + leading: Image.asset( + "images/1.5x/ic_launcher.png", + height: 54, + width: 54, + ), + title: const Text( + "欢迎登陆啾啾救援", + style: TextStyle(fontSize: 23, fontWeight: FontWeight.bold), + ), + subtitle: const Text( + "宁波易到互联科技有限公司", + style: TextStyle( + fontSize: 13, + ), + ), + ), + Padding( + padding: const EdgeInsets.all(20), + child: Row( + children: [ + const Text( + "+86", + style: TextStyle(fontSize: 16, color: Color(0xFF1D1D1D)), + ), + Padding( + padding: const EdgeInsets.all(15), + child: Container( + height: 20, + width: 1, + color: Colors.grey, + ), + ), + const Expanded( + child: TextField( + decoration: InputDecoration(hintText: "请输入手机号"), + )), + ], + ), + ), + const Padding( + padding: EdgeInsets.all(20), + child: Row( + children: [ + Expanded( + child: TextField( + decoration: InputDecoration(hintText: "请输入密码"), + )) + ], + ), + ), + Padding( + padding: const EdgeInsets.all(20), + child: Container( + padding: const EdgeInsets.all(12), + margin: const EdgeInsets.only(top: 40), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(color: Colors.grey,borderRadius: BorderRadius.circular(21)), + child: const Center( + child: Text( + "登录", + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ))), + ) + ], + ), + ); + } +}