adjust loggin in indicator
All checks were successful
Release / meta (push) Successful in 8s
Release / linux-build (push) Successful in 7m20s
Release / android-build (push) Successful in 25m10s
Release / release-dev (push) Successful in 30s
Release / release-master (push) Successful in 28s

This commit is contained in:
2025-12-27 15:00:57 +00:00
parent a9bc6c306c
commit 2600e90efa
3 changed files with 32 additions and 19 deletions

View File

@@ -17,7 +17,9 @@ class _LoginScreenState extends State<LoginScreen> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) => _checkExistingSession());
WidgetsBinding.instance.addPostFrameCallback(
(_) => _checkExistingSession(),
);
}
Future<void> _checkExistingSession() async {
@@ -71,15 +73,6 @@ class _LoginScreenState extends State<LoginScreen> {
),
),
),
if (_checkingSession)
const Padding(
padding: EdgeInsets.only(top: 12),
child: SizedBox(
height: 24,
width: 24,
child: CircularProgressIndicator(strokeWidth: 2),
),
),
const SizedBox(height: 50),
const LoginPanel(),
const SizedBox(height: 16),
@@ -95,6 +88,24 @@ class _LoginScreenState extends State<LoginScreen> {
);
},
),
if (_checkingSession) ...[
const SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(
height: 24,
width: 24,
child: CircularProgressIndicator(strokeWidth: 2),
),
const SizedBox(width: 8),
Text(
'Trying to log in',
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
],
],
),
),
@@ -193,9 +204,9 @@ class _LoginPanelContentState extends State<LoginPanelContent> {
setState(() {
_loggingIn = false;
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Login failed: $e')),
);
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('Login failed: $e')));
}
}
@@ -306,14 +317,16 @@ class _RegisterPanelContentState extends State<RegisterPanelContent> {
);
if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Registration successful. Please log in.')),
const SnackBar(
content: Text('Registration successful. Please log in.'),
),
);
widget.onBack();
} catch (e) {
if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Registration failed: $e')),
);
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('Registration failed: $e')));
} finally {
if (mounted) setState(() => _registering = false);
}