register_page.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import 'package:flutter/material.dart';
  2. class RegisterPage extends StatefulWidget {
  3. @override
  4. _RegisterPageState createState() => _RegisterPageState();
  5. }
  6. class _RegisterPageState extends State<RegisterPage> {
  7. TextEditingController _usernameContrller = TextEditingController();
  8. TextEditingController _passwordContrller = TextEditingController();
  9. @override
  10. Widget build(BuildContext context) {
  11. return Scaffold(
  12. body: Column(
  13. children: [
  14. SizedBox(
  15. height: 20,
  16. ),
  17. Image.asset(
  18. "assets/images/leaf.jpg",
  19. width: 200,
  20. ),
  21. Text("注册页面"),
  22. TextFormField(
  23. controller: _usernameContrller,
  24. decoration:
  25. InputDecoration(hintText: "用户名", icon: Icon(Icons.person)),
  26. ),
  27. TextFormField(
  28. decoration:
  29. InputDecoration(icon: Icon(Icons.lock), hintText: "密码"),
  30. controller: _passwordContrller,
  31. ),
  32. SizedBox(
  33. height: 20,
  34. ),
  35. TextButton(
  36. style: ButtonStyle(
  37. backgroundColor: MaterialStateProperty.all(Colors.blue),
  38. minimumSize: MaterialStateProperty.all(Size(200, 40))),
  39. onPressed: () {
  40. register();
  41. },
  42. child: Text(
  43. "注册",
  44. style: TextStyle(color: Colors.white),
  45. ))
  46. ],
  47. ),
  48. );
  49. }
  50. void register() {}
  51. }