login_page.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:flutter/material.dart';
  2. /// Description: 登录页
  3. /// Time : 04/28/2023 Friday
  4. /// Author : liuyuqi.gov@msn.cn
  5. class LoginPage extends StatefulWidget {
  6. const LoginPage({super.key});
  7. @override
  8. State<LoginPage> createState() => _LoginPageState();
  9. }
  10. class _LoginPageState extends State<LoginPage> {
  11. @override
  12. Widget build(BuildContext context) {
  13. return Scaffold(
  14. body: Stack(
  15. children: [
  16. Image.asset("assets/images/bg.png"),
  17. Column(
  18. children: [
  19. const Text("用户名:"),
  20. const TextField(),
  21. const Text("密码:"),
  22. TextField(),
  23. TextButton(onPressed: login, child: const Text("登录")),
  24. TextButton(onPressed: register, child: const Text("注册")),
  25. TextButton(onPressed: withoutLogin, child: const Text("游客")),
  26. TextButton(onPressed: back, child: const Text("返回")),
  27. ],
  28. )
  29. ],
  30. ),
  31. );
  32. }
  33. void login() {}
  34. void register() {}
  35. void withoutLogin() {}
  36. void back() {
  37. Navigator.pop(context);
  38. }
  39. }