mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 15:45:26 +02:00
improvements
This commit is contained in:
parent
f7b1c51d09
commit
ae1a5c8b07
@ -51,6 +51,16 @@ extension ShowSnackBar on BuildContext {
|
||||
);
|
||||
}
|
||||
|
||||
void showLongErrorSnackBar({
|
||||
required final String message,
|
||||
}) {
|
||||
showSnackBar(
|
||||
message: message,
|
||||
backgroundColor: Colors.red,
|
||||
duration: const Duration(seconds: 6),
|
||||
);
|
||||
}
|
||||
|
||||
void showSuccessSnackBar({
|
||||
required final String message,
|
||||
}) {
|
||||
|
@ -63,7 +63,7 @@ class _LoginScreenState extends AuthState<LoginScreen> with Loadable {
|
||||
await _signIn();
|
||||
} catch (error) {
|
||||
if (mounted) {
|
||||
context.showErrorSnackBar(message: error.toString());
|
||||
context.showLongErrorSnackBar(message: 'Invalid password or email');
|
||||
|
||||
emailController.clear();
|
||||
passwordController.clear();
|
||||
@ -100,19 +100,26 @@ class _LoginScreenState extends AuthState<LoginScreen> with Loadable {
|
||||
'Sign in to your account. If you do not have one already, we will automatically set up one for you.',
|
||||
),
|
||||
const SizedBox(height: MEDIUM_SPACE),
|
||||
TextFormField(
|
||||
TextField(
|
||||
controller: emailController,
|
||||
autofocus: true,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
decoration: const InputDecoration(labelText: 'Email'),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
textInputAction: TextInputAction.next,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Email',
|
||||
prefixIcon: Icon(Icons.email),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: SMALL_SPACE),
|
||||
TextFormField(
|
||||
TextField(
|
||||
obscureText: true,
|
||||
controller: passwordController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Password',
|
||||
prefixIcon: Icon(Icons.lock),
|
||||
),
|
||||
onSubmitted: (value) => callWithLoading(signIn),
|
||||
),
|
||||
const SizedBox(height: MEDIUM_SPACE),
|
||||
ElevatedButton.icon(
|
||||
|
@ -121,6 +121,10 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
|
||||
|
||||
await previousCameraController?.dispose();
|
||||
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
controller = cameraController;
|
||||
|
||||
// Update UI if controller updates
|
||||
|
Loading…
x
Reference in New Issue
Block a user