使用Form组件
Form(
key: _formKey,
child: Column(
children: [
TextFormField(
autofocus: true,
textInputAction: TextInputAction.next,
keyboardType: TextInputType.phone,
controller: _phoneController,
decoration: InputDecoration(
hintText: '请输入手机号',
labelText: '手机号',
),
validator: validateTelePhone,
),
TextFormField(
autofocus: true,
textInputAction: TextInputAction.done,
keyboardType: TextInputType.visiblePassword,
controller: __passController,
decoration: InputDecoration(
hintText: '请输入密码',
labelText: '密码',
errorStyle: TextStyle(color: Colors.red)),
validator: passworderro,
),
SizedBox(
height: 20,
),
Container(
width: 400,
height: 50,
child