| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import 'package:flutter/material.dart';
- class RegisterPage extends StatefulWidget {
- const RegisterPage({Key? key}) : super(key: key);
- @override
- State<StatefulWidget> createState() => _RegisterPageState();
- }
- class _RegisterPageState extends State<RegisterPage> {
- bool showPassword = false;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text("注册"),
- ),
- // child: PageContent(name: "登录"),
- body: SingleChildScrollView(
- child: Padding(
- padding: const EdgeInsets.all(20),
- child: Column(
- children: [
- const TextField(
- decoration: InputDecoration(
- labelText: "账号",
- hintText: "请输入账号",
- prefixIcon: Icon(Icons.person),
- ),
- ),
- const SizedBox(
- height: 16,
- ),
- TextField(
- obscureText: !showPassword,
- decoration: const InputDecoration(
- labelText: "密码",
- hintText: "请输入密码",
- prefixIcon: Icon(Icons.lock),
- ),
- ),
- const SizedBox(
- height: 16,
- ),
- TextField(
- obscureText: !showPassword,
- decoration: const InputDecoration(
- labelText: "确认密码",
- hintText: "请再次输入密码",
- prefixIcon: Icon(Icons.lock),
- ),
- ),
- const SizedBox(
- height: 24,
- ),
- SizedBox(
- width: double.infinity,
- child: ElevatedButton(
- child: const Text("注册"),
- onPressed: () {
- debugPrint("register");
- },
- ),
- ),
- const SizedBox(
- height: 16,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text('已有账号,'),
- TextButton(
- child: const Text(
- '去登录~',
- style: TextStyle(color: Colors.teal),
- ),
- onPressed: () {
- Navigator.pushReplacementNamed(context, 'login');
- },
- )
- ],
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
|