feat:更新日历组件

This commit is contained in:
2025-07-11 16:48:04 +08:00
parent b56b822e01
commit 55ca36cba2
7 changed files with 103 additions and 106 deletions

View File

@@ -13,6 +13,7 @@ class LoginPage extends StatefulWidget {
class _LoginPage extends State<LoginPage> {
final GlobalKey _formKey = GlobalKey<FormState>();
late String _username, _password;
bool _isObscure = true;
Color _eyeColor = Colors.grey;
@@ -52,9 +53,6 @@ class _LoginPage extends State<LoginPage> {
buildUsernameTextField(),
const SizedBox(height: 20),
buildPasswordTextField(context),
// 紧凑排列:记住密码在上,忘记密码在下,间距缩小
const SizedBox(height: 8), // 缩小密码框与记住密码的间距
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
@@ -102,10 +100,13 @@ class _LoginPage extends State<LoginPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
formLabelText(labelText: "账号:"),
const SizedBox(height: 5),
const SizedBox(height: 10),
FormBuilderTextField(
name: 'username',
decoration: formInputDecoration(hintText: "请输入账号", prefixIcon: Icons.person),
decoration: formInputDecoration(
hintText: "请输入账号",
prefixIcon: Icons.person,
),
validator: FormBuilderValidators.required(),
onSaved: (v) => _username = v!,
),
@@ -118,7 +119,7 @@ class _LoginPage extends State<LoginPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
formLabelText(labelText: "密码:"),
const SizedBox(height: 5),
const SizedBox(height: 10),
FormBuilderTextField(
name: 'password',
obscureText: _isObscure,
@@ -139,14 +140,14 @@ class _LoginPage extends State<LoginPage> {
setState(() {
_isObscure = !_isObscure;
_eyeColor =
(_isObscure
? Colors.grey
: Theme.of(context).iconTheme.color)!;
(_isObscure
? Colors.grey
: Theme.of(context).iconTheme.color)!;
});
},
),
),
)
),
],
);
}
@@ -185,23 +186,20 @@ class _LoginPage extends State<LoginPage> {
child: SizedBox(
height: 45,
width: double.infinity,
child: TDButton(
child: TDButton(
text: '登录',
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.rectangle,
theme: TDButtonTheme.primary,
onTap: () => loginClick(context)
)
onTap: () => loginClick(context),
),
),
);
}
Widget buildOtherLoginText() {
return TDDivider(
text: '其他方式登录',
alignment: TextAlignment.center,
);
return TDDivider(text: '其他方式登录', alignment: TextAlignment.center);
}
Widget buildOtherMethod(context) {