完成登陆页面验证

hmxc
小赖 4 years ago
parent 2d9a8938f6
commit 1cafd9dac2

@ -5,6 +5,7 @@ import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
@ -17,6 +18,18 @@ class LoginPage extends StatefulWidget {
}
class _LoginPageState extends State<LoginPage> {
TextEditingController _textController = TextEditingController();
bool get phoneValid {
return RegexUtil.isMobileSimple(_textController.text);
}
@override
void dispose() {
_textController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
@ -54,6 +67,10 @@ class _LoginPageState extends State<LoginPage> {
width: double.infinity,
child: TextField(
autofocus: true,
controller: _textController,
onChanged: (text) {
setState(() {});
},
keyboardType: TextInputType.phone,
decoration: InputDecoration(
border: UnderlineInputBorder(
@ -75,10 +92,20 @@ class _LoginPageState extends State<LoginPage> {
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: AkuMaterialButton(
color: AppStyle.minorColor,
onPressed: () {},
color: AppStyle.primaryColor,
onPressed: phoneValid ? () {} : null,
nullColor: Color(0xFFFFE67D),
radius: 8.w,
child: Text('获取验证码'),
child: Text(
'获取验证码',
style: TextStyle(
color: phoneValid
? AppStyle.primaryTextColor
: AppStyle.minorTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],

@ -6,7 +6,7 @@ packages:
description:
path: "."
ref: HEAD
resolved-ref: e57b6920e49f325c041fac955e1f3297dc9f1d09
resolved-ref: "89d1e665c372461ed87be46c9227377b305050b2"
url: "http://test.akuhotel.com:8099/aku_fe/aku_ui.git"
source: git
version: "0.0.1"
@ -66,6 +66,27 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0-nullsafety.3"
common_utils:
dependency: "direct main"
description:
name: common_utils
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.5"
cupertino_icons:
dependency: "direct main"
description:
@ -73,6 +94,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.5"
extended_text:
dependency: "direct main"
description:
@ -167,6 +195,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.13"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.8"
sky_engine:
dependency: transitive
description: flutter

@ -44,6 +44,8 @@ dependencies:
extended_text: ^4.0.0
common_utils: ^1.2.1
aku_ui:
git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save