fix
This commit is contained in:
@@ -56,8 +56,8 @@ class _LoginFormState extends State<LoginForm> {
|
||||
controller: _usernameController,
|
||||
enabled: !widget.isLoading,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Username',
|
||||
hintText: 'Enter your username',
|
||||
labelText: 'Tên đăng nhập',
|
||||
hintText: 'Nhập tên đăng nhập',
|
||||
prefixIcon: const Icon(Icons.person_outline),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -67,10 +67,10 @@ class _LoginFormState extends State<LoginForm> {
|
||||
textInputAction: TextInputAction.next,
|
||||
validator: (value) {
|
||||
if (value == null || value.trim().isEmpty) {
|
||||
return 'Username is required';
|
||||
return 'Vui lòng nhập tên đăng nhập';
|
||||
}
|
||||
if (value.trim().length < 3) {
|
||||
return 'Username must be at least 3 characters';
|
||||
return 'Tên đăng nhập phải có ít nhất 3 ký tự';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -84,8 +84,8 @@ class _LoginFormState extends State<LoginForm> {
|
||||
enabled: !widget.isLoading,
|
||||
obscureText: _obscurePassword,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
hintText: 'Enter your password',
|
||||
labelText: 'Mật khẩu',
|
||||
hintText: 'Nhập mật khẩu',
|
||||
prefixIcon: const Icon(Icons.lock_outline),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
@@ -107,10 +107,10 @@ class _LoginFormState extends State<LoginForm> {
|
||||
onFieldSubmitted: (_) => _handleSubmit(),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Password is required';
|
||||
return 'Vui lòng nhập mật khẩu';
|
||||
}
|
||||
if (value.length < 6) {
|
||||
return 'Password must be at least 6 characters';
|
||||
return 'Mật khẩu phải có ít nhất 6 ký tự';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -131,7 +131,7 @@ class _LoginFormState extends State<LoginForm> {
|
||||
),
|
||||
)
|
||||
: const Icon(Icons.login),
|
||||
label: Text(widget.isLoading ? 'Logging in...' : 'Login'),
|
||||
label: Text(widget.isLoading ? 'Đang đăng nhập...' : 'Đăng nhập'),
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
|
||||
Reference in New Issue
Block a user