| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import 'package:electronic_assistant/base/base_page.dart';
- import 'package:flutter/material.dart';
- import 'controller.dart';
- class LoginPage extends BasePage<LoginController> {
- const LoginPage({super.key});
- @override
- Widget buildBody(BuildContext context) {
- return Scaffold(
- body: Column(
- children: <Widget>[
- TextField(
- onChanged: (text) {
- controller.setPhone(text);
- },
- decoration: const InputDecoration(
- labelText: "手机号",
- hintText: "您的手机号",
- prefixIcon: Icon(Icons.person)),
- ),
- TextField(
- onChanged: (text) {
- controller.setCode(text);
- },
- decoration: const InputDecoration(
- labelText: "验证码",
- hintText: "您的验证码",
- prefixIcon: Icon(Icons.lock)),
- ),
- ElevatedButton(
- child: const Text("获取验证码"),
- onPressed: () {
- controller.getUserCode();
- },
- ),
- ElevatedButton(
- child: const Text("登录"),
- onPressed: () {
- controller.login();
- },
- )
- ],
- ),
- );
- }
- }
|