12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import 'package:flutter/material.dart';
- class LoginPage extends StatefulWidget {
- const LoginPage({super.key});
- @override
- State<LoginPage> createState() => _LoginPageState();
- }
- class _LoginPageState extends State<LoginPage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Stack(
- children: [
- Image.asset("assets/images/bg.png"),
- Column(
- children: [
- Text("用户名:"),
- TextField(),
- Text("密码:"),
- TextField(),
- TextButton(onPressed: login, child: Text("登录")),
- TextButton(onPressed: register, child: Text("注册")),
- TextButton(onPressed: withoutLogin, child: Text("游客")),
- TextButton(onPressed: back, child: Text("返回")),
- ],
- )
- ],
- ),
- );
- }
- void login() {}
- void register() {}
- void withoutLogin() {}
- void back() {
- Navigator.pop(context);
- }
- }
|