add submit
This commit is contained in:
@@ -84,6 +84,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
icon: Icons.lock_outline,
|
||||
isPassword: true,
|
||||
controller: _passwordController,
|
||||
onSubmitted: (_) => _submit(),
|
||||
),
|
||||
|
||||
const SizedBox(height: 40),
|
||||
@@ -93,16 +94,7 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
width: double.infinity,
|
||||
height: 56,
|
||||
child: ElevatedButton(
|
||||
onPressed: isLoading
|
||||
? null
|
||||
: () {
|
||||
context.read<AuthBloc>().add(
|
||||
LoginRequested(
|
||||
email: _emailController.text.trim(),
|
||||
password: _passwordController.text.trim(),
|
||||
),
|
||||
);
|
||||
},
|
||||
onPressed: isLoading ? null : () => _submit(),
|
||||
child: isLoading
|
||||
? const SizedBox(
|
||||
height: 24,
|
||||
@@ -151,4 +143,13 @@ class _AuthScreenState extends State<AuthScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _submit() {
|
||||
context.read<AuthBloc>().add(
|
||||
LoginRequested(
|
||||
email: _emailController.text.trim(),
|
||||
password: _passwordController.text.trim(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user