好看的flutter3 登录界面
时间: 2023-08-29 16:13:59 浏览: 38
以下是一个简单的 Flutter 登录界面示例,希望你喜欢:
```
import 'package:flutter/material.dart';
class LoginPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Welcome Back!',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24),
),
SizedBox(height: 20),
TextField(
decoration: InputDecoration(
hintText: 'Email',
border: OutlineInputBorder(),
),
),
SizedBox(height: 10),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: 'Password',
border: OutlineInputBorder(),
),
),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {},
child: Text('Log In'),
),
SizedBox(height: 20),
TextButton(
onPressed: () {},
child: Text('Forgot Password?'),
),
SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Don't have an account?"),
TextButton(
onPressed: () {},
child: Text('Sign Up'),
),
],
),
],
),
),
);
}
}
```
这个示例包含一个简单的布局,包括输入框和按钮,以及一些文本。你可以根据你的需要进行修改和调整。